EEVblog Electronics Community Forum
Electronics => Projects, Designs, and Technical Stuff => Topic started by: 5065AGuru on June 02, 2021, 02:10:32 am
-
Hi,
I have an instrument that has a 24C16 EEPROM.
The EEPROM is programmed externally and is read only.
I'd like to be able to easily switch between two different EEPROMS. (I currently remove one and install the other)
Can I wire them in parallel and use the VCC Pins to select the one I want?
The data sheets don't seem indicate how to address (hardware wise) between two chips.
Thanks!
Corby
-
you can wire them parallel, but watch out, that the two are running with different I2C addresses
I'd take a toggle switch, which toggles the A0 pin for one of the eeproms on 1, for the other on 0 - and vice versa
-
The 24xx16 ignores its address pins A0-A2, they are all n/c. You cannot have more than one 24xx16 on the same I2C bus.
Switch SCL, with a high value pullup resistor at each EEPROM. You don't need to switch SDA as the deselected EEPROM will 'see' bus activity as Start condition immediately followed by Stop condition (as its SCL is held high) which has no effect.
-
I was a bit surprised that the 24C16 has three NC pins.
If you look at a bit bigger chip, such as the 24c64, then you see it has three address lines.
Disconnecting the power line is not a good idea. This may also pull down SDA and SCL of the chip, or it may try to power itself from these lines.
If you use a bigger chip such as the 24C64, then you can use a few switches on the address lines to move the chips around in the I2C address space.
I've made the assumption though that you can just put in a 24C64 in the place of an 24C16. I have not checked if there are any differences in the protocols to read or write from these chips.
To do the switching properly, you also have to make sure nothing is switched while the chip is active, or else you will corrupt your data.
-
You cant substitute larger EEPROMs as they use an extra address byte in each I2C transfer, so code written for 24xx16 and smaller wont set the read or write address successfully.
-
The 24xx16 ignores its address pins A0-A2, they are all n/c.
good to know, thanks! I normally use the 24c64, so I concluded that it has to be the same with the smaller one
-
Ian,
Thanks for the reply.
So I hook them up in parallel except for the SCL pins.
I then connect to the SCL pin of the EEPROM I want to use and disconnect and pullup the other EEPROMS SCL pin?
Is that correct?
BTW power will be removed before switching between EEPROMS.
Cheers,
Corby
-
Yep. That should work *IF* you keep the extra SCL wiring short enough not to pick up too much noise, and to avoid too much capacitance between the active and inactive SCL wires, which could cause glitches that clock the inactive EEPROM so it conflicts. Screened cables will reduce noise pickup but increase the capacitance to ground which may put the bus out of spec for capacitive loading, increasing risetime, possibly to the point of failure.
If the extra pullups are more than an order of magnitude greater than the existing ones, you can probably get away without switching them so will only need a SPDT switch.
Worst case in a high noise environment with long wiring runs you may need a SPDT analog switch IC right next to the EEPROMs, so the extra SCL wiring is minimal length and the control signal can be pure DC.