Basic SPI Communication Workflow

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Basic SPI Communication Workflow

1,016 次查看
easter91
Contributor I

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 ?

标签 (2)
标记 (3)
0 项奖励
回复
1 回复

823 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi  Christian Ostermeier,

    Please test the lpcopen code for Embeddedartists eval LPC1788 board directly.

  You can download the lpcopen code from this link:

LPCOpen Software for LPC17XX|NXP 

After it works on your board, you can refer to that code to modify it.

I find you didn't initialize the SPI pin at least.

Wish it helps you!

Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复