- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
One simple SCB UART test under pSoc4 was created.
TX works well with UART_1_UartPutString() or UART_1_UartPutChar().
However when I try to receive some Bytes (sent from PC) using RX Interrupt, there is problem.
1. Some Bytes are firstly sent to PC. --> OK
2. One Byte (e.g.0x06) is then sent back to module. At the first time when the TX_interrupt is called, this Byte 0x06 can be correctly received. After that this TX_interrupt is continuously called again and again, the received data is always 0xFFFFFFFF. What does this mean?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you are using an interrupt why do you have a wait of 100000? Also increase heap to 0x200. I updated your code to the latest Psoc Creator 4.0 SP 1. The interrupt code you wrote in the CY_ISR(isr_uart_1_Interrupt) throws errors. best practice is not to put your interrupt code in this area and have it in the main.c.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi, bobgoar, firstly thanks for your quick answer!
I have made some changes in order to test RX function only (in fact there is very few code in this test project.):
1. delete unnecessary send function.
2. set larger heap to 0x200.
3. test UART_1_UartGetByte() in both main() and ISR.
The problem can not be solved. Either the loop in main() or ISR has the same problem: UART_1_UartGetByte() returns 0xFFFFFFFF when there is no data sent from pc. (If one or more bytes are sent from pc, both of them can receive these bytes.)
However the influences of these two methods are different, the main program is totally BLOCKED if the method is ISR and it is continuously being miscalled. The question should be: why the uart interrupt is always being triggered even though no more data is valid on the uart line.
I have configured the UART1 interrupt triggered by External - RX Fifo not empty. Is that correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, odissey1! This example is very helpful for me.