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.
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?
Thanks, odissey1! This example is very helpful for me.