Forum Discussion
Altera_Forum
Honored Contributor
11 years ago --- Quote Start --- 1)Seems like there are many different ways to access the uart data. ive seen gets, scanf, and several altera specific macros like altera_avalon_uart_rxData. Is one way better than the other? --- Quote End --- Try to use stdio function, eg., gets or getline. If Altera have implemented their stdio layer correctly, this should work. --- Quote Start --- 2)Is the data held in a uart buffer until i read it? using something like altera_avalon_uart_RXData would imply that it is. but maybe without flow control, that is not possible and polling is needed? --- Quote End --- The UART has hardware buffering, and the stdio library should also have buffering. --- Quote Start --- 3)Do i need to check status register of the uart before trying to read it? --- Quote End --- You should not be programming the UART at all. This should be taken care of by the stdio layer. --- Quote Start --- 4)Any ideas on the funny characters being printed out to putty? --- Quote End --- No. I'd start by simply printing strings from NIOS II, eg., "Hello World!" and perhaps the alphabet. If you see non-ASCII characters, then I'd suspect your UART baud rate is wrong. Cheers, Dave