Forum Discussion
Altera_Forum
Honored Contributor
14 years agoHow to access UART that is not STDIN or STDOUT
how do I access / call the uart if it is not SDTIN or STDOUT? my nios has 3 uarts, UART_ONE at 115200, UART_TWO at 57600, and UART_THREE at 38400. in my SOPC, UART_ONE is set to STDIN and STDOUT, and...
Altera_Forum
Honored Contributor
14 years agoFor a specific board/product (etc) you don't need the generalisations assumed by the POSIX file access functions. It is almost certainly enough to have a 'write buffer (or string) to UART' function.
You then need to decide where to buffer data (software or fifo buffer). This rather depends on how much data you might need to buffer - eventually the code will have to spin/sleep or discard anyway. A hardware fifo might be easiest - if you can afford a full memory block. I'd also consider whether you need to use interrupts. It may well be possible to add a check of the uart registers to the main schedule/process loop. Not using interrupts will probably generate smaller and faster code.