This blog post tells you how to observe memory locations in the debugger watch window. This is useful if you want to group together and view separate memory locations that are linked by functionality such as DAC configuration, DAC routing and DAC trim.
To observe memory in the XDATA space, use the following in the watch window:
*((char*)0x01yyy)
Where YYYY is a 2 byte address. This limits the addressable range for XDATA to 64KB. The char designator restricts it to a single byte, which for most debugging purposes is sufficient.
*Note: There are no spaces in the name.
Other observable memory locations:
The address spaces are limited based on address type through the watch window (Keil limit), and everything must be addressed via the 24 bit address.
XDATA: 0x01YYYY 64k limit
DATA: 0x0000YY 128 byte limit
CODE: 0xFFYYYY 64k limit
PDATA: 0xFE00YY 256 byte limit
Other types: Char is not the only allowable type. For larger values (16 and 32 bit) you can also use int and long:
*((int*)0x01YYYY)
*((long*)0x01YYYY)
Be aware though, Keil is a big endian compiler, so it will interpret memory differently than if you read it out of the memory window. For example:
In the memory map:
0x7000 0x7001 0x7002 0x7003
FE 00 00 1F
The result of the watch window:
Watch window expressions:
You can also create interesting expressions in the watch window:
In the memory map:
0x4690 0x4691
77 02
(int)(*((char*)0x014690)+(*((char*)0x014691)<<8))
This generates the following value -> 0x0277
For PSoC 5 (GCC), there are no memory restrictions for PSoC 5 so the entire register space can be accessed in the debugger.
The same techniques apply for PSoC 5 when setting up watch variables for memory locations, although the compiler is little endian oriented, so the int and long values will look different from PSoC 3 to PSoC 5 for the same value:
In the memory map:
0x7000 0x7001 0x7002 0x7003
FE 00 00 07
The result of the watch window:
Quick Reference (PSoC 3):
XDATA: *((char*)0x01YYYY)
*Limited to 64 KB, no spaces in name
CODE: *((char*)0xFFYYYY)
*Limited to 64 KB, no spaces in name
DATA: *((char*)0x0000YY)
*Limited to 128 B, no spaces in name
Quick Reference (PSoC 5):
ALL MEMORY: *((char*)0xYYYYYYYY)
* no spaces in name
Hi,
according to the 5LP reference manual the datapath outputs are registered, but it's also possible to use the combinational signal. Unfortunately, I can't find any information about how to enable the combinational output on the device.
For simulating the component, I figured out that it seems to be enough to override a parameter, e.g. so_sync, etc.
But I doubt that this is the correct way to enable combinational output on the PSoC device. Digging deeper into the device manuals shows that this feature seems to be bound to the corresponding UDB config register #8. The default value of this register within the component definition is 0x00.
But here the user can't know which bit is assigned to the output which should be combinational. So, how to correctly enable combinational output for datapath output mux?
Regards
I am using psoc5lp-cy8c588lti. I am trying to do the example with UART and ADC, CE195277_ADC_and_UART. I connected pin P[0] to VDD. The problem is I don't get other readings beside a continous string of sampled data, and I dont manage to break the continous stream of data, as I should by using the character x or X. If I type E or C as stated in example, the terminal prints continously gibberish characters, and in between them i see the value requested. But when i press s for a couple of items or continously the terminal starts to print the sampled data indefinetly. Again the terminal isn't responsive to characters that I type so i have to type them multiple times to get a response. What am I doing wrong ? I tried building a simple project with just UART to display something through pUtty or TeraTerm, to no succes.Baud rate and other settings between Putty and UART are set accordingly ( the baud rate is 9600 for both).
Show Less
Hi Infineon expert:
I build the USBFS_HID example code and try to program to CY3295-MTK kit, but it alway shows an error "Error: dbg.M0023: There was an error while programming the device: PSoC Programmer reported error (100 - FAILED! SWD respond packet contains Failed status!). I recude the SWDCLK to 0.2MHz, it still show programming fail. Do you know how to fix it, thanks.
Tommy
Show LessHi! When I create a new project for psoc 5 LP. A window pops up saying cy_isr_v1_71 datasheet is not available in English. After placing an Interrupt component on the Top Design and build the project, a lot of errors come up, all about the generated isr.c and isr.h file. I have attached some screen shots of the problem.
I have tried remove everything and re-install Psoc Creator but the problem still persists. Please help.
Show LessHi,
I am using PSOC5 LP in my design and have USB interface with external Windows based application.
Is it possible to use Python script to access to PSOC resourcing (GPIO/I2C/UART) by Python script?
Thanks.
Show LessHi,
during the last 2 years we face problems in purchasing Psoc5LP, CY8C5888AXI-LP096 microcontrollers.
So we start using different part number of the same family in order to mantain our product without changing the PCBs.
Now we are not finidng any alternatives, we use 200 pieces per year at least... (not so big number...but...)
It is not possible to find any psoc5LP anywhere... we tried all supplier broker distributor but no luck.
Do you have any hint? Moreover even other families seems to be scarce.
I would like to continue with cypress MCU because I like them, but it seems that they don't sell their product anymore... or sell just to some customer... this is very frustrating!!!!!!!!!!!!!!
Show Less
Dear Bob,
First of all thanks your Matrix keypad component.
To cut the story short:
it's works as expected but I've two annoying problems :
1.) only works by polling, e.g.: from main loop, like:
if (MyKeyPad_CharReady() != 0) // Check the buffer for a key already entered. Returns != 0 if character available
{
ButtonPressed = MyKeyPad_GetChar();
SW_Tx_UART_1_PutString("Main Loop a button READED: ");
SW_Tx_UART_1_PutChar(ButtonPressed);
SW_Tx_UART_1_PutCRLF();
}
but not works from attached interrupt (InterruptType: rising edge setted): the interrupt never fire 😞
like:
CY_ISR(isr_KeyPressed_Handler)
{
...
}
int main(void)
{
CyGlobalIntEnable;
...
isr_KeyPressed_StartEx(isr_KeyPressed_Handler);
MyKeyPad_Start(Translation_Table);
}
2.) I use with 4x4 Matrix keypad, like:
https://www.hestore.hu/prod_10041773.html#
The problem: all keys works, except the last row, last column key ('D'): this does nothing.
(P1[0] and P1[4] intersection)
(I use Cykit 059, Columns P1[3:0], Rows P1[7:4])
Would you be so kind to help me to figure out what should be the problem ?
Thanks in advance,
Have a nice day,
Peter
Show Less
Hello,
I have seen many others having a similar issue, but wanted to post in case my issue is slightly different.
I am using PSOC5LP I2C Master Mode with a DS2484 I2C to 1-Wire Converter.
Everything is working fine - I2C writes and reads, but there are times where something happens (Not sure what is causing this) and the PSOC hangs up in the below infinite while loop
I have implemented a simple watchdog using a 1ms timer interrupt - when the watchdog counter fails to reset, I attempt to reset the I2C peripheral using the following lines. This does not work, and the code continues to sit in the while loop.
The only thing that actually works is calling for a SW reset....Not ideal at all.
Perhaps I'm not calling the right API to actually reset the I2C peripheral, if this is the case, please advise on the proper way to reset the peripheral so that I can break from the while loop.
From a logic analyzer standpoint, when this occurs, SCL and SDA are both logic High and remain at logic High
Ideally we do not want to call a software reset for something as small as this. Can anyone provide any input on what can be done to get "unstuck" from this infinite while loop?
I could implement a timeout inside the while loop, but I fear that this will be an issue when regenerating code, is that correct?
Please let me know what the best course of action to take is.
Thank you,
User | Count |
---|---|
544 | |
267 | |
239 | |
195 | |
127 | |
87 |