SSP using Keil/NXP SSP Example

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

SSP using Keil/NXP SSP Example

443 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by John@MPL on Tue Jan 28 09:45:04 MST 2014
Re: SSP Sample Code on LPC11Axx

I have loaded sample code for the SSP onto a LPC11A14FHN33/301

I have configured the code in loopback mode and linked MISO-1 and MOSI-1

I cannot appear to get any clocks from SClk after Reset.

Some of the GPIO set up does not apply to the 33 pin device.

I am unclear on the SSEL signal and the use.

I would be grateful for any information on the set up.

Regards

John W.

Labels (1)
0 Kudos
2 Replies

398 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by John@MPL on Sat Feb 08 10:36:58 MST 2014
Re:- LPC11A14 33 pin.

I have set up the Demo code for using loopback and works OK if I increment say dest_addr[x] an error occures.

I have switched to TX_RX_ONLY  = 1 and USE_CS = 1. and using SSP_NUM = 1

In SSP_Init I have set  LPC_SSP1->CR0 = 0x070f;    // 16 bit transfer and changed all 8bit refences to 16bit

I can send data to a DAC OK but  cannot receive from SPI device.

I can see the CS_ toggle and load data out to the MISO Input.

In MAIN my code is:-
                                 GPIOSetBitValue( PORT0, 4, 1 ); // Enable Gate to SPI device

  for ( x = 0; x < 100; x++ );// Allow to settle

  SSP_Receive( SSP_NUM, (uint16_t *)dest_addr16, 1 );  // Set one word into buffer

for ( x = 0; x < 100; x++ );// Short delay

GPIOSetBitValue( PORT0, 4, 0 ); // Disable Gate to SPI Device


src_addr16[0] = dest_addr16[0];       // Put received data into src_addr16 to send to DAC

                                 // if I do scr_addr16[0]  =  0x1800;   // DAC and has correct value with a range from 0x0000 to 0x3fff


GPIOSetBitValue( PORT0, 26, 1 ); // Enable DAC Output


SSP_Send( SSP_NUM, (uint16_t *)src_addr16, 1);


GPIOSetBitValue( PORT0, 26, 0 ); // Disable DAC Output

I do not appear to get the correct value from dest_addr16[0]
The SSP_Send and Receives are as is.

Any help would be appreciated.

regards John W.
0 Kudos

398 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by John@MPL on Fri Jan 31 02:20:21 MST 2014
Re Sample Code.

I have replaced the LPC14Axx and the SPI now works OK.

Regards,

John W
0 Kudos