Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: USART string reception

2004-11-20 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, "Ian Drennan" <ianid@s...> wrote:
> I [...] want to receive and store a string of 10 bytes transmitted 
from the PC. [...] I am using the USART in asynchronous mode on the 
mega8 and want to use the USART Receive Complete Interrupt for each 
received byte. [...] do I need to send an ack for each byte received 
to pace the transmission from the PC? 

No, it's simpler than that.  You just need to enable the interrupt 
and write an interrupt handler to retrieve the received character.  
Unless you're using "flow control" (which requires additional 
circuitry and logic) the PC will simply send the characters one after 
the other whether or not you retrieve them properly.

If you want to, you could design the two ends of the comm channel to 
implement acknowledgement.  You could write special code on the PC 
end to wait for the acknowledgement before the next character is 
sent.  This is probably not necessary unless you have special 
circumstances which increase the probability of character loss.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.