• Please review our updated Terms and Rules here

Apple ][ SD card mass storage device

profdc9

Member
Joined
Jan 7, 2014
Messages
20
Hello, I designed a easy to build Apple ][ SD card mass storage device. It uses only five commonly available through-hole integrated circuits. It supports two SD card slots. It includes all of the ROM firmware and gerbers.

You can find it at the github


An image of the card is below.

I hope you enjoy it.

Dan

Apple2Card.png
 
Awesome, I'm going to check this out. Nice to see something that's actually in the spirit of the original Apple - something that we can build ourselves.
 
Question, on the 28c256, are you writing any settings to it? or are changes written to the atmel?

I've got a ton of 27c512 eproms, and wasn't able to source the 28c256 at a decent price.
 
So what are the uses for a device? Will it emulator smart port storage? Floppy disk images? Do you have a demonstration video?
Thanks!
 
Got my cards in today.. ENIG plated, and waiting on the parts now... but he's changed the bom a little. (10k vs 4.7k for some resistors the last time I checked)
 
Running into a issue building the card, and subbing in a different eprom..

I'm not getting the startup prompt from the eprom, so can an apple expert tell me how to verify that the prom is present where it should be using the built in monitor on a original //e?

I think I just need to play with the start address, but I need to see what it's reading from the card..


Nevermind, figured out the monitor, eprom is reading fine.
 
Last edited:
Ok, after finally figuring out fuses for programming an atmega328p in a TL866plus, and getting my head around how the drive images are set and accessed, I have a working mass storage drive on my //e.

Card is pretty easy to build, the parts list is currently incorrect (some resistors have changed value, and the BOM had me buy oversized resistors that were a little bit long, so hard to install)
but overall a great first release.

If other people want to make this, I bought extra boards and parts, $20 + shipping for a kit that's missing the atmega328p. (I got mine off my very first arduino clone, It was rs232 not usb and has a 2008 stamp on it.)

$ 30.00 for the kit if you want me to go ahead and solder in the microsd slots. (I've got the microscope to inspect the joints..)

There are Arduino Uno's on ebay for around $11.00 that have a socketed atmega328p on them available in the USA.
 
Ok, Total Recall isn't booting on the card yet, but they have made a suggestion over on their github today that I'll try this evening.

Anybody here want to school me a little on 6502 assembly??

I'm looking at the following firmware code.

getcard1key:
lda $c000
bpl getcard1key
sta $c010
cmp #'!'+128
bne notex1
sta $750+20
lda #$ff
bne storevol1
notex1:
cmp #'0'+128
bcc getcard1key
cmp #'9'+128+1
bcs getcard1key
sta $750+20
and #$0f
storevol1:
sta blklo

ldy #<card2msg
writecard2msg:
lda (buflo),y
beq getcard2key
sta $7D0-<card2msg,y
iny
bne writecard2msg
insidejump:
beq jumpbank2 ; should never fall through here from previous instruction

getcard2key:
lda $c000
bpl getcard2key
sta $c010
cmp #'0'+128
bcc getcard2key
cmp #'9'+128+1
bcs getcard2key
sta $7D0+20
and #$0f
sta blkhi

lda #4 ; set command=4
sta command

ldy #$ff ; lets send the command bytes directly to the Arduino
lda #$ac ; send this byte first as a magic byte
bne pcomsend


I see where it's polling the keyboard (lda $c000) and then storing the value of $c010 in a when one is detected.. But my question is, how does the cmp command work?

I'm not understanding the +128 or the +128+1...

I'd like to change the ! to R (Hex 52) and the 0 to B (Hex 42).
 
I'm not understanding the +128 or the +128+1...

I'd like to change the ! to R (Hex 52) and the 0 to B (Hex 42).

The apple II keyboard returns a 7bit data value (plain ASCII). The top most bit ist set, when a new key is pressed. The bit is cleared by accessing $C010 (that's why the "sta $c010" is there). This indicates that the keypress event was already handled.

The code above compares the original register value - including the top most bit indicating a fresh keypress. That's why the "+128" thing is there.
The "cmp" command just compares the A register to the value given after the "#" - and remembers the result in status flags. The following "BNE" checks the status flags (comparison result).

So you can just replace "cmp #'!'+128" with "cmp #"R"+128" or "cmp #$52+128" or "cmp #$d2". Whatever you prefer.

The comparison with the '0' and '9' keys involves a ">= " and "<" comparison (to check if the keypress is between 0 and 9). If you want to change that, you need to change a bit more: You'd need to change both keys first (like use 'B'..'K' instead of '0'..'9'). But then you will also need to insert a subtraction of 18 (to map "B" back to '0') - i.e. "clc" (clear carry) and "sbc #$12" (subtract with carry). It's possible. But changing the 0..9 keys seems to result in a rather inconvenient keyboard mapping... :)
getcard1key:
lda $c000
bpl getcard1key
sta $c010
cmp #'R'+128
bne notex1
sta $750+20
lda #$ff
bne storevol1
notex1:
cmp #'B'+128
bcc getcard1key
cmp #'K'+128+1
bcs getcard1key
clc
sbc #$12

sta $750+20
and #$0f
storevol1:
sta blklo
ldy #<card2msg
writecard2msg:
lda (buflo),y
beq getcard2key
sta $7D0-<card2msg,y
iny
bne writecard2msg
insidejump:
beq jumpbank2 ; should never fall through here from previous instruction

getcard2key:
lda $c000
bpl getcard2key
sta $c010
cmp #'B'+128
bcc getcard2key
cmp #'9'+128+1
bcs getcard2key
clc
sbc #$12

sta $7D0+20
and #$0f
sta blkhi
lda #4 ; set command=4
sta command
ldy #$ff ; lets send the command bytes directly to the Arduino
lda #$ac ; send this byte first as a magic byte
bne pcomsend
 
Last edited:
There are Arduino Uno's on ebay for around $11.00 that have a socketed atmega328p on them available in the USA.

A couple years ago I was buying 328ps with pre-flashed Arduino bootloaders on them off an Amazon listing that was $12.99 for four, which wasn't a *great* price but it was convenient with Prime. This chip shortage bites.
 
A couple years ago I was buying 328ps with pre-flashed Arduino bootloaders on them off an Amazon listing that was $12.99 for four, which wasn't a *great* price but it was convenient with Prime. This chip shortage bites.

Well, my favourite supplier still has the 328p chip (not the Arduino module) on offer for about $3.50...
However: "in stock: 0. Expected delivery date: January 2023". There is the catch. :)
 
The OP (profdc9) has fixed the Total Recall booting issue, and the card is working fine for me.

Currently works great on my //e with having one drive (sd card formatted fat, able to change between 9 images at boot time.).
If you want a second drive available currently, you can either have raw mode for the first sd card, or have one sdcard in fat mode and the other in block mode.

I'm quite happy with it, and profdc9 has been very responsive on github.

Thumbs up from me, and besides the actual microsd slots, it looks nice and retro..

Screenshot 2022-07-27 204407.jpg
 
Back
Top