I am trying to send/retreieve data from/to FPGA
using Matlab. I connected FPGA
using Virtual com port. Now how to send data from Matlab to FPGA
or read data of FPGA ?
FTDI 2232H
is on the FPGA
as well. I connected external LED's and switches on the I/O ports
of the FPGA
.
I am new in this field, so want some guideline to start communication b/w MAtlab
and FPGA
:
I tried following code:
s1= serial('COM9')
fopen(s1)
. Is it the right way to communicate ? Kindly guide. thanks
FPGA's are configured using a Hardware Description Language (HDL) such as Verilog or VHDL. These languages let you specify how the switch configuration within the FPGA, which in turn lets you construct your custom digital logic and processing system.
The HDL Coder Toolbox in Matlab lets you design and prototype your custom logic using higher-level functions, which are then translated into HDL and can be be used to directly program your chip. This tutorial describes the process in detail.
If you already have a design implemented on your FPGA and want to communicate with that implementation, you would use Matlab's serial port communication functions. The exact protocol will depend on the interface you have implemented.
Some intermediate debugging steps I find helpful:
The key here is to take small, incremental steps, physically verifying that things are working each step of the way.