Did I just fried my external EEPROM chip?

Ok, so I had this motherboard with a corrupted bios on it, it wouldn't boot anymore, wouldn't even post.

So I removed the bios chip from it (luckily, it wasn't soldered, the mobo uses a dip-8 socket).

The chip is a Winbond W25Q16BV.

I put the chip on a breadboard, wire everything as it should be with my UNO and start playing with some SPI code.

Eventually, I came up with a working sketch that would let me read the whole chip.
Comparing the dump with the actual ROM file, it appeared that the first 96bytes of the chip were all messed up.
Sweet, now on to the write code.

I write everything, test test test, I was able to write a few bytes at the specified address without any issues.

So far so good, reading is working, erasing is working and writing is working. Did a last test writing 2 full pages of 256bytes, still working fine.

NOTE: On this chip, in order to be able to write, the memory location should be previously erased, using the sector erase instruction (0x20), which I did. The thing is, this instruction actually erases a full 4K sector. Oh well, no big deal, I can just re-write the full 4k part of the ROM.

I was now ready to write the missing 4k bytes to the rom - wrote my sketch and triggered everything...
I had some debugging code printing progress on the serial monitor, I was up to page 12 of 16 (I was writing in pages of 256bytes) when I suddenly bumped the Arduino board by accident. Then I noticed my power 3.3v wire was almost out of the breadboard socket, so without even thinking I pulled it in as it should be.

I restarted my sketch and started to see ugly things - so I made some test.

If I previously executed an erase on the chip, I could read the erased memroy location and they would output as "FF" as expected, 4096 of them would be "FF"... after the little bumping accident, I see some addresses with "FF", but a lot of other addresses showing "0".

BEFORE:

FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF 
FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF 
FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF 

FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF 
FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF 
FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF 
FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF  FFFF FFFF FFFF FFFF 
...

AFTER:

FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 

0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 FFFF FFFF
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 0000 0000 0000 0000 FFFF FFFF
...

If I try to write to the chip now, it will work in some location, not on other.
Also, reading memory way past the 4k that is erased also now returns only FFs and 0s - I was able to get valid data before.
It's weird though because if I run my normal sketch, that erase a sector then write to it, I'm getting different results each time, meaning that one first run, it won't write to some memory location, then on other, it will write to them...

Is it possible that the fact the 3.3v wire got unplugged/plugged during the execution shorted something and messed up the chip memory?

It's really frustrating, I was that close from fixing it...

What do you guys think ?

This doesn't sound right. The chip you mentioned is an smt 3.3V only chip. Shouldn't
go into a DIP8 socket, and won't interface with 5V UNO without some hacking, ie,
level-shifting. 5V will blow it up. It's also Flash, and not EEPROM.

I used a wrong terminology, I'm far from being an expert with this stuff.

The chip I have is actually a W25Q16BVAIG, if you look for this particular one, you won't find it anywhere (i.e. Digikey, Mouser etc...).
The datasheet states that those DIP8 package are available only on special order from Winbond.

Its definitely going into an 8pin DIP socket though - and yes, the chip operates on 3.3v - I'm using the 3.3v power source from my UNO board to power it up (verified with a multimeter) - reading 2.99v, not the 5v.

Anyways, everything was working perfectly until the wire was pulled out/pulled in from the breadboard by accident - could that cause any issue with the flash chip?

The last few characters in the p/n indicate the package type, so your new p/n looks better.

http://www.tbcart.com/product/12744229843/16Mbit+SPI+FLASH+W25Q16BVAIG+original+authentic+Free+Area+of+the+Republic+of+China+Hua+State+package%3A+DIP8

That being said, I've not used those chips before. However, as it's Flash and not EEPROM,
are you sure you're using the correct sketch, and that the sketch can handle the large
address space and timing delays correctly?

I'm sure that losing Vcc while programming will mess things up, but I wouldn't think that
would be fatal to the chip - I may be wrong, other people may know about this.

Also, do you have the WP pin at the correct level?

Hi,

Actually I found out the hardware that I probably damaged the chip... See, I'm new to all this and I though that connecting the 3.3v Arduino pin to my chip vcc would run everything at 3.3v - but I was wrong, the MISO, MOSI, CS and CLK pin were still outputing 5v.

I should have used a buffer/level chip to divide de voltage between the arduino and the chip 5v -> 3.3 then 3.3v > 5v...

Thanks for your help anyways!