Hello,
I'm trying to use the MCB2300 board (LPC2378) with an external serial flash using SPI (ST M25P80). First, I used SPI without interrupt and it works without any problem. But LPC2378 SPI has a maximum clock of 9MHz (with a 72MHz master clock). And I would like to use my flash with a faster clock.
So I tried to use the SSP. I didn't manage to use it without interrupt (I never read something although my write signal seems to be good on the scope). Then I tried to use SSP with interrupt. Sometimes I can read and erase some bytes and sometimes not.
Moreover, I tested to use the automatic "SSEL" chip select, set by LPC2378. But it seems to deselect between 2 frames and it's not compatible with my serial flash according to the datasheet. So I tried a manual chip select, with a GPIO, between each instruction. Without any success.
Here is my sequence :
Start InitSPIMaster(); // initialize the driver B = SPI_ReadStatus(); SPI_ReadData(0,P1,2); // Read data (2 bytes in P1 array) from address 0 SPI_EraseChip(); SPI_ReadData(0,P1,2); // Read data SPI_WriteEnable(1); // Enable Writes SPI_WriteData(0,P0,2); // Write data (2 bytes from P0 array) in address 0 SPI_ReadData(0,P1,2); // Read data End
Is there something wrong ?
According to me, the SPI initialisation is good, since the 'read status' and 'write' function looks good.
I had to this that I started my work with the 'lpc_ssp.c' and 'lpc_ssp.h' library from C. Strahm (found on web).
Could someone help me please ?
Thank you so much in advance.
Aurelien