Connected SD card - how to make Kye's driver run slower?
pik33
Posts: 2,366
... but Kye's driver can't work @ 145 MHz. Set speed to 80 MHz and I have SD card mounted. At now I don't know if the Propeller is unstable @145 MHz or if something in SD driver run too fast.
Edit: All is clear now, the SD driver is running too fast. Class 10 card can be mounted @140 MHz while class 4 card cannot mount. Now I have to find a way to slow down the driver.
Edit: All is clear now, the SD driver is running too fast. Class 10 card can be mounted @140 MHz while class 4 card cannot mount. Now I have to find a way to slow down the driver.
Comments
There is always alternative, I have self-made low level SD circuit for DE2-115, It initializes a SD card and can read and write sector to a buffer. So, maybe it will be easer to rewrite block read and write procedures to make use of this.
Are you sure class x means anything to the simple spi mode we use?
The native mode is a problem. You have to calculate crc independent for every bit, 4 of them. It can be done with tables, but we will then lost all the speed gain. Of course this can be done with an FPGA.
The spi mode works up to 50 MHz with modern card. I have a self-made hardware controller for SDHC card which initializes the card, then it can read and write a sector to memory buffer. 50 MHz gives up to 40 Mbps which may be sufficient for the Propeller.I used this with Nios2e and reading these 512 bytes from the buffer was much more slower than reading them from sd to the buffer in spi mode. Of course the Propeller - one cog of it - is several times faster than this NIOS (working up to 80 MHz on DE2-115, 6 clocks for instruction)
Even with my Tachyon SDFS I had problems at 140MHz with different cards but it works fine at 120MHz. I will have to find a spare class 10 card to see if it works any better.