This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UART BUFFER

i have seen some UART code implemented using BUFFER.....
I have donE simple uart program using interrupt with lpc2148........
what is the advantage of using BUFFER

Parents
  • Advantage with a buffer?

    That you don't need to react at the exact moment when a character is received. You may let your main loop do what it needs to do, and now and then check the buffer for received data.

    Think about it. What is the difference between having to be home when the mailman comes, or having a post box and just have to check the box for received mail?

    Without ringbuffer, and without a FIFO in the UART, you will lose characters if you don't pick up the last received character before the next character has been shifted into the UART.

Reply
  • Advantage with a buffer?

    That you don't need to react at the exact moment when a character is received. You may let your main loop do what it needs to do, and now and then check the buffer for received data.

    Think about it. What is the difference between having to be home when the mailman comes, or having a post box and just have to check the box for received mail?

    Without ringbuffer, and without a FIFO in the UART, you will lose characters if you don't pick up the last received character before the next character has been shifted into the UART.

Children