6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Wed Oct 23, 2024 2:31 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: 6502 SD card
PostPosted: Sat Aug 27, 2016 7:22 pm 
Offline

Joined: Sat Aug 27, 2016 7:09 pm
Posts: 4
Hello,

Have some make a hard- and software part to connect the 6502 uP to a SD-Card?

Rg
Softboy1


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 SD card
PostPosted: Sun Aug 28, 2016 7:17 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10961
Location: England
I have an MMFS setup on my BBC micro, courtesy of Dave (hoglet) - it uses a parallel port (VIA) to communicate with a little commodity SD card interface board.

I think it's quite possible to bitbang the whole protocol but you'll probably need level shifting.

Here's an example on a PC - the principle is the same, of course how to drive the parallel port is different:
http://blog.vinu.co.in/2012/05/attempt- ... ed-at.html


Last edited by BigEd on Sun Aug 28, 2016 10:38 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 SD card
PostPosted: Sun Aug 28, 2016 10:30 am 
Offline
User avatar

Joined: Sun Oct 13, 2013 2:58 pm
Posts: 491
Location: Switzerland
You could as well implement a IDE interface and use one of the IDE to SD card or IDE to CF-Card Adapters. IDE can be implemented with a W65C22. CF-Card Adapters have the advantage that the CF-Card Adapter is only electrically passing the signals from the IDE to the CF-Card, that is there is no dealy. As CF-Cards (at least the 5V capable CF-Cards with only a few Gbytes of Memory) support a 8-bit IDE mode you only need a 8-bit data bus. In this case you only need to connect D0..7 and A0..A2 from the 6502 to the IDE port and add some glue logic to create /IORD, /IOWR and /CS0 (you don't need /CS1) and of course /RESET and you would not even need a interface device like the W65C22. I have connected CF-Cards directly to the CPU bus with CPU clocks up to 8MHz and it works.


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 SD card
PostPosted: Tue Sep 13, 2016 11:49 am 
Offline

Joined: Sun Dec 28, 2014 11:04 pm
Posts: 82
Location: Munich, Germany
Another example of hooking up an SD-Card to a 6502-based computer:
https://steckschwein.de/hardware/via-65 ... i-devices/

SPI is bit banged using a VIA, a 74ls07 is used for level shifting.


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 SD card
PostPosted: Tue Sep 13, 2016 10:01 pm 
Offline

Joined: Wed Nov 18, 2015 8:36 am
Posts: 102
Location: UK
My hobby / project is a 6502 homebrew machine with video (TMS9918), sound (AY-3-8910) and relevant for you an SD Card interface driving a hobbytronics SD card breakout board. This simple but compact board provides a slot for a micro SD card, and exposes the lines needed to drive the SPIO interface (CLK, DO, DI, CS, CD). The SPIO lines are connected to a 6522 and so all transfers are bit-banged in software. Not massively fast but still getting around 8.5k per second which is enough for my needs.

https://hackaday.io/project/5789-6502-homebrew-computer/log/26703-sd-card-interface

My main site includes the sd card driver code, but also the FAT16 routines which are much more complicated but allows a standard PC-DOS format to be used which can be helpful in portability.

Hope this helps.


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 SD card
PostPosted: Thu Sep 29, 2016 9:28 pm 
Offline

Joined: Tue Jul 05, 2005 7:08 pm
Posts: 1041
Location: near Heidelberg, Germany
I have done some SPI interfaces for the 6502.

1) an SPI interface card using a CPLD as bus->SPI interface, connecting an SD-Card, Ethernet and USB chips via SPI: http://www.6502.org/users/andre/csa/netusb/index.html using this CPLD: http://www.6502.org/users/andre/spi65b/index.html

2) An SPI-based USB-interface for the Commodore userport: http://www.6502.org/users/andre/cbmhw/cbmusb/index.html

3) An SD-Card interface using the VIA shift register (almost) only: http://www.6502.org/users/andre/csa/spi/index.html (yes it works :-)

General SPI info: http://www.6502.org/users/andre/hwinfo/spi/index.html

BTW: I would rather now build an USB interface for example to an USB memory stick. It's much more flexible than SD-Card nowadays...

_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 SD card
PostPosted: Fri Sep 30, 2016 6:08 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10961
Location: England
Kudos for the USB-capable PET! In the land of Acorn, there are both SD-Card and USB storage solutions using the VIA, but it seems to me that SD is winning. Of course, beyond storage, or for huge capacity, USB offers lots of other possibilities. (I note that your USB solution actually starts off as SPI - perhaps SPI is the great universal interface for the 8-bit micro. The Maxim MAX3420 and MAX3421 seem to be very handy. "The MAX3421E is a USB controller that can function either as a USB peripheral or host. It builds on Maxim's MAX3420E peripheral-only controller")


Top
 Profile  
Reply with quote  
 Post subject: Re: 6502 SD card
PostPosted: Tue Oct 04, 2016 12:21 pm 
Offline
User avatar

Joined: Sun Nov 27, 2011 12:03 pm
Posts: 229
Location: Amsterdam, Netherlands
One of my products for the BBC Micro incorporates an SD interface : http://www.zeridajh.org/hardware/gosdc/index.htm. It allows the 6502 to do simple byte reads/writes, the hardware in the CPLD does the serial <-> parallel conversions (based on its own clock). Well, it's an SPI interface, really, i.e. it also talks to MMC (that's how it started) and the serial flash ROM on GoSDC.

Doing it properly requires some careful design, but it's quite doable.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: