Closed m-kozlowski closed 9 years ago
Read status register should return 0x0 not anything else so while(busy()) should pass immediately. If you get a non 0 result on MISO it means you have a noise/static issue on the open drain MISO and you should pulldown the MISO line to avoid that. See also this related and basically same issue: https://github.com/LowPowerLab/SPIFlash/issues/4
According to datasheet, powered down chip will ignore every instruction except "Release from Power-Down" and "Device ID". This includes the Read Status Register.
In such scenario (at least on my platform) SPI.transfer(SPIFLASH_STATUSREAD) always returns 0xFF, so while(busy()) loop will never complete. This loop is executed before sending instruction to the chip, so there is no way to access flash after sleeping it.