SPI NOR flash memory

Started by ajellisuk August 27, 2008
Hi

I am using IAR PowerPAc filing system to access 2 SPI NOR flash
devices. I set up a project using the SPI flash driver supplied.
However I have a couple of issues:

The first issue is during the initialization process. I have observed
the following data bytes are written to the SPI bus 0xAB (wake up
from deep power down - which is ok), then 0x9F (read device id). The
problem is with the second byte. When I look at the data sheet for my
device (AMIC A25L16P) there are 4 bytes to be read to make up the
device id, but the FS only attempts to read 3 bytes so the FS doesn't
appear to read all of the info about the device. The info contain in
the device is:
Continuation ID: 0x7F
Manufacturer ID: 0x37
Memory type: 0x20
Memory capacity: 0x15 (bottom), 0x25 (top)

The second problem is that the FS keep giving me the message that it
cannot identify the device. I have hard coded the values above into
the read function as below:

/*********************************************************************
*
* FS_NOR_SPI_HW_X_Write
*
* Description:
* Reads a specified number of bytes from flash to buffer.
*
* Parameters:
* Unit - Device Index
* pData - Pointer to a data buffer
* NumBytes - Number of bytes
*
* Return value:
* void
*/
void FS_NOR_SPI_HW_X_Read(U8 Unit, U8 * pData, int NumBytes) {
do {
switch (NumBytes) {
case 3:
*pData = 0x7F;
break;

case 2:
*pData = 0x37;
break;

case 1:
*pData = 0x20;
break;

}
*pData++;// = _ReadWriteSPI(0xff);
} while (--NumBytes);

}

Could someone please shed some further light onto what my problems
could be?

Thanks

Andrew

An Engineer's Guide to the LPC2100 Series