In Circuit EEPROM Programming at speed.

For discussing the 65xx hardware itself or electronics projects.
Post Reply
digidice
Posts: 43
Joined: 03 Oct 2010

In Circuit EEPROM Programming at speed.

Post by digidice »

So what is the correct way to design your system to be able to program to an eeprom in circuit? All the ones I see have really slow access times ie 28c16's with 90ms access times.

Thanks!
clockpulse
Posts: 87
Joined: 20 Oct 2012
Location: San Diego

Re: In Circuit EEPROM Programming at speed.

Post by clockpulse »

digidice wrote:
So what is the correct way to design your system to be able to program to an eeprom in circuit? All the ones I see have really slow access times ie 28c16's with 90ms access times.

Thanks!
Do you mean ns?

You might want to look at the Atmel AT28C64B, it's 8k with 150ns max access time. (usually faster than max at room temp, I have used them at 10mhz) There are faster units as well. As far as programming cycles, you can use a time delay, data polling or toggle bit.
digidice
Posts: 43
Joined: 03 Oct 2010

Re: In Circuit EEPROM Programming at speed.

Post by digidice »

I meant Nano Seconds, Certainly not Mano seconds :) Fat fingers on the keyboard.
So the typical method your saying is to make a routine that basically counts a few clock cycles between each write of data or verifies each bit of data going into the eeprom.

Makes sense, I was just thinking of using it as slow ram. I guess I could make a "firmware" update function that copies from Ram to eeprom.


Thanks
User avatar
MichaelM
Posts: 761
Joined: 23 Apr 2012
Location: Huntsville, AL

Re: In Circuit EEPROM Programming at speed.

Post by MichaelM »

The technology of the 28C16 is quite old. I had expected that the devices were fully obsolete, but apparently ON Semiconductor and Atmel still make these types of devices (and Digi-Key apparently has some stock).

If you are making something new, I would recommend using a 5V Flash part instead. The write sequence may not be as clean as that of the 28C16 EEPROM, but it would certainly program 3 orders of magnitude faster: 10 microseconds per byte for Flash versus 10 milliseconds per byte for 28C16 EEPROM.
Michael A.
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Re: In Circuit EEPROM Programming at speed.

Post by 8BIT »

digidice wrote:
So what is the correct way to design your system to be able to program to an eeprom in circuit? All the ones I see have really slow access times ie 28c16's with 90ms access times.

Thanks!
My SBC-2's could program the 32k EEPROM in-system. The trick is to have the programming code run in RAM along with the data. You cannot attempt to access the EEPROM while it is being written. My system had 31.7k of RAM so I would usually split the 32k EEPROM into two 16k blocks. To do the actual programming, I just used the data-polling method to wait for the end of each write cycle. I can post some code snipets if you are interested.

Daryl
Please visit my website -> https://sbc.rictor.org/
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: In Circuit EEPROM Programming at speed.

Post by GARTHWILSON »

8BIT wrote:
I can post some code snipets if you are interested.
I would be interested, particularly to post and link to in the notes under my schematic of a very basic 6502 computer at the top of my circuit potpourri page which can use a 28c256. (I would give you credit of course.) Anything to remove the mysteries that intimidate or hold back new builders is good.
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?
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Re: In Circuit EEPROM Programming at speed.

Post by 8BIT »

My SBC2 uses essentially the same code. This has been simplified for the sake of clarity as my code first copies itself from the System Monitor in EEPROM to RAM before executing. This routine will copy 16k from RAM located from $1000-$4FFF to EEPROM located at $8000-$BFFF.

This routine has to be located in RAM also, at say address $0800 for example.

Here's the code:

Code: Select all

AddPtr  = $e0                          ; zp pointer
DestPtr = $e2                          ; zp pointer

               LDA   #$00
               STA   AddPtr
               LDA   #$10
               STA   AddPtr+1          ; start of RAM source
               LDA   #$00
               STA   DestPtr			
               LDA   #$80              ; start of EEPROM
               STA   DestPtr+1			
Loop           LDA   (AddrPtr)         ; Moves one byte
               STA   (DestPtr)         ;
EEPROM_TEST    LDA   (AddrPtr)         ; Read Source  
               EOR   (DestPtr)         ; EOR with EEPROM Data
               bmi   EEPROM_TEST       ; Bit 7=0 if write is done
               INC   AddPtr            ; pointers are in sync
               INC   DestPtr           ; so we can inc together  
               BNE   Loop
               INC   AddPtr+1
               INC   DestPtr+1         ; inc upper byte 
               LDA   #$C0              ; 16k copied when
               CMP   DestPtr           ;  DespPtr+1 = $C0	
               BNE   Loop
               RTS
The polling mode of my EEPROM states that bit 7 will be read as opposite of the data written while the write sequence is in progress and will return a matching value when the write is complete. I simply use the EOR instruction to test the source and destination bits. It works quite well.

Daryl
Last edited by 8BIT on Tue Feb 19, 2013 1:54 pm, edited 1 time in total.
Please visit my website -> https://sbc.rictor.org/
digidice
Posts: 43
Joined: 03 Oct 2010

Re: In Circuit EEPROM Programming at speed.

Post by digidice »

Thanks Daryl that is perfect. I dont really care how long it takes for the data to get in there. It would be nice to not have to pull the chip out to update the firmware. especially when your tweaking things a lot.
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Re: In Circuit EEPROM Programming at speed.

Post by 8BIT »

You're welcome. I bought 1 of these and used it on SBC-2 (and later on SBC-3) to make cycling the EEPROMs faster with less worry about bending pins. I just mounted a machined-pin socket on the board and plugged this in on top. Once development was done, I removed the ZIF socket and put the EEPROM in the machined-pin socket.

http://www.digikey.com/product-detail/e ... 7-ND/41613

Daryl
Please visit my website -> https://sbc.rictor.org/
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: In Circuit EEPROM Programming at speed.

Post by GARTHWILSON »

Daryl, on second thought, I think I'll just post the link your post above. It's simpler, and if you decide to edit it the post for whatever reason, you can.
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?
Post Reply