FLEXIO as SPI configuration

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

FLEXIO as SPI configuration

跳至解决方案
2,385 次查看
gschelotto
Contributor V

Hi,

I'm evaluating FLEXIO as SPI using SDK v3.2.1 on a FRDM-KL27Z. Basically I'd need to solve 2 things:

  • Set the CLK Polarity Active Low, not High as provided in the frdmkl27z_driver_examples_flexio_flexio_spi_int_spi_transfer_master
  • Disable CS assertion by the driver. I need to set/clear the CS manually. Similar way than the output mode configuration (kSPI_SlaveSelectAsGpio) in the SPI driver.

How can I do to accomplish these points?

regards,

gaston

0 项奖励
回复
1 解答
1,663 次查看
gerardo_rodriguez
NXP Employee
NXP Employee

Hi Gaston,

Yes, the FlexIO SPI driver must be modified to invert the clock polarity.

Unfortunately, I don't know if this feature will be implemented in future versions of the SDK.

Regards,

在原帖中查看解决方案

0 项奖励
回复
5 回复数
1,663 次查看
HeMyFAE
NXP Employee
NXP Employee

HI Gerardo,

Can you check with the SDK team on whether we have implemented FlexIO SPI driver with the ability to invert the clock polarity for i.xm RT 10xx?

Regards,

hy

0 项奖励
回复
1,663 次查看
gerardo_rodriguez
NXP Employee
NXP Employee

Hello Gaston,

The FlexIO SPI driver doesn't support CPOL=1 (idle high), but as mentioned in the KL27P64M48SF2RM, you can manually change the pin polarity of the timer used for SCK generation to support this:

pastedImage_1.png

In FLEXIO_SPI_MasterInit(): 

    /*3. Configure the timer 0 for SCK. */
    timerConfig.triggerSelect = FLEXIO_TIMER_TRIGGER_SEL_SHIFTnSTAT(base->shifterIndex[0]);
    timerConfig.triggerPolarity = kFLEXIO_TimerTriggerPolarityActiveLow;
    timerConfig.triggerSource = kFLEXIO_TimerTriggerSourceInternal;
    timerConfig.pinConfig = kFLEXIO_PinConfigOutput;
    timerConfig.pinSelect = base->SCKPinIndex;
//    timerConfig.pinPolarity = kFLEXIO_PinActiveHigh;
    timerConfig.pinPolarity = kFLEXIO_PinActiveLow;

About the CS pin, you can manually change the pin muxing to GPIO instead of the FlexIO so you can manually control it. 

Regards,

Gerardo

0 项奖励
回复
1,662 次查看
gschelotto
Contributor V

Hi Gerardo,

Thanks for replying. I assume I have to modify the FlexIO SPI driver in order to change the pin polarity of the timer. Will this feature be implemented in the next SDK version?

regards,

gaston

0 项奖励
回复
1,664 次查看
gerardo_rodriguez
NXP Employee
NXP Employee

Hi Gaston,

Yes, the FlexIO SPI driver must be modified to invert the clock polarity.

Unfortunately, I don't know if this feature will be implemented in future versions of the SDK.

Regards,

0 项奖励
回复
1,663 次查看
gschelotto
Contributor V

Please could someone give me some feedback? I thought I could use an extra SPI interface without constraints but I don't know how to do it.

https://community.nxp.com/thread/471557 

regards,

gaston

0 项奖励
回复