Author Topic: Serial flash memory read without voltage  (Read 819 times)

0 Members and 1 Guest are viewing this topic.

Offline robzyTopic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: au
Serial flash memory read without voltage
« on: July 04, 2022, 10:38:14 am »
Somehow my ESP32 was able to read a serial flash memory chip even though the chip wasn't connected to power (missing the ground connection).

Any guesses as to what might be happening? I'm guessing its parasatic power because the chip is bust?

Background: I have a 10 year old ASRock motherboard that refuses to boot. It's stone cold dead. Its a fancy-pants one with an LED diagnostic display that doesn't show anything. That lead me to suspect that maybe the BIOS is borked. Thankfuly the BIOS chip is in a removable DIP-8 package.

Reproduction steps:
  • I hooked up the W25Q64FV (datasheet) to an ESP32 on a breadboard
  • Using the Arduino framework with the SPI library
  • Sent the command to get the JEDEC ID (0x9F) and observed the result.
  • Observed the result. 30% of the time the correct result came back, 70% of the time the incorrect result came back, usually with only 0x00s or 0xFFs.
  • The correct/incorrect responses tend to occur in clumps.

Super weirdness:
I played around with all the physical connections, but nothing seems to make a difference. The weird thing is that the observations kept on happening even when the W25Q64FV's GND pin was left totally disconnected. 30% of the SPI responses had the correct JEDEC ID results.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19491
  • Country: gb
  • 0999
Re: Serial flash memory read without voltage
« Reply #1 on: July 04, 2022, 12:13:54 pm »
This is common. The power supply current can find a path through one or more I/O pins, via the internal ESD protection diodes.
 

Offline robzyTopic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: au
Re: Serial flash memory read without voltage
« Reply #2 on: July 04, 2022, 12:54:52 pm »
Ah ok, that does make sense, and I think I've heard about it before.

So what on earth could be causing this flash chip to not send through a proper response 70% of the time?

I've hooked up a logic analyzer and confirmed that sometimes it responds, and sometimes it doesnt.

It's all on a breadboard, so I was thinking maybe signal integrity issues, but I'm running the SPI at only 10kHz.

Attached is a screenshot of a 'good' response. In a 'bad' response the MISO line just stays high.
« Last Edit: July 04, 2022, 01:00:08 pm by robzy »
 

Offline NiHaoMike

  • Super Contributor
  • ***
  • Posts: 9007
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Serial flash memory read without voltage
« Reply #3 on: July 04, 2022, 03:35:04 pm »
It's all on a breadboard, so I was thinking maybe signal integrity issues, but I'm running the SPI at only 10kHz.
It has to do with rise/fall times, not just the frequency. Try adding a 100 ohm/100pF series RC snubber from clock to ground to help suppress ringing.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline MikeK

  • Super Contributor
  • ***
  • Posts: 1314
  • Country: us
Re: Serial flash memory read without voltage
« Reply #4 on: July 04, 2022, 05:16:57 pm »
While my breadboards have been good up into the MHz, I use quality boards and keep wires to minimum length.  A photo of your breadboard setup?
 

Offline robzyTopic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: au
Re: Serial flash memory read without voltage
« Reply #5 on: July 05, 2022, 01:57:34 am »
Okay that's making sense. I'm using an old breadboard and old hookup wires. The wires are kept short. But I wouldn't bet my life on this setup.

The RC snubber is an interesting idea. I'll buy some 100pF caps and give it a shot.

If that doesn't work then I'll solder it up on protoboard.
 

Offline robzyTopic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: au
Re: Serial flash memory read without voltage
« Reply #6 on: July 05, 2022, 12:26:58 pm »
A-ha! SOLVED IT!

I only had a 100nF cap and a 100ohm resistor, but I thought I'd give it a shot anyway.

100nF & 100ohm RC low-pass filter on CLK pin, running SPI at 1kHz, nothing at all. It seems like 1kHz might be too slow for the chip.

100nF capacitor accross chip's VCC and GND pins - slightly increase in reliability. But still not perfect.

Weird.

Multimeter across the 100nF cap. Measuring only 2.8v. Weird. Should be 3.3v.

Changed which breadboard pins were feeding the flash chip power - BINGO. Voltage across the cap shot up to 3.3v. And the chip worked perfectly.

Bottom line - it was a breadboard issue. One of the VCC/GND connections was not solid enough.

Thanks everyone for your help! You definitely got me rolling in the right direction.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf