BrunoLevy / learn-fpga

Learning FPGA, yosys, nextpnr, and RISC-V
BSD 3-Clause "New" or "Revised" License
2.58k stars 245 forks source link

SPI_FLASH_FAST_READ_DUAL_IO and Winbond W25Q32JV. #35

Closed at91rm9200 closed 3 years ago

at91rm9200 commented 3 years ago

Hello Bruno,

I have the Winbond W25Q32JV FLASH now working in SPI_FLASH_FAST_READ_DUAL_IO mode. According to the data sheet, this FLASH does not need dummy cycles in Fast Read Dual I/O mode. Instead of 8 dummy cycles (two byte) it needs one single Mode byte, correspondent to 4 cycles. The mode bits 5 and 4 should not equal to 2'b10, since this would change the behavior of the next read command.

From MappedSPIFlash.v, line 295:

clock_cnt <= 5'd28; // cmd: 8 clocks address: 12 clocks dummy: 8 clocks

If I set clock_cnt to 5'd24, everything is fine with my board. I tested with 16 MHz and 66 MHz clock frequency.

Regards, Bernd.

BrunoLevy commented 3 years ago

Hi Bernd,

at91rm9200 commented 3 years ago

Thank you.