Jump to content
  • entries
    62
  • comments
    464
  • views
    86,898

Cheap EEPROM cart


supercat

619 views

Well, I've come up with a cheap method of adding a serial EEPROM to a cart. Albert's F8/F6/F4 board should be easily adaptable to the purpose. The EEPROM may be accessed much faster than the EEPROM in a MemCard/Atarivox--a rate of 298kbps. Indeed, it's 33% faster than even 4A50's EEPROM access which is itself quite impressive for a 6502.

 

Code to access the EEPROM must be stored in a pair of adjacent banks; 0 and 1 are recommended, but 2 and 3, 4 and 5, or 6 and 7 could be used if desired. The bottom bankswitch bit is connected to the EEPROM's data line; when the EEPROM is outputting a "zero", memory will be accessed from an even-numbered bank even if an odd-numbered bank is selected. Some care should be taken to ensure that the EEPROM is inactive when expecting to read odd-numbered banks.

 

The banking method uses a very large number of hotspots, mostly in the $0400-$0FFF range. Reads from these addresses do not affect anything in the 2600(*), so hotspots there do not waste address space. The range $1FF0-$1FFF are also hotspots.

 

For the following hotspot descriptions note the following:

 

-1- SCK is normally low, but goes high when certain hotspots are accessed

 

-2- The lower banking bit is wired to SDA. This means the EEPROM sees changes to the lower banking bit, and that the EEPROM can jam the lower banking bit.

 

-3- Changes to the lower banking bit are delayed by a cycle

 

-4- Use of the BIT instruction to skip code is dangerous because it may accidentally read hotspots. For example, using "BIT" to skip over "LDA #$08" would result in a read of $08A9, triggering an I2C clock and possible bankswitch.

 

Hotspots:

 

$1FF0-$1FF7 -- Drive clock high for a cycle, then set lower banking bit

$1FF8-$1FFB -- Drive clock high for a cycle, then clear lower banking bit

$1FFC-$1FFF -- Select bank zero (do not affect clock)

 

$0800-$08FF -- Drive clock high for a cycle; copy A0 to lower banking bit

$0900-$09FF -- Drive clock high for a cycle; copy A1 to lower banking bit

$0A00-$0AFF -- Drive clock high for a cycle; copy A2 to lower banking bit

$0B00-$0BFF -- Drive clock high for a cycle; copy A3 to lower banking bit

$0C00-$0CFF -- Drive clock high for a cycle; copy A4 to lower banking bit

$0D00-$0DFF -- Drive clock high for a cycle; copy A5 to lower banking bit

$0E00-$0EFF -- Drive clock high for a cycle; copy A6 to lower banking bit

$0F00-$0FFF -- Drive clock high for a cycle; copy A7 to lower banking bit

 

$0400-$04FF -- Drive clock high for a cycle; copy A5 to lower banking bit

$0500-$05FF -- Keep clock high if it was on previous cycle (no other effect).

Note: Banking change from previous cycle will take effect during this one.

$0600-$06FF -- Copy A5-A7 to banking bits (do not drive clock)

Note that if code from bank 0 is RORG'ed to $1000, bank 1 to $3000, etc. up to

bank 7 at $F000, storing the MSB of an address here will switch to the proper

bank.

$0700-$07FF -- Copy A7 to lower banking bit, but do not drive clock high

 

Most operations will drive SCK high and low and then update SDA. It's possible to update SDA without hitting SCK by using a banking address at $06xx. To change SDA while SCK is high, perform an indexed operation to $04xx in such a way as to cross a page into $05xx. SCK will be held high until the end of the $05xx address, but value of SDA set by the $04xx access will take affect at the beginning of it.

 

Anyone think this sort of thing sounds interesting?

5 Comments


Recommended Comments

I do, of course.

 

I am wondering something, though. I recall you saying that you wanted to use a 2k EEPROM. Is there a 4k EEPROM out there that's just as easy to use, but maybe a little more expensive?

 

Also, would it be very easy to allow one to be able to program the EEPROM from a PC without needing to remove the chip, given a special cable/connector/programmer and software?

Link to comment
I am wondering something, though. I recall you saying that you wanted to use a 2k EEPROM. Is there a 4k EEPROM out there that's just as easy to use, but maybe a little more expensive?

 

The 4K and larger EEPROMs require an extra 36 cycles to do a random read/write. The prices for 4K and 8K parts are still quite cheap; I think the 8K part is about $0.25 more than the 2K part. My thought was that some games might want the faster access and most games wouldn't need the larger capacity. Wiring is the same regardless.

 

Is 2Kbytes really not enough? Strat-O-Gems makes good use of the EEPROM, and it only takes 320 bytes. Although 36 cycles isn't a huge extra penalty for random reads, it could be a nuisance if trying to access the EEPROM within the kernel (not quite as crazy an idea as you might think). In a Super-Maze-Craze style game, for example, which shows 24 rows of 40 pixels each, it would be necessary to do a random seek and six byte reads for every sixteen scan lines (assuming 1/4 of the pixels are always set, 1/4 always clear, and the other half variable). On a 24LC16, the random seek would take about 128 cycles; on a 24LC64, it would take about 164. The data fetches would take 216 cycles, so seek+fetch would take 344 or 380. If one figures the kernel would need an average of 40 cycles per scan line to run the display with already-fetched data, there would be about 576 cycles available for data fetching and munging, and for kernel management. Things would be very tight, but might be workable. But that extra 36 cycles could make a big difference.

 

Also, would it be very easy to allow one to be able to program the EEPROM from a PC without needing to remove the chip, given a special cable/connector/programmer and software?

 

When the chip is on board, the 2600 will control.them. If you want to include a serial-port-operated EEPROM utility within the ROM, that wouldn't be too hard.

Link to comment

Sounds interesting to me. Unfortunately I don't understand exactly how you would program the EEPROM as my hardware knowledge is very limited, but it would certainly be useful to have. If you were writing from the chip during the kernel wouldn't you quickly wear out the chip (assuming it is based on flash memory)?

 

Chris

Link to comment

Oh, yes I'm also intrigued and think it's a swell idea.

 

It's a nice option that's available on Vectrex carts and should pretty darn handy.

Link to comment
Sounds interesting to me. Unfortunately I don't understand exactly how you would program the EEPROM as my hardware knowledge is very limited, but it would certainly be useful to have. If you were writing from the chip during the kernel wouldn't you quickly wear out the chip (assuming it is based on flash memory)?

 

A "write" cycle entails the processor sending a start signal, followed by two or three bytes of address information (depending upon the chip), followed by any data to be written. The data is transferred into a small buffer within the EEPROM chip; if one or more bytes of data followed the address, and if the write cycle was properly terminated by a STOP signal immediately following the acknowledgement of the last byte, the contents of that buffer will be stored into the EEPROM array. When this occurs, the chip will become inaccessible for about 2-5 milliseconds.

 

A "read" cycle entails the processor sending a start signal and one byte of address information, and then reading as many bytes of data as are desired. Data will be read sequentially, starting at the last address specified in a "write" cycle.

 

Note that "writing" zero bytes to the chip will not cause a store operation to take place, but will merely set the address that should be used by a succeeding "read" cycle. There is no lifetime limit to how many such zero-byte write cycles may be performed, and no delay is required between such a write cycle and a following read.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...