Wednesday, February 13, 2019

Learning Verilog with the CYC1000

Finally getting comfortable writing some basic verilog code to walk the LEDs on the CYC1000 FPGA board.

I started with using Quartus WIN10 VM (using VirtualBox) and moved to Linux with Quartus 18.1 Build 625.  Had to over come a couple of basic issues with Quartus on Linux:
  1. Renamed /quartus/linux64/libstdc++.so to ./quartus/linux64/libstdc++.so.old for some reason, the library paths are not right when loading, will look at the more in the future.
  2. Some of megafunctions lock up, so, resize the dialog before moving to the next option or entering any values.
 I have not tried in simulation, but compiling, loading to SPI Flash or to the FPGA works fine.

The first example was a simple walking LED and has a loopback for the RS232 for the FTDI chip.

The CYC1000 is connected to the Channel A and B of the FTDI FT2232H.  Channel A, is for JTAG and Channel B is RS232/HighSpeed Serial/Or SPI.

To get /dev/ttyUSB0 working, need to change the 51-arrow-programmer.rules to remove deleting the serial interface.

# Interface number zero is a JTAG.
# SUBSYSTEM=="usb",\
# ATTRS{idVendor}=="0403",\
# ATTRS{idProduct}=="6010",\
# ATTR{interface}=="Arrow USB Blaster",\
# ATTR{bInterfaceNumber}=="00"
# RUN="/bin/sh -c 'echo $kernel > /sys/bus/usb/drivers/ftdi_sio/unbind'"

The end project is to use the protocol over the serial interface over USB to control:
  • SPI Master
  • 6 channel PWM decoder
  • 4 channels of OneShot 150/42
  • 4 channels DSHOT
  •  I2C A/D converter 
The RS232 loopback is working at 3Mbps using minicom.  The next project will be getting a Serial RX/TX/FIFO working.