Using PIC/AVR with tactile button to switch EEPROM banks

Thread Starter


Joined Jul 26, 2018

First post...

I have an application that requires a PIC or a AVR. I'm not sure which would be best. I know BASIC but C is VERY rusty and ASM is zero.

I want to develop a cartridge with an EEPROM on it. Currently, the user needs to toggle some jumpers/dip switches to move between the 8K or 16K banks of the EEPROM. That's a pain. The idea situation would be for the user to click a tactile button and have it move though the banks, and when it gets to the last bank, it should go back to the first bank.

The steps would be something like...

1. User turns on machine and bank 1 is loaded.
2. User pushes switch.
3. The PIC/AVR records what bank they are on
4. Increment the switch counter by 1.
5. The PIC/AVR sends a command to the cartridge port to reset the computer (signal sent to reset line)
6. After the reset, load the bank that is in the counter.
7. Continue 2 through 6 until get to last bank. The next switch press will make the counter go back to 1.

Right now, my goal is to get this to work with one EEPROM. If I can master it, then I want to get more complicated and use to EEPROMS.

So the same code as the above except, when the counter gets to 5, it will load bank 1 of the second EEPROM
Counter Bank
1 Eprom 1, Bank 1
2 Eprom 1, Bank 2
3 Eprom 1, Bank 3
4 Eprom 1, Bank 4
5 Eprom 2, Bank 1
6 Eprom 2, Bank 2
7 Eprom 2, Bank 3
8 Eprom 2, Bank 4

So my first question is, should I use a PIC or AVR? Actually, I have a BASIC STAMP 2 someplace, so maybe use that? And once it is working, get a stand alone PIC?

In terms of the circuit, I'm pretty lost. Am I using a resistor to pull the voltage high/low in order to trigger things from the PIC?

Kinda lost for sure.




Joined Mar 10, 2018
Normal interface to a button on a pin is to enable internal
pin pullup, and switch is wired pin to ground. Switch active when
pin is read low.

Don't forget to debounce the switch, many code routines on net to do
this, just google "switch debounce", ,more hits than you have life left
to read them. Arduino I think has a built in

Regards, Dana.