Forum Discussion
Altera_Forum
Honored Contributor
12 years agoRead JTAG UART nios II
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 ...
Altera_Forum
Honored Contributor
12 years agoHi, did you write your code in an interrupt or in the main program ?
You employ a function when you initialize a local variable : alt_32 wrd = iord(jtag_uart_base,0);. You should first initialize the variable : alt_32 wrd = 0; then read a char from UART and store it to the wrd variable : wrd= IORD...; There are MACROs to read a character or send a character from/to UART : char crd; crd = IORD_ALTERA_AVALON_UART_RXDATA(JTAG_UART_BASE); // for example