0

I'm trying to configure/write VHDL code that would let me output or input data from the USB port on a Basys3 FPGA board. Problem is I have yet to found any threads or questions that talk about this topic.

The nearest thing to an answer I've found is this:

Provide input data to FPGA using USB

and it does not contain what I'm looking for. Any clues anyone¿?

Community
  • 1
  • 1
DoctorMckay
  • 135
  • 3
  • 11
  • Welcome to Stack Overflow! To give you a great answer, it might help us if you have a glance at [ask] if you haven't already. It might be also useful if you could provide a [mcve]. – Mat Jan 17 '17 at 16:44

2 Answers2

0

Read the manual for the Basys 3 board. It will explain how you can interface with USB devices plugged into the USB port. Be warned, however, that your options are pretty limited.

Short version: if you plug in a USB mouse or keyboard, they will be exposed to your design as an emulated PS/2 device. USB storage devices can be used to configure the FPGA. Other devices are not supported.

  • I've read it, problem is that it only explains how to use peripherals connected to the board. It does not talk about connecting a transmitter(in my case) or sending/receiving data(even if it is raw data) for the program in execution. – DoctorMckay Jan 17 '17 at 17:24
  • What do you mean by "a transmitter"? If it's a USB device that isn't a keyboard or a mouse, though, it won't be recognized, and can't be used. –  Jan 17 '17 at 17:30
0

The Basys3 board has a usb-uart bridge chip as described in the reference manual. This will appear to a PC (or any device with a usb host and the appropriate usb-serial drivers) as a virtual com port. Sending data to and from a PC com port is quite easy.

You will need a uart implementation on the FPGA. There are lots of example designs on the web. One way is to implement a soft core microblaze processor with a uart peripheral in the FPGA. This example looks like it includes foundation for the functionality you desire.

The simplest implementation from the PC side is using a terminal program such as putty, Tera Term or realterm. Most languages include com(serial) port libraries or bindings. This type of interface tops out at a raw bandwidth of around 3-12Mbits per second depending on the drivers and implementation.

davidd
  • 783
  • 4
  • 9