cancel
Showing results for 
Search instead for 
Did you mean: 

spi serial flash

nischalrao9
Associate II
Posted on January 14, 2013 at 18:00

The original post was too long to process during our migration. Please click on the attachment to read the original post.
7 REPLIES 7
crt2
Associate II
Posted on January 15, 2013 at 13:02

can you be a bit more precise what you expect to get and what you actually get or where in this pile of code we should look?

Andrew Neil
Evangelist
Posted on January 15, 2013 at 13:23

''i am unable to figure out what is the problem''

So what efforts have you made so far to try to figure out what is the problem?

What have you tried? What were the results?

Have you used the debugger to see what's happening in the code?

Have you used an oscilloscope to see what's happening on the wires?

http://www.8052.com/faqs/120313

http://www.eetimes.com/discussion/break-point/4027526/Developing-a-good-bedside-manner?pageNumber=0

nischalrao9
Associate II
Posted on January 16, 2013 at 17:50

yes, i hooked up the MISO(PB14) and the MOSI(PB15) pins to and oscilloscope....All i was getting was a high at the MOSI pin.......there is no compilation  error, on debugging, the write function gets executed...however while reading, i do not get it back... so i am not sure if data has been actually been written into the memory or not. I tried replacing the functions with the opcodes mentioned in the datasheet, but same problem... i guess the problem is with the flash initialisation or the write process... kindly look into it...

nischalrao9
Associate II
Posted on January 16, 2013 at 17:58

I am writing data into the memory (address 0x70000), and then reading back the same afer some time..... i suppose the problem is either with my flash initialisation function or the write function.... kindly have a look at the functions....

Andrew Neil
Evangelist
Posted on January 16, 2013 at 19:23

And what about the clock and slave-select (or ''chip-select'' or whatever) signals...?

nischalrao9
Associate II
Posted on January 16, 2013 at 20:20

Ya...have taken care of it..its active low...i make it low before a function execution and make it high after function execution(indicated in comments in the code)...and i have divided the system clock using a pre-scalar and given a freq of 2.25MHz (well within the max limit)

Andrew Neil
Evangelist
Posted on January 16, 2013 at 21:42

And, with your oscilloscope, have you verified that the clock line is actually clocking, and the chip-select is actually going low.

Have you, with your oscilloscope, verified that all the timings on the lines match the requirements of the slave device?