FLEXIO as SPI configuration

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

FLEXIO as SPI configuration

ソリューションへジャンプ
2,002件の閲覧回数
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,280件の閲覧回数
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,280件の閲覧回数
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,280件の閲覧回数
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,279件の閲覧回数
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,281件の閲覧回数
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,280件の閲覧回数
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 件の賞賛