Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20703 Discussions

UART question related reads

Altera_Forum
Honored Contributor II
921 Views

Hello, 

I'm in the process of writing a UART driver to read a character from the register using a polling mechanism. After reading the character successfully I'll like to reset the status (or something) to get the next incomming character instead of the same old character. How do I make the UART get ready for the next new character? 

 

Here's the sequence of UART operations being employed: 

1. status = IORD_ALTERA_AVALON_UART_STATUS(UART_DEBUG_BASE); 

if (status == 0x60) then goto step# 2 else goto back to step# 1 

2. ch = (char)IORD_ALTERA_AVALON_UART_RXDATA(UART_DEBUG_BASE); 

3. What do I do here to the UART to avoid reading the same character that I just read in step# 2? Can I reset something in the UART so as to change the status next time around to some other value (i.e. the value of status is stuck at 0x60) so as to keep looping on step# 1 until the new character arrive in the read register? 

 

Much thanks in advanced - Phil 

0 Kudos
0 Replies
Reply