Large memory for low pin count MCUs
Posted: Thu Jun 18, 2020 10:58 pm
Having recently purchased and then written code to access 1MBit flash memory (also available as 2 and 4MBit chips) ( SST39SF010A)
It struck me that that it might be 'fun' to have a large memory available to smaller MCUs with less pins..
I had some 24LC256 chips - so 4 would make a 1MBit memory (128KBytes) - (and 8 would give 256KBytes all on 2 data pins of a ATTiny85 )
I was also interested to see how much slower serial memory would be compared to the parallel access (- it's quite a lot slower (surprise) but the i2c chips do have some features (block read / write) which means they are still reasonably quick if you can read or write a block of data at a time.
I wired 4 24LC256 chips to the i2c bus on an Arduino Uno and connected A0..A2 to 5v to number them as 0..3.
I then modified some of my i2c-eeprom code to allow larger memory addresses (the chip being selected according to the address being written or read)
The question is - would anyone find this useful? I've hardly tested the code (I've posted it here for interest - note that some of the properties are redundant (a0..a2) chip size etc - it's only intended to work with the 24LC256 chip) If anyone thinks it could be useful I'll tidy things up - and test it a bit more diligently too!
Note that the i2c display here is not attached - I'd initially hoped it's pull-ups would be sufficient on the i2c bus.. They weren't hence the rather inelegantly applied 4k7 resistors.
Martin
It struck me that that it might be 'fun' to have a large memory available to smaller MCUs with less pins..
I had some 24LC256 chips - so 4 would make a 1MBit memory (128KBytes) - (and 8 would give 256KBytes all on 2 data pins of a ATTiny85 )
I was also interested to see how much slower serial memory would be compared to the parallel access (- it's quite a lot slower (surprise) but the i2c chips do have some features (block read / write) which means they are still reasonably quick if you can read or write a block of data at a time.
I wired 4 24LC256 chips to the i2c bus on an Arduino Uno and connected A0..A2 to 5v to number them as 0..3.
I then modified some of my i2c-eeprom code to allow larger memory addresses (the chip being selected according to the address being written or read)
The question is - would anyone find this useful? I've hardly tested the code (I've posted it here for interest - note that some of the properties are redundant (a0..a2) chip size etc - it's only intended to work with the 24LC256 chip) If anyone thinks it could be useful I'll tidy things up - and test it a bit more diligently too!
Note that the i2c display here is not attached - I'd initially hoped it's pull-ups would be sufficient on the i2c bus.. They weren't hence the rather inelegantly applied 4k7 resistors.
Martin