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

JTAG-UART Help Needed

Altera_Forum
Honored Contributor II
1,049 Views

Hi, 

I am trying to establish a link between a PC and NiosII board to print characters on the LCD. I am trying to have a console of something similar on the PC where i can type or enter characters and will be sent to the DE2 board running NiosII and print them on its LCD. 

I have found an example that does something similar but there is no input to the board in real time from PC. 

__________________________________________________________# include <stdio.h># define JTAG_UART_DATA ((volatile int*) 0x10001000)# define JTAG_UART_CONTROL ((volatile int*) (0x10001000+4)) 

int main() 

unsigned char hwld[] = {'h','e','l','o','\0'}; 

unsigned char *pOutput; 

pOutput = hwld; 

while(*pOutput) //strings in C are zero terminated 

//if room in output buffer 

if((*JTAG_UART_CONTROL)&0xffff0000 )  

//then write the next character 

*JTAG_UART_DATA = (*pOutput++);  

} }} 

__________________________________________________________ 

As you can see, "HELLO" is hard-coded. I can see the text being sent to the Altera Monitor Terminal, My question is how can i type this in real time and have the board scan the JTAG-UART over and over again? What program shall i use? Thanks.
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
343 Views

One way is to use the GetInputString command. Check out this design example on ALtera's design store: https://cloud.altera.com/devstore/platform/15.0.0/nios-ii-qsys-hello-world-lab/  

look under the software directory for the hello_world_hardware_interrupt.c and you can use that as a guide.
0 Kudos
Altera_Forum
Honored Contributor II
343 Views

that's right... do monitor the incoming receiving byte via GETinputString, and then process the string.

0 Kudos
Reply