The Dan ][ SD card disk controller

26 posts / 0 new
Last post
Offline
Last seen: 16 hours 46 min ago
Joined: Jun 12 2022 - 23:35
Posts: 19
The Dan ][ SD card disk controller

Hello,

 

I have designed and built a Apple ][ card that can interface two SD cards as ProDOS block devices.  It uses very commonly available chips, and is based on the ATMEGA328P microcontroller and 82C55 peripheral interface.  It uses simple readily available parts to be easy to reproduce, now and into the future.   It can host ProDOS order block devices from either raw block device SD cards or from FAT filesystem formatted SD cards.  I also have planned interfacing the card to a Wiznet 5500 for Ethernet support.

 

You can find the github site with the gerbers and firmware at:

 

http://www.github.com/profdc9/Apple2Card

 

You can also find many other projects I've done on my github as well.

 

Dan

 

 

 

 

 

 

 

 

MacFly's picture
Online
Last seen: 34 min 55 sec ago
Joined: Nov 7 2019 - 13:49
Posts: 174
Looks great

That looks really great. Very clean! Simple throughhole design with standard components. Neat. I also thought about an ATMEGA-based interface card for a while - using latches or shift-registers for the ATMEGA/AppleII interface. But using the 8255 looks really good - reduces the number of used components. A simple solution connecting an ATMEGA to the Apple II bus could also be used for many other purposes...

 

Concerning the flash/EEPROM: how about adding a pull-up and jumper, so the EEPROM's /WE can be jumpered to 6502 R/W. This would eliminate the need for a TL866 programmer - when using the 28C256 EEPROM. A dedicated bootstrapper/programmer utility for the Apple II could then write the ROM image to the EEPROM. This would also simplify updates a lot.

Online
Last seen: 24 min 30 sec ago
Joined: Apr 17 2022 - 12:26
Posts: 47
I can't thank you enough for

I can't thank you enough for sharing this

do you expect quick revisions (of the board) or did you like run this setpu for 6 months on your own ?

 

I'm planning to make one for me, this looks really cool and I like doing things myself (instead of ordering a booti)

 

Two things that I think would be helpful,

- A parts list (especially to chose the right sd slots)

- A photo of a finished project (for inspiration)

 

super thanks Dan 

Offline
Last seen: 16 hours 46 min ago
Joined: Jun 12 2022 - 23:35
Posts: 19
I just completed this, but it

I just completed this, but it seems to work for booting ProDOS and playing games, reading/writing files etc.  The current board is a bodged version but this version has all of the bodges in it.  Of course there could still be problems but it is a simple design and probably not much can go wrong with it.

 

I can provide a parts list but the SD card slot in particular is the most common microSD card slot you can buy.  On lcsc there are 5 companies that sell the same format SD card slot.  For example:

 

https://www.amazon.com/QMseller-Spring-Loaded-Transflash-Memory/dp/B07WMSNMLN/

 

I added a pullup resistor and jumper to the RW bus line, so in principle it should be programmable in circuit.  I submitted the change to the github.

 

Dan

 

 

 

 

 

 

 

 

Offline
Last seen: 16 hours 46 min ago
Joined: Jun 12 2022 - 23:35
Posts: 19
I added control lines for the

I added control lines for the other 28C256 pins so that the write unlock signal can be sent.

 

 

MacFly's picture
Online
Last seen: 34 min 55 sec ago
Joined: Nov 7 2019 - 13:49
Posts: 174
Yes, not a bad idea to allow

Yes, not a bad idea to allow full control in switching the ROM area anyway. Also means completely different ROM images can be mapped into the boot ROM, so the card can switch its behaviour. One could add a boot menu, providing an option to select the ROM image, so the card could look like a serial interface instead, etc.

A flexible Arduino/ATMEGA platform as an Apple II card does have a lot of other potentials - besides the disk emulation. I'm probably going to make one of these. But it'll take a few weeks before I get to that...

Another idea/optimization: how about leaving the program jumper in there, but disconnecting U3D pin 13, adding a pull-down and connecting it to PIO's PC3. Write-access to the EEPROM is then normally blocked/ignored as it should, but now you have full SW-control to enable write-access via the PIO. The program jumper could remain always plugged (or eventually be replaced by a solder bridge). No need to open the Apple 2 if you wanted to update/change the ROM images...

Also, if the ATMEGA had any available I/O pins (looks like PC4/5 are available?) you could think about hooking one pin up to the Apple2 IRQ. This would allow the platform to be used for projects which wanted an IRQ...

Online
Last seen: 24 min 30 sec ago
Joined: Apr 17 2022 - 12:26
Posts: 47
Given the price of serial

Given the price of serial cards ; if this could in a way be used as a serial card that would be great as well . 

Offline
Last seen: 2 hours 7 min ago
Joined: Aug 5 2020 - 11:56
Posts: 91
How about a bill of materials

How about a bill of materials and  photo of a completed board we can compare?

 

Makes it easier to build.

 

Thanks!

 

Bill

Offline
Last seen: 16 hours 46 min ago
Joined: Jun 12 2022 - 23:35
Posts: 19
PC3 is unfortunately used by

PC3 is unfortunately used by mode 2 of the 82C55 and so is unavailable.  I could use a line like PB4 on the 82C55.  The 28C256 has a special sequence of write instructions needed to address it anyways, so writing to the ROM accidentally is very unlikely to happen, especially as the address lines to the 28C256 need to be manually toggled by the processor through the 82C55.  The jumpers are there mainly so that when programming the 28C256 is not needed, the jumpers can be removed and the PB0-PB7 and PC1 and PC2 pins can be used for other purposes by the Apple ][ (for example a parallel IO interface).

 

As for the IRQ, I kind of want to stick a pin in this version of it, as it already does quite a bit, and I might have to add interrupt priority circuitry if I enable IRQs.

 

PC4/PC5 can be used as serial lines using SoftSerial.  I originally tried to add circuitry so that the built in UART could do double-duty on the 82C55 and as serial, but it was too much of a compromise and kind of flaky.

 

The nice thing about the 82C55 mode 2 is that it a synchronous interface and therefore is tolerant to interruptions on the AVR side, so that some serial communications could be possible, for example, PC4/PC5 to a ESP8266 using SoftSerial, which is why I broke out those pins onto a separate 10 pin connector so that they could be extended to a separate breadboard.

 

Dan

 

 

 

 

Offline
Last seen: 3 days 3 hours ago
Joined: Apr 26 2016 - 08:36
Posts: 356
Sorry if I missed this but is

Sorry if I missed this but is your project meant to be a Prodos Block mode hard drive emulator, or is it meant to handle .dsk / .po disk images?

 

 

Offline
Last seen: 16 hours 46 min ago
Joined: Jun 12 2022 - 23:35
Posts: 19
It has two modes.  The first

It has two modes.  The first is that the SD card can be used directly as a block device for ProDOS.  This allows many 32 MB volumes to be handled by the driver, so that for example, S7D1 could be one 32 MB volume, s5D1 could be another 32 MB volume, s5D2 could be another 32 MB volume, etc.  The FAT filesystem mode provides access to one 32 MB volume at a given time in the form of a PO disk image, so that for example, s7D2 can be the "BLKDEV01.PO" file, which can be read/written by CiderPress for example, so you can use this to transfer files back and forth from the Apple II more easily.  There are two SD card slots, and usually S7D1 is served from one slot and S7D2 from the other, so that the boot volume can be left unchanged and the other card swapped while the computer is running.  There is a simple interface during boot up that allows the type of volume to be selected.

Online
Last seen: 5 min 21 sec ago
Joined: Jul 5 2018 - 09:44
Posts: 951
CedsRepairs wrote:Given the
CedsRepairs wrote:

Given the price of serial cards ; if this could in a way be used as a serial card that would be great as well . 

Price of serial cards?  You can buy Super Serial Cards for under $100 easy...  that's cheaper than when they were new...  Lesser cards like 6850 based can usually be found under $50 if you don't need to run very fast.

 

Offline
Last seen: 3 days 3 hours ago
Joined: Apr 26 2016 - 08:36
Posts: 356
I've read through your Github

I've read through your Github page with great interest.

Maybe I should have done so before asking questions, but I do have more questions as a result.

I'm encouraged with your board design.  It looks really quite nice and I'd like to try it.

 

A Bill of Materials would be very helpful, especially if you have cart data from a popular vendor like Mouser, Newark, or Digikey.

 

Also, I'm perfectly willing to get cards made, build one and test it and sell the remainder of the cards back to the community - I've done this with projects before, but if someone (perhaps youself) has purchased a number fo boards from PCBWay or another manufacturer, would you make bare PCBs available to the community?

 

 

Offline
Last seen: 16 hours 46 min ago
Joined: Jun 12 2022 - 23:35
Posts: 19
I've made a Bill of Materials

Package iconLCSC_Exported_20220615_222017.zip

 

I've made a Bill of Materials.

 

I buy my stuff from lcsc.com because it is much cheaper.  The shipping is not bad if you use international mail post.  Some of the items you may have to obtain from sources other than lcsc because they are on backorder, or if you do not want to use Chinese clone alternatives (for example the 28C256 or the 82C55).   I use some of the Chinese alternatives because of the ongoing chip shortage.  The attached ZIP file contains a  "CSV" file that you can submit to lcsc.com as a Bill of Materials.

 

I have made PCBs with JLCPCB.  I don't mind making the PCBs available but the shipping can get a costly for a lot of boards.

Online
Last seen: 24 min 30 sec ago
Joined: Apr 17 2022 - 12:26
Posts: 47
If anyone is in continental

could you please share the list in a plain readable format ?

 

I've just ordered 5 boards from PCBWay (in continental europe) they afre "46% done" (whatever that means) I should get them in a month or so (snail mail).

Offline
Last seen: 16 hours 46 min ago
Joined: Jun 12 2022 - 23:35
Posts: 19
Here's a copy of the file as

Here's a copy of the file as a PDF

 

https://www.applefritter.com/files/2022/06/15/Bill-Of-Materials.pdf

 

The 20 nF capacitor should be a 20 pF capacitor.

 

 

 

 

Online
Last seen: 1 min 24 sec ago
Joined: Jun 29 2018 - 16:55
Posts: 48
I only used PCBWay once, I

I only used PCBWay once, I find JLCPCB's HASL finish was much smoother

Offline
Last seen: 2 hours 7 min ago
Joined: Aug 5 2020 - 11:56
Posts: 91
Thanks  for the bil of

Thanks  for the bil of materials. Can you please add component location to the PDF so we know where  the parts go on the board?

 

 

Offline
Last seen: 16 hours 46 min ago
Joined: Jun 12 2022 - 23:35
Posts: 19
Heres a list of parts and

Heres a list of parts and their part placement

 

https://www.applefritter.com/files/2022/06/16/Parts-Placement.pdf

 

 

Offline
Last seen: 16 hours 46 min ago
Joined: Jun 12 2022 - 23:35
Posts: 19
A quick note.  If you had the

A quick note.  If you had the Rev 1 card made (as opposed to the Rev 1.1 card I uploaded last night), solder the pins for J6 on the back side of the board.  The pins in the Rev 1 version are reflected if it is to be used with the following board: 

https://www.ebay.com/itm/284798824548

 

A 10 pin IDC extension cable can be used to go between the SD card and this board, however, the pins on the Rev 1 should be sticking out the back, and Rev 1.1 and onward they will be sticking out the front. 

 

Rev 1.1 also added optional access LEDs to show when the SD cards/network is being used.

CheshireNoir's picture
Offline
Last seen: 15 hours 35 min ago
Joined: Dec 28 2019 - 05:20
Posts: 146
Simply amazing!

Well done, Dan.

 

This is going into my "Will build when time and budget permits" pile right near the top.

 

Thank you so much for your generosity to the community.

 

Chesh

Offline
Last seen: 16 hours 46 min ago
Joined: Jun 12 2022 - 23:35
Posts: 19
Here's a picture of the

Here's a picture of the version 1 board without any bodges.

 

 

 

MacFly's picture
Online
Last seen: 34 min 55 sec ago
Joined: Nov 7 2019 - 13:49
Posts: 174
Looks really nice!

Do you foresee the EEPROM's larger 32K memory to become useful later? Just asking, since the 8K EEPROM (28C64) is significantly cheaper and pin compatible (well, except for 2 missing and unused address lines of course). Since the firmware uses the first 512bytes only anyway, and when you'd not forsee any need for more memory - you could add the smaller device as an option in the parts description.

Even a 27c64 EPROM should work without PCB modifications, if someone did not want the firmware update option.

Offline
Last seen: 16 hours 46 min ago
Joined: Jun 12 2022 - 23:35
Posts: 19
Yes, a 27C64 or 28C64 should

Yes, a 27C64 or 28C64 should work fine.  I have a bunch of 28C256 so that is what I use.  The upper address lines are connected to the 82C55 so that the EEPROM unlock sequence can be issued by the processor and so can be programmed, but otherwise don't need to be connected.  The only one that must be connected is JP2 which is needed to address 256 more bytes of ROM.  This may change in the future though.

Online
Last seen: 24 min 30 sec ago
Joined: Apr 17 2022 - 12:26
Posts: 47
I ordered 5 PCBs from China a

I ordered 5 PCBs from China a week ago ; and they should be here (in continental europe) in the coming days.

I'll post follow up message on my build.

 

Offline
Last seen: 16 hours 46 min ago
Joined: Jun 12 2022 - 23:35
Posts: 19
A flash utility is written. I

A flash utility is written.

 

I wrote a flash utility that can flash the firmware onto the 28C64/28C256 in the system without an external programmer.

It is called "FLASH.SYSTEM" and it can be run from PRODOS, but it does not use any PRODOS system calls (except to exit to operating system) so it should work without PRODOS if needed.

It is simple.  You short the jumpers that it says, press a key for the slot number, and it flashes.  After you are done, remove the jumpers except for JP2

 

Dan

 

 

 

 

 

 

Log in or register to post comments