6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 1:36 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Mon Feb 18, 2013 9:32 pm 
Offline

Joined: Sun Oct 03, 2010 7:45 am
Posts: 43
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!


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 18, 2013 10:09 pm 
Offline

Joined: Sat Oct 20, 2012 8:41 pm
Posts: 87
Location: San Diego
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.


Top
 Profile  
Reply with quote  
PostPosted: Mon Feb 18, 2013 11:34 pm 
Offline

Joined: Sun Oct 03, 2010 7:45 am
Posts: 43
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


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 19, 2013 12:10 am 
Offline
User avatar

Joined: Mon Apr 23, 2012 12:28 am
Posts: 760
Location: Huntsville, AL
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 19, 2013 1:03 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
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/


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 19, 2013 1:50 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
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?


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 19, 2013 4:45 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
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:
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

_________________
Please visit my website -> https://sbc.rictor.org/


Last edited by 8BIT on Tue Feb 19, 2013 1:54 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 19, 2013 5:19 am 
Offline

Joined: Sun Oct 03, 2010 7:45 am
Posts: 43
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 19, 2013 5:29 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
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/


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 19, 2013 5:29 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8543
Location: Southern California
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?


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

All times are UTC


Who is online

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