I'm using SSP0 in 1768 to interface a serial SPI Flash memory. Pin SSEL0 is driven as a normal GPIO.
It works with lower clock frequencies (32MHz), but it doesn't work with higher frequencies (48MHz).
It seems I read data from the serial Flash shifted off by one bit when the frequency is high. I expect 0x4C51 (0100 1100 0101 0001), but I obtain 0xA6A8 (1010 0110 1010 1000).
I'm using serial Flash SST26VF064B from Microchip. I'm usign HIGH-SPEED READ command (0x0B) that should be possible to use at 48MHz.
Even if there's a FAQ here that says:
The maximum frequency of the SPI/SSP pins is 50MHz. Higher frequencies will affect the signal integrity of output.
This is in contrast with the datasheet that says 33Mbit/s.
I think the problem is in the maximum frequency compatible with SSP peripheral in LPC1768.
In the Product Datasheet of LPC1768 (here), in chapter 12.7 "SSP interface", I see the following sentence:
The maximum SSP speed is 33 Mbit/s in master mode
It seems it is the maximum bitclock frequency of SCK signal. This explains why my code works at 24MHz, but not at 48MHz.
The SSP bitclock is CCLK/PCLK_SSP0 /(SCR+1)/CPSDVSR, where:
Is there a maximum value for the SSP peripheral clock (i.e., CCLK/PCLK_SSP0)?
To obtain 24MHz bitclock I need to divide CCLK=96MHz by 4. Two possibilities are possible:
Another question. I could use SPI peripheral instead of SSP0. It seems a completely different peripheral that is always compatible with SPI bus. What is the maximum frequency clock for SPI peripheral? Are there any differences between SPI and SSP0 regarding maximum clock frequencies?
Hi Giuseppe Modugno,
Before answer the question, I was wondering if you can share the demo code and a screenshot which illustrates the wave of the communication between the SST26VF064B and LPC1768.
I'm looking forward to your reply.