6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon May 13, 2024 4:30 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Dec 29, 2022 4:26 pm 
Offline
User avatar

Joined: Tue Jul 17, 2018 9:58 am
Posts: 104
Location: Long Island, NY
I've finally put together a working prototype cartridge for my GameTank system that adds battery-backed SRAM so programs can save persistent data.

This board has 32Kbyte of RAM in addition to the 2Mbyte Flash of my previous design. As before, a shift register is used to select the higher-value address bits of the flash memory. One of the shift register's output pins was unused, so now it selects between the Flash and the SRAM. Also as before, any accesses to the upper quarter of memory will go to the same window in Flash regardless of the shift register state. This guarantees that the Reset vector is accessible on boot.

So far the prototype performs well, and can save values between game sessions while the system is powered off and the cartridge is removed. There currently isn't any protection against the RAM getting written during undefined cold boot behavior, but this only seems to affect the bottom address of SRAM.

One curious behavior happens while the system is powered "off" but the cartridge is not removed. Some of the RAM chips partially retain their contents, for many hours at least. I got the multimeter out and found that there is indeed about 1.5V on the cartridge power pins.
I'm still learning the analog domain, so I'm not sure whether it's to be expected from this design, if I picked the wrong diodes, or if this is particularly harmful to the system. It's possible the best solution is to put a note on the back of the cartridge indicating the battery will last longer if the cartridge is stored outside the system.


Attachments:
sramcart.png
sramcart.png [ 68.02 KiB | Viewed 638 times ]
P1140997 (2).JPG
P1140997 (2).JPG [ 379.36 KiB | Viewed 638 times ]
Top
 Profile  
Reply with quote  
PostPosted: Fri Dec 30, 2022 10:56 pm 
Offline

Joined: Wed Jun 23, 2021 8:02 am
Posts: 165
Agumander wrote:
One curious behavior happens while the system is powered "off" but the cartridge is not removed. Some of the RAM chips partially retain their contents, for many hours at least. I got the multimeter out and found that there is indeed about 1.5V on the cartridge power pins.
I'm still learning the analog domain, so I'm not sure whether it's to be expected from this design, if I picked the wrong diodes, or if this is particularly harmful to the system. It's possible the best solution is to put a note on the back of the cartridge indicating the battery will last longer if the cartridge is stored outside the system.


It could be due to the pull up resistors on the CS, OE, WE lines of the battery backed RAM. You don't specify what the values of those are. When the cartridge is plugged in, those lines are connected to something on your main system. It's possible that power is being applied from the back up battery via these pull up resistors and protection diodes on chips on your main board. It's worth investigating further because you might find the back up battery runs out quickly if the cartridge is left plugged in to a powered off system.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jan 01, 2023 12:03 am 
Offline
User avatar

Joined: Tue Jul 17, 2018 9:58 am
Posts: 104
Location: Long Island, NY
Good point. The resistors are 3.3K but maybe some extra diodes are in order for these.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 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:  
cron