Inconsistant reads w/ SPI Flash & TI 430 micro

May 27, 2009 5 Replies

I've implemented several routines for the TI 430 that interface with a SPI flash chip (reads, writes, read id, etc). The problem I'm having is that my reads are not always consistant. Flash is fully erased yet, I read in 0x00. If hit a breakpoint and restart I then read in 0xFF (which is expected when this particular chip is erased). What could possibly cause this?



Thanks, dcastel


Hang a scope or logic analyser on it the SPI. Check timing, check data on the bus is what you see in registers. If you don't have a scope or logic analyser it will take you a very long time to sort it out. You might get some luck here (in c.a.e) but you would need to provide a lot more detail.

Michael Kellett

Correct SPI phase and clock polarity are crucial. You can sometimes get intermittent results if one is wrong simply because of hold times from the memory.

Mark Borgerson

And it doesn't matter how long you study the datasheets for the devices -- on the first attempt you'll get either phase or polarity set up wrong.

Grant Edwards grante Yow! Will this never-ending at series of PLEASURABLE visi.com EVENTS never cease?

Agreed (almost) - that's why you need the scope.

Murphy's second law says that the probability of getting it wrong is, in fact, directly proportional to the time spent studying the data sheets.

Michael Kellett

In cases like SPI clock setup where there are only four choices, one would be tempted to just try different combinations until you find one that works. But, somehow there's always one that isn't really right but will partially work just long enough to fool you into thinking it's right.

Grant Edwards grante Yow! I know th'MAMBO!! at I have a TWO-TONE CHEMISTRY visi.com SET!!

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required