Forum Discussion
Altera_Forum
Honored Contributor
14 years agoCommunication PC-De0 Nano
Hello everyone,
I need to make a GUI that could communicate between pc and my De0 nano. I could make the GUI with QT but I don't know how the communication work. I am aware that every time I connect my fpga to my pc, there is always a new com show up in the device manager. Based on my past experience using microcontroller, it is possible to use serial communication via usb and display the data using hyperterminal. What is my option to send a packet of data from fpga to pc? Could it perform bidirectional communication? Thank you everyone.33 Replies
- Altera_Forum
Honored Contributor
Thank you, Dave.
Don't worry. Thanks for your effort during weekend. :) I don't know how to show my gratitude - Altera_Forum
Honored Contributor
How about TCK? Does it also the output of the virtual jtag(vji)? I think we should generate a clock which we feed into the vji(not sure either).
- Altera_Forum
Honored Contributor
--- Quote Start --- How about TCK? Does it also the output of the virtual jtag(vji)? I think we should generate a clock which we feed into the vji(not sure either). --- Quote End --- The Virtual JTAG component ports TCK/TMS/TDI are outputs, and the TDO signal is an input. These pins correspond to the signals coming from the FPGA pins via the Virtual JTAG component into your design. For your first design, you can ignore all of these signals, and just wire ir_in to your LEDs, and ir_out to some push buttons. You can then use quartus_stp and device_virtual_ir_shift to write to the LEDs and read from the push buttons. Cheers, Dave - Altera_Forum
Honored Contributor
Hello Dave,
I was just telling my proffesor that I would like to use virtual jtag instead of usb to Ttl(serial). Something about his background, he is not familiar with fpga but familiar about communication between pc and microcontroller. He said that I cannot just get my data on pc side from my fpga just like usb to ttl do with hyperterminal. He is not questioning about my programming on fpga side but he is questioning about my programming on pc. He said if I use the jtag, I should make my GUI(on pc side) to follow jtag protocol(which is complicated). He also said I could not get the data from hyperterminal directly (like usb to ttl do)even if my virtual jtag on fpga do work. I don't really get it. Could you please tell me what he think? All this time I think I could send my data from fpga to pc using virtual jtag via hyperterminal just like usb to ttl(serial) do. Thank you, Dave. - Altera_Forum
Honored Contributor
--- Quote Start --- I don't really get it. Could you please tell me what he think? All this time I think I could send my data from fpga to pc using virtual jtag via hyperterminal just like usb to ttl(serial) do. --- Quote End --- What your professor is wisely telling you is that you should take the 'easiest' approach. If you use a standard serial port device on the PC-end to communicate with your FPGA, then the 'work' is at the FPGA end. However, you now have to have two pieces of hardware hanging off your PC USB ports (the FPGA board and the serial adapter) and then you have to wire the serial cable into the DE0-nano board. The JTAG interface provides a mixture of work at both ends. At the FPGA side, you have to write some logic to interface to the component. At the PC end, you have to use the Altera Tcl scripting interface. Using the Tcl scripting language, its fairly simple to create a server, i.e., a program that provides clients access to the FPGA hardware. The tutorial shows how to create an FPGA design, provides Tcl scripts that implement a server, and a client Tcl/Tk GUI for turning LEDs on or off. You can show your professor this interface, and he can then decide whether or not he likes it. Cheers, Dave - Altera_Forum
Honored Contributor
Thank you, Dave.
Is it possible to send data from fpga using virtual jtag and shows the data at hyperterminal or other similar program like qt comport? I still want to try it. - Altera_Forum
Honored Contributor
--- Quote Start --- Is it possible to send data from fpga using virtual jtag and shows the data at hyperterminal or other similar program like qt comport? I still want to try it. --- Quote End --- It is not possible directly with the Altera component, since they do not provide an operating-system device driver. However, you can get the same effect using a server. For example, you can connect a terminal program to a socket and send characters over the socket. This is what the client/server application I have written does. The server side of the application takes the place of the device driver. Cheers, Dave - Altera_Forum
Honored Contributor
Ok then, I am looking forward to your tutorial.
I will try digging more about this issue. - Altera_Forum
Honored Contributor
Hello Dave, have you finished the tutorial?
I am really curious about virtual jtag. In my uni, everyone use usb to ttl or rs232 so it is nothing special. I'd like to try something else. Thank you Dave. - Altera_Forum
Honored Contributor
--- Quote Start --- have you finished the tutorial? --- Quote End --- Not yet. I was going to try and finish it tonight, or tomorrow, so its not too far away. Did you manage to get your virtual JTAG design to blink some LEDs? Cheers, Dave