SPI+DMA periodic triggering problem encountered

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

SPI+DMA periodic triggering problem encountered

1,485件の閲覧回数
彭冬冬
Contributor I

here is my question:

i intend to use DMA transmit the data from RAM area to SPI_PUSHR, not just single trigger ablity,  i do  follow the instruction of UM ,Page 743, DMA channels with periodic triggering capability , but it just did not work , code is as follows:

DMAMUX_1.CHCFG[0].R = 0x0;// 16 DMA channel 
init_edma_tcd_16();//   16 DMA channel transmit from source (RAM area)to destination(SPI_PUSHR buffer) 128bytes one time
PIT_Init(); //    configure the PIT channel 2 to the corresponding perodic triggers for DMA 
DMAMUX_1.CHCFG[0].R = 0xC3;//   enable  DMA channnel in periodic triggering capability

anyone ever do this function?or any suggestion? accroding to UM , we can  definitly achieve the DMA channel with periodic triggering capability.

タグ(1)
0 件の賞賛
返信
6 返答(返信)

1,210件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I can see you are using TCD16 - DMAMUX_1[0]. That means PIT channel 0 should be used for triggering, not channel 2. Source of peripheral trigger is DSPI_TFFF and the number of this source is 3 but this is not a channel, it's the source.

Could you give this a try?

Regards,

Lukas

0 件の賞賛
返信

1,210件の閲覧回数
彭冬冬
Contributor I

sorry to reply you late!

yes, i agree with you ,i should use the PIT channel 0 , i tried ,but it seems still one time DMA transmit, i dont know why,

finding  some hint ,but i still cant figure this out ,may be i miss some part of configuration, you can see this in details Page 744 from UM.

i  do follow the part of DMA channel with the triggering capabilities.

2. is there any way to trigger DMA transmit mutiply times except the PIT ways?

pastedImage_1.png

3. from the picture ,we can see if we wanna trigger the DMA request mutiply, it need two condition

one is the Trigger ,that is PIT timers , two, meanwhile , there need a Peripheral request when Trigger happened at the this time ,

so i think if  lack a peripheral request when PIT works, but how (now im using SPI TFFF)?

Regards

colin

0 件の賞賛
返信

1,210件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Colin,

if you do not require to send data periodically in given intervals, you do not need to use PIT triggering.

DMA request for SPI transmission is asserted anytime when transmit buffer is not full. You can check this SW example:

https://community.nxp.com/docs/DOC-334012 

It is written for another device and there's no DMA_MUX but it shows DMA settings, at least.

You are supposed to write only one word to PUSHR register per one DMA request. So, NBYTES should be set to 4, CITER and BITER should be number of words you want to send.

If you configure it in this way, I believe it will work (with or without PIT trigger, both should work).

Regards,

Lukas

0 件の賞賛
返信

1,210件の閲覧回数
彭冬冬
Contributor I

Hi, Lukas,

1.actually i wanna use this  DMA function to do the EEPROM data storage, cos it is much faster without CPU interference,

so aim to fill the PUSHUR register with an data array ,  i already reliaze the function of DMA transmit but only one time everytime  power the board up, the problem is how can i trigger the next DMA transmit, cos the data storaged in arry is always changing ,so i need  lanuch another new DMA transmit everytime i update the data in the array, not just once.

2.whether i use the PIT or not ,so what i have to do when i need launch another DMA transmit  if i dont use the PIT triggering 

thanks ,lukas ,sincerely ,i will think about what you said carefully, continue to focus on this question

,

have good day!

Regards

Colin

0 件の賞賛
返信

1,210件の閲覧回数
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

which device is that?

Regards,

Lukas

0 件の賞賛
返信

1,210件の閲覧回数
彭冬冬
Contributor I

hi,

im using the MPC5744 chip

Regards

Colin

0 件の賞賛
返信