Page 1 of 1
Can you Connect a Serial EEPROM to the 6522 VIA
Posted: Mon Oct 14, 2019 9:40 pm
by DerpymanMT
Hello again, I have checked Garth's Primer, And it is really good for what im doing, however It dosent say if I can connect my EEPROM with the 6522 VIA chip, (I know i should of used a parallel EEPROM, but I had to stay on Mouser due to other reasons -Ahem-) But I did also purchased a Serial to Parallel IC and was wondering do i still need to hook it up to the W65C02s' Address bus, or can I hook it up to the 6522?
I cant get anything else, until I get more money, or until christmas.
Thanks
-EAS
Re: Can you Connect a Serial EEPROM to the 6522 VIA
Posted: Mon Oct 14, 2019 9:59 pm
by GARTHWILSON
The 6502 primer discusses connecting them via a 6522, on the circuit potpourri page under "
Interfacing to I²C" and "
Interfacing to SPI and Microwire," with working sample source code linked there as well. The
I²C sample code includes code to run an I²C EEPROM. The
SPI sample code only gives generic SPI routines, since there are more SPI memory types and protocols and I can't address a substantial percentage of them. I could supply code for the ones I've used, although I probably used a lot of Forth programming language and not just assembly.
Note however that even if you could find or make a really fast parallel-to-SPI or parallel-to-I²C interface converter, these serial EEPROMs and flash memories are nowhere near fast enough (especially the I²C ones) to be used as the regular program or variable memory for a 6502. You must use parallel memory for that.
Re: Can you Connect a Serial EEPROM to the 6522 VIA
Posted: Mon Oct 14, 2019 10:26 pm
by DerpymanMT
Ok, so basically I have to just wire them to the primer's Specifications and ill be good, and of course, write to the EEPROM. Got it, Im not really Writing back to the EEPROM(Once I Connect it to the VIA) so there wouldnt be a need for the Parallel to Serial IC, Right???
Anyways thanks for replying so fast!
Edit: the EEPROM is I²C Compatable!
Re: Can you Connect a Serial EEPROM to the 6522 VIA
Posted: Mon Oct 14, 2019 10:50 pm
by Chromatix
Right, but remember you need running code on the CPU to drive the 6522 and obtain data from the serial EEPROM. The CPU won't be able to execute code directly from the serial EEPROM; it'll have to be loaded into RAM first.
This means you need a *second* EEPROM, in parallel format, to boot the CPU and run that code.
Re: Can you Connect a Serial EEPROM to the 6522 VIA
Posted: Mon Oct 14, 2019 11:07 pm
by DerpymanMT
Yikes, I cant really get any more EEPROMS at the moment, Is there anything else that I could do? I Did have a 280k EPROM somewhere, Could i use that? Its Parallel, and could i limit the amount of data it holds?
Edit: I don't have it...

Re: Can you Connect a Serial EEPROM to the 6522 VIA
Posted: Tue Oct 15, 2019 12:57 am
by GARTHWILSON
The processor will have to boot off of parallel memory, whether PROM, EPROM, EEPROM, or RAM. If all you had was RAM, you'd need a way to pre-load it with the reset vector and a reset routine before letting the processor out of reset, and some sort of short program to load applications after it's up. We've had various discussions about how to pre-load RAM, whether manually (with switches) or using a microcontroller, but they're all either more expensive, more complex, or both. Perhaps there would be a forum member near you who could program an (E)EPROM for you to help you get going. Ideally this person would be close enough to not have to be shipping parts back and forth, since it will probably take a few iterations to get things going. Where are you?
Re: Can you Connect a Serial EEPROM to the 6522 VIA
Posted: Tue Oct 15, 2019 10:33 am
by DerpymanMT
Im near Washington D.C, in Virginia. So yeah, I cant really pay for anything atm, and I havent got my Driver's License, so im stuck, unless my parents let me meet this person halfway for some ROMS... I do have one more Arduino UNO, that i could use for Instructing the CPU to Read from the Serial EEPROM. But then I would have to then halt the CPU until the Arduino Boots up...
I would myself be willing to meet this person at a halfway point between us, IDK about my parents...
I am only In highschool, (But I have the soul of an old man! HAHA)
Anyway If you know anyone who lives in Northern Virginia, or Near D.C, Let me know!
Re: Can you Connect a Serial EEPROM to the 6522 VIA
Posted: Tue Oct 15, 2019 11:11 am
by Chromatix
If you can only get one EEPROM chip, then make it a parallel one in the first place. You can plan to add a serial one later, and use it as the modern equivalent of a floppy disk.
280KB is an odd size for an EEPROM, BTW. Are you confusing it with the model number? Many parallel EEPROMs have a model number starting with 28, eg. the AT28C64B is an inexpensive 8Kx8 (64Kbit) model that would be a good choice to start with. Another clue is the number of pins; parallel EEPROMs get more pins as their capacity goes up, to accommodate the extra address lines.
Re: Can you Connect a Serial EEPROM to the 6522 VIA
Posted: Tue Oct 15, 2019 2:11 pm
by cbmeeks
DerpymanMT,
I didn't quite get what you're trying to do. Are you trying to build a 6502 based computer from the ground up? Or, are you just wanting a 6502 computer to program?
I like helping younger "6502 newbies" out whenever I can.
If you want, PM me your address and I will mail you a 28C256.
You will need a programmer for it. If you don't already have one, they are pretty easy to build one (for the 28C256) from the Arduino UNO you mentioned.
Re: Can you Connect a Serial EEPROM to the 6522 VIA
Posted: Tue Oct 15, 2019 6:07 pm
by DerpymanMT
I am trying to build from the ground up and program with it. I will pm you some details.
Re: Can you Connect a Serial EEPROM to the 6522 VIA
Posted: Tue Oct 15, 2019 6:57 pm
by cbmeeks
I am trying to build from the ground up and program with it. I will pm you some details.
Always glad to help.
Speaking of EEPROM...it's crazy how expensive the 28C256 is these days! My current SBC uses it but I'm considering using a cheaper (although much larger) alternative like NOR flash.
https://www.mouser.com/ProductDetail/804-39SF010A7CPHE
It's about 1/3 the cost. I think it's a little slower, however.