RT1052 : How to configure standard GPIO as SPI CS ?

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

RT1052 : How to configure standard GPIO as SPI CS ?

885 次查看
join_ren
Contributor III

RT1052 : How to configure standard GPIO as SPI CS ?

0 项奖励
2 回复数

754 次查看
richardmensah
Contributor II

First You may have to check the datasheet of the MCU to confirm if the particular pin of interest has SPI_CS capability. if it does, then use the PORT Control Module PCM to select the correct ALT function. In that case, when you begin an SPI transaction, the SPI module will itself manage the assertion and desertion of the Cs pin.  However, You can use a standard GPIO as SPI_Cs. Just configure it as GPIO_output pin. In this case, the responsibility of asserting the pin and deserting the pin lies on you.

0 项奖励

754 次查看
bjrajendra
Senior Contributor I

Hi Richard,

 

I'm using S32K144 device where I would like to assert a PIN along with CS after transferring all bits .

 

Also, I can't use the TRGMUX inputs since the port I want to assert is not connected to TRGMUX inputs. 

I also tried waitng till 

while((LPSPI0->SR & LPSPI_SR_FCF_MASK)>>LPSPI_SR_FCF_SHIFT==0) {}

but, stranges the FCF flag will set immeadiately after writing the data into the tranmit buffer though theCS still holds the LOW.

 

Kindly help in this regard,

 

Raju

0 项奖励