03-18-2010 01:59 AM
as a total amateur, I would like to ask a question about interfacing my CoolRunner-II CPLD Starter Kit via the on-board USB port. Is it possible to use the on-board USB device for programming the CPLD and afterwards utlitize it as a communication interface of the implemented application? If it is possible, how should I do it? :) Or do I need to implement an extra communication interface?
Thank you in advance, Maria.
03-22-2010 07:42 AM - edited 03-22-2010 09:24 AM
I don't have any definitive answers; just a [somewhat] educated guess for you. Let me preface this by saying I have no experience with using USB cores, but I do know they exist (found some at opencores.org). I do have a little experience with USB communication though.
I was about to say "probably not" until I stumbled on this and this. These relate to the Xilinx 3E Starter Kit, which apparently uses a Cypress CY7C68013A EZ-USB, with proprietary firmware, to communicate with the JTAG chain. These projects appear to circumvent that by using a custom firmware in the Cypress chip.
So, the answer would be: it depends on how your CoolRunner is hooked up to the USB. More than likely, yours is probably using the same or a similar method as the Spartan 3E. So while possible, you will probably have to do some tweaking to get those examples running on your board, because the second web site says, "The Spartan 3E Starter Kit is xup's only supported hardware platform".
As a beginner, you might not want to put that much effort into your USB communication-- USB is not an easy protocol to deal with. Plus, I think that replacing the firmware on the Cypress chip has very little to do with learning CPLD/FPGA logic, and it will delay you from learning about what you're really trying to learn.
If you just want to get up and running quickly, my advice would be to buy a FT232RL breakout board (or make your own) and implement a simple serial interface in your CPLD. An FT232RL allows your computer to see a USB connection as a serial port, so you can use HyperTerm or PuTTY (in Serial mode) to send data to and from your CPLD/FPGA design.
Another option would be to find a USB core and upload it into your CPLD; then use your CPLD's General Purpose IOs (GPIOs) as the D+/D- lines. However, I doubt that a USB core would even fit into a CPLD!
Hope this helps!!
03-22-2010 07:55 AM - edited 03-22-2010 09:00 AM
By the way - a "core" means logic that functions within a CPLD or an FPGA. So a "USB core" would essentially be a program that would make your CPLD act like a USB device.
A FT232RL is an integrated circuit manufactured by FTDI that acts like a USB device. It makes your life easier by implementing all the USB logic for you so you don't have to deal with the details of the USB protocol. Your computer sees it as a COM (RS232) port.
You may know these things already, I just wanted to explain in case you hadn't gotten to that point yet! :-)
One more consideration that I forgot to mention is the USB drivers on the computer-side. If you are using a FT232RL, you will probably not need any drivers since they are built in to Windows (and probably Linux/Mac OS). If you use another method of USB communication, you may have to write custom software or drivers to communicate with your device.