S32K312 SPI+DMA

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

S32K312 SPI+DMA

跳至解决方案
962 次查看
sergiverdaguerelausa
Contributor II

Hi all,

I have an SPI working at 4.8bps using DMA. The issue is that during transmission, gaps of 3.3us appear between bytes:

sergiverdaguerelausa_0-1690802553552.png

 

 

 

The SPI clock should work at 80MHz, and the DMA at 160MHz, so I don't understand why this delay appears between bytes.

Configuration:

sergiverdaguerelausa_1-1690802553571.png

 

sergiverdaguerelausa_2-1690802553580.png

 

sergiverdaguerelausa_3-1690802553603.png

 

sergiverdaguerelausa_4-1690802553641.png

Code:

/* Initalized clock */
Clock_Ip_Init(&Clock_Ip_aClockConfig[0]);

/* Initalized pin */
Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);
/* Initialize interrupt */
IntCtrl_Ip_Init(&IntCtrlConfig_0);
IntCtrl_Ip_ConfigIrqRouting(&intRouteConfig);

/* Initialize DMA IP} Driver */
(void)Dma_Ip_Init(&Dma_Ip_xDmaInitPB);

/* Initalized spi using instance lpspi as a spi master */
Lpspi_Ip_Init(&Lpspi_Ip_PhyUnitConfig_SpiPhyUnit_0_Instance_0_BOARD_InitPeripherals);

/* Master transmits data by async method with DMA */
Lpspi_Ip_AsyncTransmit(&MASTER_EXTERNAL_DEVICE, u8_frame_reset, NULL, sizeof(u8_frame_reset), spi_callback);

 

I am using S32K312EVB-Q17

Thank you in advance!

 

Sergi

 

0 项奖励
回复
1 解答
935 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Sergi,

Would you please decrease the value of SpiTimeClk2Cs SpiTimeCs2Clk SpiTimeCs2Cs and measure the waveform again?

SpiTimeClk2Cs SpiTimeCs2Clk SpiTimeCs2Cs.png

If still not work, please let me know the version of S32DS\S32K3 RTD, or attached your test project.


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
2 回复数
936 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Sergi,

Would you please decrease the value of SpiTimeClk2Cs SpiTimeCs2Clk SpiTimeCs2Cs and measure the waveform again?

SpiTimeClk2Cs SpiTimeCs2Clk SpiTimeCs2Cs.png

If still not work, please let me know the version of S32DS\S32K3 RTD, or attached your test project.


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复
919 次查看
sergiverdaguerelausa
Contributor II

Hi Robin,

 

Thank you very much. I attach an screenshot with the new timmings:

sergiverdaguerelausa_0-1690868811570.png

And the new configuration:

sergiverdaguerelausa_1-1690868849815.png

Now works as I expected.

 

Bes regards,

 

Sergi

 

 

0 项奖励
回复