jakubcabal / spi-fpga

SPI master and SPI slave for FPGA written in VHDL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not working on Cyclone II

lucagessi opened this issue · comments

Hi. I am trying to work with this library using an Altera Cyclone II, working at 50 Mhz.
I use an arduino as master. For debug I set a sclk of 100Khz or similar.
Arduino sends clock and data but miso does not change.
I have set data DIN_VLD to true and set a constant value of DIN input.

Nothing is received.
Thank you

Hi, do you have CS_N set to GND? And SCLK is without parasitic peaks, which could cause poor edge detection? You can try a Signal Tap (part of Quartus) to debug the signals inside the FPGA.

Yes, different voltage level could be a problem. Your test check only one direction (FPGA -> Arduino), right? But problem can be on oppostite direction. You can try simple voltage divider from resistors for voltage conversion from 5V to 3.3V (Arduino -> FPGA).

Also try SignalTap tool, then we will see the signals inside the FPGA and what is wrong.
Some tutorials about SignalTap:
http://pages.hmc.edu/harris/class/e155/SignalTap.pdf
http://scale.engin.brown.edu/classes/EN164S17/SignalTap.pdf

Please send me some screenshoots from SignalTap with the waveforms of all i/o SPI Slave ports and the waveforms of these internal signals: spi_clk_redge_en, spi_clk_fedge_en, bit_cnt_max, load_data_en, slave_ready, shreg_busy, rx_data_vld.