AnsweredAssumed Answered

S32K144 SPI ISSUE

Question asked by Ravi Ranjan Kumar on May 30, 2017
Latest reply on Oct 6, 2017 by Esaias Pech

Hi,

I am working on SPI Driver in S32k144 EVB. I want to write data in EEPROM (M95320) which supports SPI communication. We already worked on this EEPROM with other controller. We ported same code into S32k144. I am using S32K SPI example code. I am using PCS3 pin for chip select. The data is not writing into EEPROM, even it is not showing in TDR register also.

 

This is the code how I intialize the Master Communication

 

void LPSPI1_init_master(void)

{
      PCC->PCCn[PCC_LPSPI1_INDEX] = 0; 
      PCC->PCCn[PCC_LPSPI1_INDEX] = 0xC6000000; 

      LPSPI1->CR = 0x00000000; 
      LPSPI1->IER = 0x00000000; 
      LPSPI1->DER = 0x00000000;
      LPSPI1->CFGR0 = 0x00000000;

      LPSPI1->CFGR1 = 0x00000001;

      LPSPI1->TCR = 0x5300000F; 

      LPSPI1->CCR = 0x04090808;

      LPSPI1->FCR = 0x00000003; 

      LPSPI1->CR = 0x00000009; 
}

 

I am configuring SIN in Input Mode, SOUT in Output Mode, SCK in Output Mode, PCS3 in Ouptut.

 

Anyone please help me as soon as possible.

 

Thanks & Regards,

Ravi Ranjan 

Outcomes