به نام خدا
hi
your code is not right for this application.
you can follow this code to arrive to your idea:
if(UCSRA & 0x80)
{
data=getchar();
}
code written for ATMEGA16.
http://up.vatandownload.com/images/c2s9tmogjxqtmw3i2kw.jpg
I saw you "read USART section of your AVR datasheet carefully" and say you again
, read your AVR datasheet carefully , you will find your answer.
________________________________
From: Ahmed Mostafa <justforstudy2011@gmail.com>
To: AVR-Chat@yahoogroups.com
Sent: Friday, July 8, 2011 13:45:32
Subject: Re: [AVR-Chat] time of getchar
thanks for your help
actually i don't use interrupt
and if it didn't receive data , i want it to skip the getchar command
so can i use
if(getchar()) //instead of if(rx_counter0)
{
ch = getchar();
}
[Non-text portions of this message have been removed]Message
Re: [AVR-Chat] time of getchar
2011-07-08 by ho hoh
Attachments
- No local attachments were found for this message.