Forum Discussion
Altera_Forum
Honored Contributor
20 years agouC/OS-II friendly UART communication
Hi, I'm trying to set up a few communication links using UART. One is at 115.2kbps and the others are at 9600bps. One is obviously going to be used quite a bit and the others not so much....
Altera_Forum
Honored Contributor
20 years agoUsing interrupts will work well. Just use your ISR to populate a buffer with the characters as they are received and move a head pointer. Then poll the head and tail pointers of your buffer in your main loop. If the head and tail don't match then write the character to memory(or whatever you need to do with it) and move your tail pointer. Use as many buffers as you have UARTs. You can also populate a buffer and send characters from it by polling in your main loop as well.