- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We use the UART component of PSoC5LP.
The UART component has "UARTRX-On Byte Received" enabled.
Interrupt is generated by receiving byte data,
The following processing is performed in the interrupt.
/* UART Rx interrupt routine */
while ((UART_1_ReadRxStatus() & UART_1_RX_STS_FIFO_NOTEMPTY) !=0) {
uint8 data = UART_1_GetChar();
}
In this process, data cannot be obtained normally by the _GetChar() API.
However, it can be received normally if modified as follows.
/* UART Rx interrupt routine */
while ((UART_1_ReadRxStatus() & UART_1_RX_STS_FIFO_NOTEMPTY) !=0) {
uint8 data = UART_1_GetReadRxData(); // Change API
}
In this case,
What is the difference between Get_Char function and ReadRxData function?
I confirm for the contents of each API,
The GetChar function checks the status flag, and the ReadRxData function does not check the status flag.
I think the difference is only checking the status flag.
Does this difference affect the behavior?
Regards,
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MaMi,
The issue you are seeing is that GetChar() is primarily designed to be used in a Rx polling strategy.
If you want to use GetChar() try getting rid of your API call to ReadRxStatus(). Since GetChar() reads the RxStatus register, at a minimum it is redundant to your ReadRxStatus() call.
Len
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MaMi,
The issue you are seeing is that GetChar() is primarily designed to be used in a Rx polling strategy.
If you want to use GetChar() try getting rid of your API call to ReadRxStatus(). Since GetChar() reads the RxStatus register, at a minimum it is redundant to your ReadRxStatus() call.
Len
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Len-san,
Thank you for your reply.
We understaoo that redundancy is a problem.
We take care not to use CetChar() and ReadRxData() of API the same way.
Regards,