jetal
Junior Member level 1
I am contemplating on how to write an experimental application in C that uses both hardware UARTs in the Mega161 AVR chip. I will be using ICC AVR for development.
From the ICCAVR help file/manual, I can see that I can use putchar() and getchar() to send and receive characters. However these functions do not define which UART the character is being sent to or received from.
To me it looks like I have to write my own modified putchar0() and putchar1() functions to write to the different UARTs and similar for receiving. I can see that its not a difficult job doing this, but is this the easiest method or is there something better?
If anyone has done something similar it would be nice to see a code snippet.
From the ICCAVR help file/manual, I can see that I can use putchar() and getchar() to send and receive characters. However these functions do not define which UART the character is being sent to or received from.
To me it looks like I have to write my own modified putchar0() and putchar1() functions to write to the different UARTs and similar for receiving. I can see that its not a difficult job doing this, but is this the easiest method or is there something better?
If anyone has done something similar it would be nice to see a code snippet.