6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat May 11, 2024 6:34 pm

All times are UTC




Post new topic Reply to topic  [ 57 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Mon Sep 26, 2016 3:14 pm 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
I've tested a bunch of SD cards, and so far all of them work fine with SPI.

You do need to distinguish between MMC, SDv1, SDv2, and SDHC cards, though, and good documentation is hard to find.


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 26, 2016 3:51 pm 
Offline
User avatar

Joined: Mon May 25, 2015 2:25 pm
Posts: 632
Location: Gillies, Ontario, Canada
Thanks for the info.
It would be ironic that the only component in this project that may not have a stable future would be the SD card!
My FPGA code will be portable to any futire offering, and the 65C02 also seem to be immortal.
But I don't want to design around SPI and then find out it is extinct in 2-3 years.
Glad to year all of your tests worked. From what I read SPI is no longer required for the spec though.
Seems SPI SD is where NTSC Video and PS2 Keyboards were a few years back.... on the brink.
Analog VGA was supposed to be there as well, but it is still alive and kicking.

I will poke around on the AVR world and see if there are some robust SD examples I can learn from.

I did make one decision though, which is that the 6502 will handle the boot menu itself.
The FPGA will simply hold a 1-2k boot program, and stuff it into program memory on startup.
This makes the most sense for two reasons...

1) It will be easier to do (and with less resources) with a real processor than straight Verilog code.
2) It will much cooler to have the 6502 greet you on startup, and then take control of the boot process.

So if I do go the SD Card route, the 6502 will have to handle the hardware and FAT.
I will code it in such a way as once a stream is loaded, it will overwrite most of the menu code space.

As with all of my works in progress, this plan could change if I find a more suitable storage medium.
The single IC cartridge still has a lot of appeal.

Brad


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 26, 2016 6:49 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8433
Location: Southern California
If SPI SD cards' future is questionable, you can buy up a lifetime supply now while you know you can get them. They're cheap in the lower densities that are more likely to be appropriate with a 6502. I can't imagine needing a card that holds a dozen feature-length movies with a 6502.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 26, 2016 8:27 pm 
Offline
User avatar

Joined: Mon May 25, 2015 2:25 pm
Posts: 632
Location: Gillies, Ontario, Canada
Indeed, I have been know to stock pile everything!
Every IC drawer I have contains no less than 32 of the same part.

But Fusion-6502 is going to be a release, so I want to use components that have some life left.
I will probably run some boards as well.

Nothing worse than seeing a great DIY project on the web, only to find out later that to build it you will have to find some long obsolete part on ebay. In this project, the only single source component is the 65C02, but WDC has an unbeatable track record so far!

I will probably test my drawer of 20 or so misc. SD cards (some new, some old), and see how many work with SPI.
If I find that more than half are problematic, then I will move on to the SPI flash idea instead.

Brad

GARTHWILSON wrote:
If SPI SD cards' future is questionable, you can buy up a lifetime supply now while you know you can get them. They're cheap in the lower densities that are more likely to be appropriate with a 6502. I can't imagine needing a card that holds a dozen feature-length movies with a 6502.


Top
 Profile  
Reply with quote  
PostPosted: Mon Sep 26, 2016 9:39 pm 
Offline
User avatar

Joined: Mon May 25, 2015 2:25 pm
Posts: 632
Location: Gillies, Ontario, Canada
On my hour long commute through the timberline today, I thought of another option for connecting Fusion to the outside World.
This options may satisfy both my requirement for direct PC programming, and the feel of a cartridge for stand-alone operation...

...FTDI FT232.

I could put in an SPI flash cartridge, and then use the USB link to the PC to directly program it.
Compile a program in the 6502 assembler, then press a single button on my converter to upload.
If I end up with a final program or demo I like, then I would just pop in another cartridge.

This eliminates having to worry about SD SPI life-cycle, and allows any external memory device to be used.
By using even an 8 pin port, adapting to future storage devices would be a simple code change.

Hmmm.... I think I just convinced myself after all that typing out loud!

OK, sold!
No more talk, talk is cheap... off to develop some real hardware now.

Cheers,
Brad


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 27, 2016 5:55 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
I haven't tested the very latest SD cards for SPI, so maybe there is a problem I'm not aware of.

I was just going to suggest a SPI flash cartridge, when I saw your last message. LOL.


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 27, 2016 6:44 am 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1393
Another interesting chip from FTDI would be the FT4222, a USB2.0 to SPI bridge.

Unfortunately, from the datasheet the SPI related pins can take 4V max.,
so one would have to stick with 3.3V...
...or to use a 74LVC245 as a 5V\3.3V level translator in a 5V powered system.

http://www.ftdichip.com/Products/ICs/FT4222H.html

The bad thing about that chip is, that the USB descriptor and the hardware config
is defined in an OTP ROM inside the chip... :)
//FT4222 "is supposed to work" without burning the ROM.

;---

If there is a problem with SPI SD cards, maybe one could try to build a little PCB
with one or more little SPI FLASH ROMs like the Micochip SST26VF032B
(8 pins, 4MB, unfortunately not available in DIP package).

I think that 4MB already is a lot of memory for a single 6502 program.

;---

Quote:
Indeed, I have been know to stock pile everything!
Every IC drawer I have contains no less than 32 of the same part.

Same thing here when I was active.
At some point I had problems getting hands on TTL chips, that's why I had built that transistor CPU...


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 27, 2016 7:25 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8433
Location: Southern California
ttlworks wrote:
Another interesting chip from FTDI would be the FT4222, a USB2.0 to SPI bridge.

Unfortunately, from the datasheet the SPI related pins can take 4V max.,
so one would have to stick with 3.3V...
...or to use a 74LVC245 as a 5V\3.3V level translator in a 5V powered system.

It's nice that SPI's lines are all unidirectional, making voltage translation easy.

Quote:
If there is a problem with SPI SD cards, maybe one could try to build a little PCB
with one or more little SPI FLASH ROMs like the Micochip SST26VF032
(8 pins, 4MB, unfortunately not available in DIP package).

I think that 4MB already is a lot of memory for a single 6502 program.

Agreed, and I just got 33 tiny boards made for the 25VF032 4MB and 25VF064 8MB flashes. (I think 26VF has the same pinout too, but I'd have to check.) I've built one up and it works, but I didn't realize the 25VFxxx 8-pin IC is a little wider than a normal SO-8, so I had to bend the pins under, taking them from inverted gull wing shape to a J-lead shape to solder them.
Attachment:
OnSO-8pads1.jpg
OnSO-8pads1.jpg [ 71.55 KiB | Viewed 1121 times ]

40% of the board is just there as a handle, and to have something to write small labels on. After testing, I put epoxy over circuit (the green part of the board), except the pins of the 90° write-protect header. The whole thing, including the black socket, takes about half the area of an SD card, but is much more hobbyist-friendly, both in the connector and in the signals.

It works fine but manually J-leading the IC adds to the labor. I'll probably re-do the board so I can add it to the modules I offer. [Edit, later: Done. See the front page of my site.] I need to come up with a name for the hobbyist-friendly SPI connector devised for many different things, with power, a config line (which has other uses too), RST\, and IRQ\. [Edit, later: It's SPI-10.] (The flash module doesn't use all of these, but some other devices will.) It's ten pins but one is cut out and the hole in the socket is plugged, so you can't plug it in backwards or offset.

Other ones coming next will probably be a tiny I²C EEPROM module [Edit, 7/28/22: the I2C-6 EEPROM module is on the front page of my site now, and there's a link to the data sheet there], a tiny I²C RTC module (these two being I2C-6 modules), a 40-pin DIP 65802 module made with a PQFP '816 and logic in SOICs, and some sort of '816 module that pre-loads RAM with a bootloader from a microcontroller, and maybe Jeff's ultrafast I/O.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 27, 2016 9:23 am 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1393
Sorry, Garth...
There is an EOL notification from April 2015 at the Microchip homepage about SST25VF032B, SST25VF064C.
PDF from Microchip for migrating from SST25* to SST26*:
Attachment:
20005343A.pdf [110.7 KiB]
Downloaded 74 times

From the pinouts in the datasheets, it looks like 26VF032B might work with your PCB,
but I'm not sure about the compatibility of the innards of SST25* versus SST26*,
memory layout for instance is different.

GARTHWILSON wrote:
It's nice that SPI's lines are all unidirectional, making voltage translation easy.

That yes, but there also is SQI.
SQI is something similar to SPI, but with one SCK line and 2 or 4 bi_directional data lines...

BTW: 26VF032B and FT4222 support SPI and SQI.

Amazing, how fast a hardware design is getting obsolete nowaday after you got it up and running, isn't it ? ;)


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 27, 2016 2:13 pm 
Offline
User avatar

Joined: Mon May 25, 2015 2:25 pm
Posts: 632
Location: Gillies, Ontario, Canada
Thanks for the comments, always good to have all these ideas during the development stage.

I am cool with 3.3v, as my entire board is only 3.3v, including the 65C02.
In keeping with the specs, it is purring along nicely at 8MHz at 3.3v right now.

Thanks Garth, nice looking mini-boards! I wish I had one of those in front of me right now.
I dug around my parts boxes, and only found small SPI flash memories and not FT232 IC.
Odd... I was sure I had 8Mb flash and a few FTDI chips in there someplace!

No problem, it's time to give Digikey another $200 minimum order anyhow!

Right now I am designing a PC program to handle the bridge between old and new.
I am working up a simple binary file system that will allow the flash to hold program and data.

Here is my tentative goal at this point...

Custom file system that can give the FPGA handles on 64K programs and variable size data chunks.
File system built into the FPGA to allow the 6502 to retrive a list of Program File Names and Data File Names.
FPGA will stuff the 6502 with a menu system that will then read the SPI and display a load screen similar to the C64 Disk List.

The PC side software will simply take Bitmap and Wave data and turn them into a single large Data File with an index at the beginning.
Since my FPGA "core" has been coded as 32 bit, I could technically have a file as large as 4Gb if there was such a flash memory available.
As for the actual 6502 program, it will just be the Binary 64K Image File as saved directly from the Kowalski Assembler.

Using the Direct PC Link, my program will be able to transfer these assets directly to the Flash Cartridge.
After a transfer, the PC will signal a reset, so I can just develop directly on the PC without having to transfer any storage device.

This will allow for the rapid "try and see" type of coding I prefer...

1) Write 6502 code, assemble, and export the binary image.
2) Press "Upload" on my program and wait a few seconds.
3) See the results up on the Fusion-6502 monitor.
4) Fix what's broken, and go back to step 1!

So I guess what I am really doing is making an SPI Flash based high capacity 1541 Disk Drive!
Maybe it needs some audio simulation... Whirrrrrr, tick,tick,tick,tick, Brakkkka! Brakkkka! Brakkkka! tick, tick tick!

Thanks,
Brad


Top
 Profile  
Reply with quote  
PostPosted: Tue Sep 27, 2016 7:21 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8433
Location: Southern California
ttlworks wrote:
Sorry, Garth...
There is an EOL notification from April 2015 at the Microchip homepage about SST25VF032B, SST25VF064C.

Yes, and I was unhappy to see they were unavailable at the major distributors when I went to buy some last month. I was happy to find them on eBay, and I bought 15 to augment the few I already had. That should keep me pretty much for life. The 26VF is pin-compatible, and powers up in SPI mode. You have to issue an Enable Quad I/O command if you want the four-bit interface. The reason I didn't want the 26 is because there are small driver-software differences and I already had working software to run the 25. For someone who doesn't already have such a software investment, it may not matter, and the same board would work.

Quote:
GARTHWILSON wrote:
It's nice that SPI's lines are all unidirectional, making voltage translation easy.

That yes, but there also is SQI.
SQI is something similar to SPI, but with one SCK line and 2 or 4 bi_directional data lines...

Fortunately you don't have to use SQI mode if you don't want to.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 28, 2016 5:49 am 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1393
Quote:
So I guess what I am really doing is making an SPI Flash based high capacity 1541 Disk Drive!
Maybe it needs some audio simulation... Whirrrrrr, tick,tick,tick,tick, Brakkkka! Brakkkka! Brakkkka! tick, tick tick!

Hmm... and I already had expected to see something like 1530 Datassette implementation using 'magnetic wire recording' someday. ;)
https://en.wikipedia.org/wiki/Wire_recording


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 28, 2016 7:02 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8179
Location: Midwestern USA
ttlworks wrote:
Quote:
So I guess what I am really doing is making an SPI Flash based high capacity 1541 Disk Drive!
Maybe it needs some audio simulation... Whirrrrrr, tick,tick,tick,tick, Brakkkka! Brakkkka! Brakkkka! tick, tick tick!

Hmm... and I already had expected to see something like 1530 Datassette implementation using 'magnetic wire recording' someday. ;)
https://en.wikipedia.org/wiki/Wire_recording

I'm old enough to recall when wire recorders were still in use in office settings. They definitely weren't high fidelity! :D

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 28, 2016 8:15 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8433
Location: Southern California
Oneironaut wrote:
So I guess what I am really doing is making an SPI Flash based high capacity 1541 Disk Drive!

This might be of interest:
http://www.nkcelectronics.com/sd2iec-boar2.html
It's an SD-card-to-IEC adapter, to be able to use SD cards on the C64.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Wed Sep 28, 2016 5:03 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 575
GARTHWILSON wrote:
Oneironaut wrote:
So I guess what I am really doing is making an SPI Flash based high capacity 1541 Disk Drive!

This might be of interest:
http://www.nkcelectronics.com/sd2iec-boar2.html
It's an SD-card-to-IEC adapter, to be able to use SD cards on the C64.


That SD to IEC adapter from NKC has been out of stock for a long time. But you can purchase them on eBay as well as a few websites. In this thread viewtopic.php?f=4&t=3385 I talk about my purchase of an SD2IEC evo2. Here's a video of my current setup:

https://www.youtube.com/watch?v=3xhU65KX8rY


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 57 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 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: