cancel
Showing results for 
Search instead for 
Did you mean: 

How to differentiate the 4K and 8K EEPROM by software

surendra
Associate

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.

surendra_0-1727082087429.png

 

warm regards

surendra

 

4 REPLIES 4
Techn
Senior III

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.

If you feel a post has answered your question, please click "Accept as Solution".

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.

 

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.

If you feel a post has answered your question, please click "Accept as Solution".

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.