Hi.
Your problem is most likely that the compiler optimizes the line
while(!(UCSRA&(1<<UDRE))); away.
Try this instead.
while(condition=true)
{
while(!(UCSRA&(1<<UDRE)))
{
#asm("nop"); // or how ever your compiler accesses assembly
inside C.
}
UDR=data
}
Regards
Lasse Madsen
_____
From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf
Of aswinefy2003
Sent: 1. juli 2005 13:35
To: AVR-Chat@yahoogroups.com
Subject: [AVR-Chat] help problem in uart
i have the following code written in iccavr
while(condition=true)
{
while(!(UCSRA&(1<<UDRE)));
UDR=data
//delay();
}
the problem is when i remove the delay()routine ,atmega32 is not
transmitting the correct data ,but any how transmitting some
garbage .Please help
_____
YAHOO! GROUPS LINKS
* Visit your group "AVR-Chat <http://groups.yahoo.com/group/AVR-Chat>
" on the web.
* To unsubscribe from this group, send an email to:
AVR-Chat-unsubscribe@yahoogroups.com
<mailto:AVR-Chat-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/> Terms of Service.
_____Message
RE: [AVR-Chat] help problem in uart
2005-07-01 by Lasse Madsen
Attachments
- No local attachments were found for this message.