Re: RE: sd2iec ported to petSD

From: André Fachat <afachat_at_gmx.de>
Date: Mon, 30 May 2011 19:31:34 +0200
Message-ID: <20110530173134.284770@gmx.net>
Hi Ruud,

I've written up a page on how to access SD cards from a 6502:
http://www.6502.org/users/andre/csa/spi/index.html

It states that you cannot use the VIA's shift register for SPI
communication with the SD-Card and that you have to bit-bang the
data across the interface. However, on 6502.org, some smart guy
used an external delay line to delay the SPI clock, so the VIA's
shift register can still be used. The delay line depends on the
SPI clock frequency though. http://forum.6502.org/viewtopic.php?t=1674

Anyway, 50kB/sec means 50000*16 clock transitions (2 per clock pulse)
which is 800000 clock transitions per sec, so no, with bit-banging 
this is not possible with a 1MHz 6502. It might be possible with 
a 10-20MHz 6502 at 100% CPU utilization. 
With the shift register it is of course much different. With 50000
byte per second, you have 20 cycles per byte in a 1MHz CPU. Should
be about doable (you need to take ready-check into account or do a 
very accurate cycle counting), but with about 100% CPU utilization.

André


> I'm not familiar with SD cards when it comes to hardware design. So I
> have three question:
> - what hardware is needed to be able to read/write a SD card? More
> specific: would some pins of a 6522 do?
> - would a 1 MHz 6502 be fast enough i.e. is 50 KB/sec possible? 
> - are the sources available?

-- 
NEU: FreePhone - kostenlos mobil telefonieren!			
Jetzt informieren: http://www.gmx.net/de/go/freephone

       Message was sent through the cbm-hackers mailing list
Received on 2011-05-30 18:00:24

Archive generated by hypermail 2.2.0.