avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Help Needed (UART / USART)


From: kitts
Subject: Re: [avr-gcc-list] Help Needed (UART / USART)
Date: Sat, 31 Mar 2007 11:30:18 +0530
User-agent: KMail/1.9.6

On Saturday 31 Mar 2007 at 3:17:02 am, mickhail mcanuff wrote:
> uint8_t USART_vReceiveByte()
>
> {
>
>
> while((UCSRA&(1<<RXC)) == 0);// Wait until a byte has been received
>
> if (UCSRA & (1<<DOR)|(1<<FE)==0) //check for framing error and data over
> run return -1;
>
>
> return UDR;// Return received data
>
> }

You are returning a negative value while using an unsigned data type. It 
seems to me that you do not have a debugger. Instead of in main, put 
differrent value out on the receive function just to know which condition 
came true.
-- 
Cheers!
kitts




reply via email to

[Prev in Thread] Current Thread [Next in Thread]