Yahoo Groups archive

AVR-Chat

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

Message

Re: Serial data Communication problem!

2004-04-13 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, "ereihani" <ereihani@y...> wrote:
> Is it the right way of transmitting data via serial port?
> I mean I put my data in UDR then in INT routine put the next data 
> and so on.

Well, one problem is that you never enable the interrupt on UDRE (bit 
5 of UCSRB).  If you're going to use the UDRE interrupt, you need to 
turn the enable on and off as new data is ready to be sent and old 
data is sent.  You probably should also implement a queue for data 
waiting to be sent and another one for data received.

There is example code, both for polled and interrupt driven serial 
comm, in AppNote AVR306 available here:
http://www.atmel.com/dyn/products/app_notes.asp?family_id=607

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.