AnsweredAssumed Answered

Basic SPI Communication Workflow

Question asked by Christian Ostermeier on Jan 19, 2017
Latest reply on Jan 20, 2017 by Kerry Zhou

Hi there,

 

i am using a LPC1788 on the EmbeddedArtists Eval Board and would like to communicate other devices via SPI.

After including the lpc177x_8x_ssp library i am using the following code to initialise :

 

SSP_CFG_Type SSP_ConfigStruct;
SSP_ConfigStruct.CPHA = SSP_CPHA_FIRST;
SSP_ConfigStruct.CPOL = SSP_CPOL_HI;
SSP_ConfigStruct.ClockRate = 1000000;
SSP_ConfigStruct.Mode = SSP_MASTER_MODE;
SSP_ConfigStruct.FrameFormat = SSP_FRAME_SPI;
SSP_ConfigStruct.Databit = SSP_DATABIT_8;

 

SSP_Init(LPC_SSP0,&SSP_ConfigStruct);
SSP_Cmd(LPC_SSP0,ENABLE);

 

In the main loop i try to do :

 

SSP_SendData(LPC_SSP0,0x05);

 

Using  a scope i can not see any pulses on the clock line.

 

 

 

What am i missing here ? Can someone point out the basic syntax to read and write a register from/to a SPI-device for me ?

 

 

 

Outcomes