# Transferring data from FPGA to PC (new to FPGAs)

FPGA beginner here.

I have a Basys2 FPGA board(i code in verilog) and i wish to make it communicate with my PC. Currently it receives data from a slave device and stores it in an 64 bit register. However i want to send this data to my computer for processing, and process it in matlab.

I have done some research. It seems like i can either use EPP API of digilent or just use UART communication.[: seems like this is out of option now, since i don't have access to a UART translator]. However i can't find any explanatory enough examples about any of the methods. Existing examples seem to have a bunch of code "that just works". But lack of explanation makes me unable to adapt it for my

For example there is DeppGetReg(HIF hif, BYTE bAddr, BYTE* pbData, BOOL fOverlap) function on the API but i don't know what to input(specificly the address) to provide to it to read values from FPGA.Only document i could find was in this link. I am clueless on UART too.

Here are the available I/O ports of FPGA. The only USB port is used for programming the FPGA, not sure if i can also have communication via that port.

I would appreciate if you can give any ideas on where to start considering my FPGA board. Thanks in advance.

• VGA port is video output, nothing to do with RS232 UART serial communications. This is actually explained in the BASYS2 "VGA Port" section of the reference manual digilentinc.com/Data/Products/BASYS2/Basys2_rm.pdf If you want to use a UART, you'll have to add-on an RS232 level translator such as Digilentinc.com PMOD-RS232 using one of the PMOD connectors. Nov 16, 2014 at 0:30
• @MarkU i thought it could be used directly for UART, my mistake. Can i use the single USB port for both programming the FPGA, powering it and making UART communication?
– vasf
Nov 16, 2014 at 10:42
• No, the USB controller on the BASYS2 board only supports JTAG programming and EPP 8-bit parallel read/write. Not serial UART. But RS232 UART is about the easiest peripheral to add, which is why it's such a useful diagnostic. Any RS232 level translator will do, MAX232 for example. Or, directly connect FPGA to an FTDIchip.com FT232. Nov 16, 2014 at 10:51
• Thanks for the information. Looks like i might first give the EPP a try since i don't have access to any additional hardware at the moment. 8 bit read/write sounds fine. I will edit the question.
– vasf
Nov 16, 2014 at 11:19

The USB port can be used to communicate with a design running on the FPGA, as well as for programming it. The Digilent Adept software can be used to interact with a design which implements this protocol; it's also possible to use the Digilent libraries to write your own software which uses this protocol. (I've also written a Perl module, Device::Digilent, if you'd prefer that to C.)

Information on the protocol is available at: