Quantcast
Channel: Altera Forums
Viewing all articles
Browse latest Browse all 19390

Read JTAG UART nios II

$
0
0
Hi,


I'm starting to learn some verilog coding and nios II. I'm using the book "Embedded SoPC Design with Nios II Processor and Verilog Examples" and in one example the JTAG UART is accessed directly without the HAL. The write function was provided in the example and it works fine. But I set out to make a read function. However unsuccessful. I know that the transmission of data from the PC works if I use the routines provided by the HAL but my implementation does not work.

I do this to read from the JTAG UART:

// Read from the JTAG UART address
alt_32 wrd = IORD(JTAG_UART_BASE,0);
// Check if the data is valid
if (wrd & 0x00008000)
// If so, get the 8 bits that correspond to the character
wrd = (wrd & 0x000000ff);
else
wrd = -1;

When I debug the code the value of wrd is always the same no matter what I send from my PC. I suspect that maybe the HAL gets an interrupt whenever a character i received and clear this register. Is that what happens? If so, is there any way to turn off this functionality?

Kind regards,
Anders

Viewing all articles
Browse latest Browse all 19390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>