This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

UART Reception only 6 bytes

Hello,

Using the "simple_uart_get_ with_timeout",I cannot receive a "frame" bigger than 6 bytes. Why?

while(simple_uart_get_with_timeout(1, &UART_RX[receivedBytes])){receivedBytes++;}

How to deal with this problem?

thank you!

Parents
  • When you have 1ms as timeout, you can receive all 6 bytes in the FIFO right away. Probably before your software runs to simple_uart_get_with_timeout, the 6 bytes already received by UART. But for the 7th byte to come into the UART, it will take time based on your BAUDRATE. 1ms is not enough if your baudrate is less than 9600. 450ms sure works. :-)

Reply
  • When you have 1ms as timeout, you can receive all 6 bytes in the FIFO right away. Probably before your software runs to simple_uart_get_with_timeout, the 6 bytes already received by UART. But for the 7th byte to come into the UART, it will take time based on your BAUDRATE. 1ms is not enough if your baudrate is less than 9600. 450ms sure works. :-)

Children
No Data
Related