Basic SPI Communication Workflow

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Basic SPI Communication Workflow

1,017件の閲覧回数
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 返信

824件の閲覧回数
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 件の賞賛
返信