- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
for(int i = 0; i < size_start_num; i++)
{
start_num = UART_ReadRxData();
CyDelay(100);
}
I am assuming that when I use UART_ReadRxData(), I should read data in UART_rxBuffer but looks like it is not.
Simon
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please post your complete project or a shortened version that shows the error so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
An issue may be that you do not wait for a byte ready. Try using the UART_GetRxBufferSize() API.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please post your complete project or a shortened version that shows the error so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
An issue may be that you do not wait for a byte ready. Try using the UART_GetRxBufferSize() API.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I add
while(UART_GetRxBufferSize() < size_start_num)
{
}
and fix it. but looks like the speed to get out this while loop is very slow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your loop ends when all characters are transmitted. Since UART transmission al lower baud rates are comparably slow when looking at the processor clock (several MHz). At 9600 baud the transmission of a single byte will take 1.25 ms.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Recently I posted a sample for similar theme.
tty_utils a utility sample for CLI type program
Please take a look at it, when you have time 😉
moto