THis is for an XMEGA32E5 using Codevision.
I am trying to sense when a character has appeared in teh buffer - just a simple test - and echo it back. After snooping around I came across this thread:
https://www.avrfreaks.net/forum/...
Which is based on teh mega32 but its pretty much teh same code for the XMEGA.
I tried Davids suggestion of a #define like this:
#define DATARECEIVED() (rx_counter_usartc0 != 0)
and in the main loop:
void main(void) { puts("Bite Me!"); //This PRINTS to SERIAL PORT while (1) { if (DATARECEIVED()) putchar(getchar()); //This does nothing. No output }; }
But there is no echo back.
I even tried this to see if it at least fires:
void main(void) { puts("Bite Me!"); //This PRINTS to SERIAL PORT while (1) { if(DATARECEIVED()) { putchar('Y'); //Still does not print } } }
And still no output from teh serial port.
Very troubling
Jim