Forum Discussion
Altera_Forum
Honored Contributor
11 years ago --- Quote Start --- just made sense to minimize the HW if possible. --- Quote End --- Once you've debugged your system, you can decide whether to use just a USB cable to the USB-to-UART interface, or just a cable to the USB-Blaster. Ultimately you'll only need one cable per board. However, while developing, it makes sense (to me) to use the USB-to-UART for NIOS II communications, and the JTAG interface for debug tools. --- Quote Start --- We do have one of those little usb spi cables --- Quote End --- You don't need it just yet. Start with the USB-to-UART that exists on your board. --- Quote Start --- I realize that what is instantiated in my qsys is the jtag_uart. --- Quote End --- Right, so change that for a regular UART, and you should be all set! --- Quote Start --- Ive read that i cant use putty etc to talk to this jtag_uart --- Quote End --- Right, because its not really a UART, its the JTAG interface polled by Altera's software, so its not really an "Asynchronous" interface in any way at all. Its a simple interface that is suitable for simple tests. Since you want to also use SignalTap II and SystemConsole, you're probably asking a little too much of the JTAG port. --- Quote Start --- How would i create and use the usb-uart interface? --- Quote End --- Read the Qsys documentation for the NIOS II UART. The USB-to-UART is *already* part of your board. You just need to connect the Qsys TXD and RXD wires to the top-level pins. --- Quote Start --- What tools do you use to interface with usb-uart? Putty? --- Quote End --- I use Tcl/Tk, exactly what you use now for SystemConsole access. You can use SystemConsole, or since the UART is a separate USB device, you can use ActiveState ActiveTcl. --- Quote Start --- How do i use this to move massive amounts of data through the usb-uart? one character at a time or is code to take entire files or big chunks and push it through? --- Quote End --- Write a large buffer. Here's some code ... I'm writing it directly into the forum, so it might be buggy, but it'll give you something to work with ...
# Open the serial port for buffered line access
set portname "\\\\.\\COM5"
puts "Open serial port"
set fd
fconfigure $fd -mode 115200,n,8,1
fconfigure $fd -buffering line
# Write a line
puts $fd "Hello world!"
# Read the response
set response
puts "Response: $response"
# All done!
close $fd
Rather than printing a message, you could read a file into a buffer, and then write the file. The annoying thing about your board is that there is no RTS/CTS handshake on the UART interface, so its quite possible you could lose data. You'll have to test and see. Cheers, Dave