AnsweredAssumed Answered

Still having SPI/EEPROM 'Read' problems

Question asked by James Whitney on Mar 29, 2019
Latest reply on Apr 4, 2019 by James Whitney

Still having trouble reading a UID code from a Microchip 25AA02UID attached to a LPC54114 Xpresso board. I have carved up a copy of the 'spi_polling_flash' project.

I can now see some action on the MISO line, but the returned values are not correct (i.e., still four bytes, all '0'). A potentially bigger problem is the clock doesn't seem active for the required number of cycles. Any suggestions ?

In the 'flash project the first call to the callback is sent an array with the 'opcode', i.e., 'read' (0x03) and an address '0xFC' (though I tried other values).

CMD[0] = 3;

CMD[1] = 252;

CMD[2] = 0;

CMD[3] = 0;

CMD[4] = 0;

Somehow, on return the 'CMD' array returns with:

CMD[0] = 0

CMD[1] = 0

CMD[2] = 2

CMD[3] = 32

CMD[4] = 49

Against hope, these *ARE NOT* the expected UID values.

In the second call, the callback is sent an array to receive the data spooled from the 'SO' signal. I.e.,

destBuff[0] =  0;

destBuff[1] =  0;

destBuff[2] =  0;

destBuff[3] =  0;

After the callback returns printf of destBuff gives

destBuff[0] =  0

destBuff[1] =  0

destBuff[2] =  0

destBuff[3] =  0

I.e., no change in value.


CODE in .PDF and .TXT attached