2024-09-23 02:01 AM
I am using M24C08(1K), M24C16(2K) and M24C32(4K) along with this I am planning to use the M24C64(8K) eeprom.
How can we differentiate the 4K and 8K eeprom using software. I have implemented a logic to read last page of the eeprom. Let's say I am having the 4 variants of the eeprom's with me. I have started a loop and start reading the last of 8k initally if it gets sucess then I will return the size directly or else I will move further to check same with the 4K.
The above provided logic is working fine with 1K, 2K and 4K, but it is not working for the 4K and 8K. This is because the 4K eeprom MSB has 4 bit don't care. If try to read the address above the 4095 then it will read the data from the 4K eeprom itself.
so my question is that if we have a hardware of two variants with 4K and 8K then how can we find the size by using the software.
warm regards
surendra
2024-09-23 04:46 AM
You can store some identification string at location 0 of the device at the time of manufacturing, so that later you can use that to identify the device and then use the correct addressing mechanism to access the device.
2024-09-23 04:54 AM
1k, 2K and 4K eeprom's are already installed at site, so this solution is not feasible for us. We just want to detected the size of the eeprom based on the Flash id.
2024-09-23 05:21 AM
Ok, if you are ok for destructive method, you can try to write 0xA5 (known pattern to the last memory location and read it back. if it is written to the non-existing location, you will not get back the same value as written.
2024-09-23 09:51 PM
The above mentioned solutions are not feasible in your case. So i would request you to suggest some other solution to differentiate the 4K and 8K eeprom.
In 4k addressing ST have introduced 4 don't care bits in the MSB due to this If I send the address as something like 8159 then it will not returning error rather it is reading data from the 4K itself. As we have two variants 4K and 8k it will be difficult to differentiate based on this. So we would like to hear a generic solution from our side.
Please let us know if it is not feasible to differentiate rather above two solutions.