Re: MMC/SD-Cards

From: André Fachat (afachat_at_gmx.de)
Date: 2007-06-29 23:39:24

Hi Wolfgang,

yes, unfortunately it is bit-banging. Although, for receiving 
you could actually use the shift register clock and let the 
external shift register do the thing.

In fact, it is possible to speed up the serial bus of the VIA
using the extra shift register shown in the circuit. The only problem
I had that this would represent SPI mode 3 - which does not work
with MMC/SD-Cards. I was quite disappointed myself when I found out
that.

However, using the external serial-in-parallel-out shift register 
fixes the VIA SR bug - you just don't use it. You could even do 
full-duplex this way.

SPI mode 3 actually works easily with the VIA's SR and a single
additional 'LS164 shift register, but that is asymmetric, i.e. 
the device has to listen to the clock and must always be ready to
shift out a byte (which is how the SPI protocol works anyway).

I had actually planned on investigating a serial bus similar to
SPI mode 3, only that both sides can send independently, but that
posed other problems (I had to count the 8 clock pulses to signal the
VIA the receipt of a full byte, and clear a kind of "stop sending"
feedback line "/RDY" to the sender, and then used VIA flag (CA1/CA2)
handshake to set the /RDY line to signal that it's ok to send again.
Shift out could be done with the VIA SR, though.)

You could make that half-duplex - e.g. if you only have a single SR as
the C64's CIA on the userport - by being in receive mode normally, and
block sending just before you want to send. And let a higher level 
protocol take care of who sends when.

Depending on whether you make clock/data single- or bidirectional 
the CIA would need additional hardware (single-directional needs
Tri-state drivers). 
And depending on whether you make the RDY line open collector (slow) or 
totem-pole (faster) you can put multiple devices on the bus (O.C.) or
not.

There are so many options, and all this was a mind-game when we discussed
a serial line protocol on the 6502.org forum:
http://forum.6502.org/viewtopic.php?t=1064

I don't know if this list accepts attachments, I'll send a simple circuit
schematics for the connection between a VIA and a CIA in the next mail.

André






-------- Original-Nachricht --------
Datum: Fri, 29 Jun 2007 20:03:19 +0200
Von: Wolfgang Moser <womo@news.trikaliotis.net>
An: cbm-hackers@ling.gu.se
Betreff: Re: MMC/SD-Cards

> Hi André,
> 
> André Fachat schrieb:
> > in case you are interested, I created an MMC-Card interface
> > (compatible with SD-Cards) for the 6502.
> > 
> > http://www.6502.org/users/andre/csa/spi/index.html
> > 
> > It's so simple it's almost not worth putting it on the web, but there
> > is a low level driver that can read and write MMC cards.
> 
> This is bitbanging the SPI bus, isn't it? When I read the first
> sentence I thought: "Cool, André is demonstrating the fast serial
> shift register of the CIA or even better the shift register of
> the VIA with an Phi2-fix in place".
> 
> 
> Womo
> 
>        Message was sent through the cbm-hackers mailing list

-- 
GMX FreeMail: 1 GB Postfach, 5 E-Mail-Adressen, 10 Free SMS.
Alle Infos und kostenlose Anmeldung: http://www.gmx.net/de/go/freemail

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.