LowPowerLab / SPIFlash

Arduino library for read/write access to SPI flash memory chips
GNU General Public License v3.0
173 stars 91 forks source link

JEDEC ID is 3 bytes #23

Closed ianccole closed 5 years ago

ianccole commented 5 years ago

I think the JEDEC ID is 3 bytes:

https://www.winbond.com/resource-files/w25x40cl_e01.pdf

1: Manufacturer Id 2: Memory type 3: Capacity type

This:

  uint32_t jedecid = 0;
  jedecid |= (uint32_t)SPI.transfer(0) << 16;
  jedecid |= SPI.transfer(0) << 8;
  jedecid |= SPI.transfer(0);

yields EF3013 and EF4016 on 2 boards I have

LowPowerLab commented 5 years ago

True, but in the case of the chips I use I only care to ensure the instruction set will work, not so much about capacity. That means checking the manufacturer and mem type.

ianccole commented 5 years ago

Ok. Fair enough. I’ll close this issue.