Thread: SD card adapter
View Single Post
Old 13 September 2014, 04:09   #39
Registered User

Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 410
That is exactly what Ferix is doing with his project. Bit-banging the SPI requires sending a dummy byte for every byte you receive. Add another byte for handshaking and now you have reduced the maximum speed considerably. There is also a LOT of setup to just send a command to the SD card for each block and that data would have to be sent over the parallel port too, killing speed.

By using just the parallel port (and it's auto strobe/ack features), I can send just a block number to fetch from the Amiga side and the PIC gets the data via DMA'ing the SPI port to internal RAM. Since the SPI bus is way faster than the parallel port the transfer back to the Amiga can occur as soon as the buffer starts getting filled. This reduces the overhead of having to wait for data to send (although the SPI is typically 20MHz for SD cards). When data is being sent to the card for storage, it can go into a dual "ping-pong" buffer that will DMA the data to the card while potentially another block is being sent to the other buffer. It only takes a 20 pin PIC really to do it. But I am using a 28 pin PIC and adding some other "things".
JimDrew is offline  
Page generated in 0.06380 seconds with 9 queries