Hello,
Here is a function straight from the Atmel data sheet for the ATmega8:
void WriteUART(unsigned char data)
{
while(!(UCSRA & (1<<UDRE))); //Wait for empty transmit buffer
UDR = data; //Write data into the buffer and transmit
}
Now for the issue, is that my compiler is complaining that UDRE is undefined. It has no idea what UDRE is. I am using CodevisionAVR.
I know that the UDRE is bit 5 of the UCSRA register. Has anyone else had UDRE undefined and/or know of a workaround? Is there a way syntactically to read just bit 5 of the register?
Thanks much!