SDROM, Atom DOS for a SD-card

27 views
Skip to first unread message

KC

unread,
Oct 6, 2009, 4:32:39 AM10/6/09
to BeeBeeEmEmSee
At last ..... all parts for the SD-card interface did arrive. The
software for the ROM is almost written, it works for 95% and my next
step is to build and test the hardware so that I can write the low-
level hardware routines for loading and saving sectors. I have
uploaded a schematic of my interface, have a look at the files section
under

http://bbmmc.googlegroups.com/web/SDROM+interface.JPG

After installing the components, my first goal was to get it working
with Charlie's AtoMMC ROM v3 to make sure that the interface is
working ok. It failed ........ I can't get it working so I checked the
connections and voltages of the signals. I measured only 2,3V on the
CLK, MOSI and SS signals to the SD-card. I think it is a little low so
I have to boost these signals to 3,3V. There seems to be a lot of
power lost due to cable length and that is why the VIA ports only
measure 3,6V instead of 5V. I have a flatcable from PL6/7 to a 19"
rack where all my Atom expansion boards are installed.So I think I
will install dual converters to boost the signals up to 5V.

After testing I will add my findings.



Charlie Robson

unread,
Oct 6, 2009, 4:46:05 AM10/6/09
to bb...@googlegroups.com
Yaaay!

This is great news, thanks for the update. I can't wait to try out your ROM!

Is A32 ground? When I was experimenting I thought it wasn't.. I use B32. Hmm
- I'll get the multimeter out again I think :)

I contacted your friend with regard to the issue 5 board and he gave me a
price which I thought was good. He seemed a little unsure about wanting to
sell it though, so I said he should consider carefully. I haven't heard back
since, so I take this to mean he changed his mind. That's ok, I would hate
for anyone to regret parting with a treasured item!


C

KC

unread,
Oct 7, 2009, 3:49:37 AM10/7/09
to BeeBeeEmEmSee
Charlie,

I had a look at some other schematics of SD-card interfaces and I
saw that pin 6 of the SD-card is connected to GND. In your schematic
it is not connected?
Is this maybe the problem with my interface? I will connect pin 6 to
GND and test it again this evening.

Greetings
KC

Charlie Robson

unread,
Oct 7, 2009, 4:10:12 AM10/7/09
to bb...@googlegroups.com
Pin 6 is N/C. I only ever ground it if convenient. You really shouldn't have
a problem with that.

What problems are you seeing?

C

-----Original Message-----
From: bb...@googlegroups.com [mailto:bb...@googlegroups.com] On Behalf Of KC

KC

unread,
Oct 7, 2009, 4:36:42 AM10/7/09
to BeeBeeEmEmSee
When I type the MOUNT command, I get stuck at the detectinterface
routine. The response is an INTERFACE? error.
I also tried to link the detectinterface routine with the same result.
The interface is not detected, IFTYPE if set to 0.
Yesterday I installed a 74LS244 for the VIA signals but it didn't work
as I thought it would work. I thought that if the input is >2V the
output would be 5V signals but the output was only 3,75V?
After the resistors it leaves 2,42V, not a success!
I do not have a scope to check the signals, maybe I can borrow one
from a friend.

KC

af...@aurigae.demon.co.uk

unread,
Oct 7, 2009, 5:16:02 AM10/7/09
to bb...@googlegroups.com
Quoting KC <oss...@zonnet.nl>:

>
> When I type the MOUNT command, I get stuck at the detectinterface
> routine. The response is an INTERFACE? error.
> I also tried to link the detectinterface routine with the same result.
> The interface is not detected, IFTYPE if set to 0.
> Yesterday I installed a 74LS244 for the VIA signals but it didn't work
> as I thought it would work. I thought that if the input is >2V the
> output would be 5V signals but the output was only 3,75V?

If you have a 74HC244, try that, I have had problems before with LS
and <5V levels.

> After the resistors it leaves 2,42V, not a success!
> I do not have a scope to check the signals, maybe I can borrow one
> from a friend.

How long are you lines between the VIA and the resistors ?

Cheers.

Phill.

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

KC

unread,
Oct 7, 2009, 5:30:44 AM10/7/09
to BeeBeeEmEmSee
Hi Phill,

the lines are about 20cm. Have a look at http://members.tele2.nl/oss003/atom.htm
the photo just above the header 'Moederbord', where you can see the
'interior' of my Atom.
The alu box in the left top corner is the 19" rack with the Atom
expansion boards.

Do you know the minimum voltage for the signals? I can not find it
anywhere in the specs.

Is there a difference between MMC and SD card for the connection of
pin 6? In most of the Sd-card interfaces, pin 6 is connected to GND.

KC

Charlie Robson

unread,
Oct 7, 2009, 5:50:51 AM10/7/09
to bb...@googlegroups.com
>Do you know the minimum voltage for the signals? I can not find it
>anywhere in the specs.

MMC supply is 2.7 to 3.6, the signals need to be within a small percentage
of this.

I made an interface featuring a 4050 level converter for one atom which had
a 'weak' VIA. You're still not guaranteed a solid VCC out though.

If your VIA lines are at a level of 3.75v you could just about get away with
feeding that directly to the card, bypassing the resistors.

You definitely need a logic probe for debugging SPI communication failures.
Do you have access to one? 4 channels is the minimum...

>Is there a difference between MMC and SD card for the connection of
>pin 6? In most of the Sd-card interfaces, pin 6 is connected to GND.

Most pinouts show it as N/C in SPI mode.

Sorry to say SPI is hard to get working, but it is possible. I'll help all I
can. Are you bothered about keeping the parts you use contemporary to the
atom? Or would you consider using a PIC to handle the SPI for you??

C

af...@aurigae.demon.co.uk

unread,
Oct 7, 2009, 6:16:28 AM10/7/09
to bb...@googlegroups.com
Quoting Charlie Robson <charlie...@hotmail.com>:
> Sorry to say SPI is hard to get working, but it is possible.

Didn't really find this myself, perhaps I just got lucky :) Mind I do
hear people on AVR freaks complaining about non-working cheapo
programming hardware which uses a bunch of resistors on the paralell
port not working, as this also uses SPI to program the AVR.

> I'll help all I
> can. Are you bothered about keeping the parts you use contemporary to the
> atom? Or would you consider using a PIC to handle the SPI for you??

Well, in some ways PIC could be considdered contempory, as they've
been around for longer than you think, I have a Tandy CoCo speach
sound pack from 1983/4 that uses an early PIC, as did the numeric
keypad for the Spectrum 128......

KC

unread,
Oct 7, 2009, 6:19:35 AM10/7/09
to BeeBeeEmEmSee
> MMC supply is 2.7 to 3.6, the signals need to be within a small percentage
> of this.

I was thinking about using the VIA signals to switch on 3,3V with
transistors but I do not know if delay in timing will be a problem.

> You definitely need a logic probe for debugging SPI communication failures.
> Do you have access to one? 4 channels is the minimum...

I will ask a friend

> Sorry to say SPI is hard to get working, but it is possible. I'll help all I
> can. Are you bothered about keeping the parts you use contemporary to the
> atom?

I must get it working because my disc interface is not reliable at
1,79 mHz any more!!!
The easy way is to use the VIA so that is why I will try this in the
first place. Also to see if the speed is acceptable in 1.79 mHz mode.
When everything is working fine, I will reserve 2 addresses somewhere
at #BFxx for controlling the SD-card because then I can use my VIA
again for new projects.
At the moment I have a communication cable connected to the VIA to use
file sharing between the Atom and a PC.
Also my I2C interface is using the VIA.

> Or would you consider using a PIC to handle the SPI for you??

Using a PIC is my second choice but I want to try the VIA option
first.

KC

af...@aurigae.demon.co.uk

unread,
Oct 7, 2009, 6:40:14 AM10/7/09
to bb...@googlegroups.com
Quoting KC <oss...@zonnet.nl>:

> I must get it working because my disc interface is not reliable at
> 1,79 mHz any more!!!
> The easy way is to use the VIA so that is why I will try this in the
> first place. Also to see if the speed is acceptable in 1.79 mHz mode.
> When everything is working fine, I will reserve 2 addresses somewhere
> at #BFxx for controlling the SD-card because then I can use my VIA
> again for new projects.

Well if it helps.... I had the VIA driven method working fine at 1MHz,
2MHz and 4MHz on the AtomClone, though to be fair it was all mounted
on the same cuircit board.

KC

unread,
Oct 8, 2009, 2:48:08 AM10/8/09
to BeeBeeEmEmSee
Phil,

I have a question to you as 'the hardware guru': how about limiting
the voltage of the VIA signals to 3,3V with a zener diode?
So replace the 3k3 resistor with a 1N5333 zener diode for PB5,6,7 in
the schematic http://bbmmc.googlegroups.com/web/SDROM+interface.JPG.

Does that work?

KC

KC

unread,
Oct 8, 2009, 6:02:58 AM10/8/09
to BeeBeeEmEmSee
Does any of you guys know how to contact Martin Mather? There is no
contact information on his MMBEEB site.
I want to ask him if it is ok to use the same commands in my SDROM as
he uses in the MMBEEB ROM.

KC

Charlie Robson

unread,
Oct 8, 2009, 6:19:29 AM10/8/09
to bb...@googlegroups.com
I've spoken to Martin in the past and he has left this project behind. He's
happy for people to do whatever they want with it - I really can't see the
problem with you using the same commands - imitation is after all the
sincerest form of flattery :)

But if you insist - mmb...@yahoo.co.uk

-C


-----Original Message-----
From: bb...@googlegroups.com [mailto:bb...@googlegroups.com] On Behalf Of KC
Sent: 08 October 2009 11:03
To: BeeBeeEmEmSee
Subject: Re: SDROM, Atom DOS for a SD-card


af...@aurigae.demon.co.uk

unread,
Oct 8, 2009, 7:27:51 AM10/8/09
to bb...@googlegroups.com
Quoting KC <oss...@zonnet.nl>:

>
> Phil,
>
> I have a question to you as 'the hardware guru': how about limiting
> the voltage of the VIA signals to 3,3V with a zener diode?
> So replace the 3k3 resistor with a 1N5333 zener diode for PB5,6,7 in
> the schematic http://bbmmc.googlegroups.com/web/SDROM+interface.JPG.

I've not done this with any of the SD interfaces, but I do remember
doing something similar with USB signals (which are also 3.3V) when
interfacing to a %V AVR microcontroler, so my gut feeling is that it
should work.

You might want to put the Zenners or resistors close to the MMC/SD as
this means for the majority of the signal run you will have 5V.

KC

unread,
Oct 12, 2009, 4:10:09 AM10/12/09
to BeeBeeEmEmSee
I did spent some time testing my SD-card interface ...... but without
any luck. The signals are ok now but I do not get any response from
the card.
Next wednesday I can borrow a scope from my friend for checking the
signals. It is only a 2 signal scope but it is ok to see if the SD-
card is responding and to see if the Atom signals are ok.
I will also check the interface with another SD- or MMC-card because I
don''t have any specs of the card I am using. It came with an old
digital photocamera.

KC

Charlie Robson

unread,
Oct 12, 2009, 6:00:30 AM10/12/09
to bb...@googlegroups.com
I have found that there is a great deal of variability in the requirements
for mmc and sd cards.

Some have very tight voltage requirements, some will work at 5v without
giving out magic smoke.
Some demand precise initialisation while others work without any.

I have about 10 or so different cards. At one point I could only use 2 of
these with my interface. I tweaked the startup negotiation and managed to
get 8 working. 1 of the remainder was actually dead, but the other just
refuses to work. It'll work with Arduino, but I think the voltage level
tolerance is too tight for the Atom.

When I built the PL8 version I had to rework the layout of the board to put
the resistors next to the socket otherwise I was seeing bizarre timing
errors probably related to reflections.

I hope you'll have success with the scope - is it a storage scope? If you
like I can provide you with some logic analyser output to compare against.
Should I give your firmware a try or are you using mine to begin with??

C




-----Original Message-----
From: bb...@googlegroups.com [mailto:bb...@googlegroups.com] On Behalf Of KC
Sent: 12 October 2009 09:10
To: BeeBeeEmEmSee
Subject: Re: SDROM, Atom DOS for a SD-card


KC

unread,
Oct 12, 2009, 7:10:53 AM10/12/09
to BeeBeeEmEmSee
It is not a storage scope but it will be nice to have some analyser
output to compare with. I can also look at some photo's at the Arduino
site.
I will start with you firmware from AtoMMC v.3. I have your
assembler .lst file to see where your routines are to use them. My
firmware doesn't have any interface routines yet because I want to use
your routines for hardware interfacing to be compatible.

KC

On Oct 12, 12:00 pm, "Charlie Robson" <charlie_rob...@hotmail.com>
wrote:
> KC- Hide quoted text -
>
> - Show quoted text -

Charlie Robson

unread,
Oct 13, 2009, 9:41:56 AM10/13/09
to bb...@googlegroups.com
I've just uploaded a logic analyser session to the files area:
atommc.logicsession

It can be investigated by downloading the software for my analyser. It's a
Windows/.net app, sorry. There is a Linux version of the software but it's
less than alpha right now.

http://www.saleae.com/downloads/logic/Logic%20Setup%20Beta.exe

It's fairly easy to drive. Grab & drag to scroll. You can drill down into
the data and look at timings/values - left click to drill, right click to
back out. The Options menu gives the ability to turn the protocol analysis
on and off (options->analyser 1->spi/off) which you might choose to do if
the numbers get in the way :) The analysis only shows above a certain zoom.

C

KC

unread,
Oct 16, 2009, 2:37:27 AM10/16/09
to BeeBeeEmEmSee
Last wednesday I borrowed a oscilloscope from my friend. He also had
some SD-cards which I could have for testing them with my interface.
Yesterday I found some time for testing and the first step was to try
the SD-cards. The second one didn't give an error on the MOUNT command
so that looked good. The CAT command listed nicely all the files on
the card.
Also mounting and loading did work. So IT IS ALIVE!!! Your AtoMMC ROM
v3 worked nicely, my complements! Also switching to 1,79 mHz did not
show any problems.
Now I can go on to step 2, test reading/writing sectors with a length
of 256 bytes. If that doesn't work then I will write my routines for
sectors with a length of 512 bytes.

KC

Charlie Robson

unread,
Oct 16, 2009, 5:35:02 AM10/16/09
to bb...@googlegroups.com
JOY!

I'm very pleased for you :)

-----Original Message-----
From: bb...@googlegroups.com [mailto:bb...@googlegroups.com] On Behalf Of KC
Sent: 16 October 2009 07:37
To: BeeBeeEmEmSee
Subject: Re: SDROM, Atom DOS for a SD-card


KC

unread,
Oct 26, 2009, 12:54:17 PM10/26/09
to BeeBeeEmEmSee
Hi guys,

it took a while before I could test the SD-hardware routines due to
a burnout. Not from me but from one capacitor on the interface card.
During testing I smelled something nasty and there came some smoke out
of the back of my Atom! I can not explain why it burned down because I
build it from the schematic in the datasheet and it says 2 tantal
capacitors of 10 uF on the in- and output pin to ground??
My Atom survived the burnout and now I can go on testing my routines.

Greetings
KC

Charlie Robson

unread,
Oct 27, 2009, 4:37:23 AM10/27/09
to bb...@googlegroups.com
> During testing I smelled something nasty and there came some smoke out
> of the back of my Atom! I can not explain why it burned down because I

AIEEE!!

> My Atom survived the burnout and now I can go on testing my routines.

Phew ;¬)

The smoke is a trick I usually associate with BBC micros :)

Reply all
Reply to author
Forward
0 new messages