SPI Problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI Problem

233 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by andersonf on Wed May 11 11:35:47 MST 2011
Hello,

I am programming for the ARM LPC1343 SPI communication and am having problems.
I used the example of NPX for SPI.
By placing the oscilloscope on pin 2.11 (SCLK) voltage is only 350mV.
There is a "clock"very bad .. are sequences of peaks and then stays low ...
happens again this sequence, up to half of these peaks seems that the distance of one and one equals ... but then stays the same.
I tried putting greater 4,8,10 prescaler to reduce the frequency and check if "noise" would diminish .. but to no avail.
Could someone help me solve this problem?

Thanks!
0 Kudos
1 Reply

207 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu May 12 06:15:18 MST 2011
Which sample are we talking about?

My lpcxpresso_3.6/Examples/NXP/LPC1000/LPC13xx/examples.lpc13xx.new.zip->ssp sample

is producing a nice clock signal at P2.11 if I add a simple write loop in main of ssptest.c:

int main (void)
{
  uint32_t i;
  SSPInit();            // initialize SSP port, share pins with SPI0
  for ( i = 0; i < SSP_BUFSIZE; i++ )
  {
    src_addr = (uint8_t)i;
    dest_addr = 0;
  }
  while(1)
  {
   SSPSend( (uint8_t *)src_addr, SSP_BUFSIZE);
  }
  return 0;
}
Frequency: 2.25 MHz (as expected)

I can change it without problems with:

LPC_SYSCON->SSPCLKDIV = 0x01;            // Divided by 1
LPC_SSP->CR0 = 0x0007;                               //SCR 0

to 36 MHz (=max speed @ 72MHz clock).
0 Kudos