MCXA346 DMA request with ADC

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MCXA346 DMA request with ADC

Jump to solution
944 Views
346500452
Contributor III

你好,

 

        在使用MCX A346 FRAm开发板进行frdmmcxa346_lpadc_edma这个例程运行的时候,有个问题不解。

         为什么在DMA中断里面每次要重新调用EDMA_EnableChannelRequest这个函数,也就是CHn_CSR[ERQ]这个寄存器的值,我看了datasheet里面,也没说这个会自动清零啊?

 

期待回复,谢谢。

Labels (1)
0 Kudos
Reply
1 Solution
880 Views
Celeste_Liu
NXP Employee
NXP Employee

Hello @346500452 ,

感谢在我们的社区中发帖。请检查demo中是否配置了TCDn_CSR[DREQ]。当一次 major loop 传输完成时,如果 DREQ=1,eDMA 会自动禁止该通道的后续请求,表现为把该通道的请求使能关掉(软件上等价于 ERQ 被清掉),随后才产生中断。因此若想继续下一轮采样/搬运,就需要在中断里重新把通道请求使能,也就是再次执行 EDMA_EnableChannelRequest()。

Celeste_Liu_0-1768475960456.png

祝生活愉快。

BR

Celeste

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
1 Reply
881 Views
Celeste_Liu
NXP Employee
NXP Employee

Hello @346500452 ,

感谢在我们的社区中发帖。请检查demo中是否配置了TCDn_CSR[DREQ]。当一次 major loop 传输完成时,如果 DREQ=1,eDMA 会自动禁止该通道的后续请求,表现为把该通道的请求使能关掉(软件上等价于 ERQ 被清掉),随后才产生中断。因此若想继续下一轮采样/搬运,就需要在中断里重新把通道请求使能,也就是再次执行 EDMA_EnableChannelRequest()。

Celeste_Liu_0-1768475960456.png

祝生活愉快。

BR

Celeste

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2292963%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3EMCXA346%20DMA%20request%20with%20ADC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2292963%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CP%3EHello.%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%20%20%20%20%20%20%20%20While%20running%20the%20routine%20frdmmcxa346_lpadc_edma%20with%20the%20MCX%20A346%20FRAm%20development%20board%2C%20there%20is%20a%20problem%20that%20I%20don't%20understand.%3C%2FP%3E%3CP%3E%20%20%20%20%20%20%20%20%20Why%20do%20you%20have%20to%20re-call%20%3CSPAN%3Ethe%20function%20EDMA_EnableChannelRequest%3C%2FSPAN%3E%20every%20time%20inside%20the%20DMA%20interrupt%20%2C%20i.e.%2C%20the%20value%20of%20the%20register%20CHn_CSR%5BERQ%5D%3F%20I%20read%20the%20datasheet%2C%20but%20it%20doesn't%20say%20that%20this%20will%20be%20cleared%20automatically%2C%20right%3F%3C%2FP%3E%3CBR%20%2F%3E%3CP%3ELooking%20forward%20to%20a%20reply%2C%20thanks.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2292963%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EMCXA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2294244%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MCXA346%20DMA%20request%20with%20ADC%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2294244%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%20%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F179561%22%20target%3D%22_blank%22%3E%40346500452%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3EThanks%20for%20posting%20in%20our%20community.%20Please%20check%20if%20TCDn_CSR%5BDREQ%5D%20is%20configured%20in%20the%20demo.%20When%20a%20major%20loop%20transfer%20completes%2C%20if%20DREQ%3D1%2C%20eDMA%20automatically%20disables%20subsequent%20requests%20for%20that%20channel%2C%20which%20is%20manifested%20by%20turning%20off%20the%20request%20enable%20for%20that%20channel%20(software%20equivalent%20to%20ERQ%20being%20cleared)%20before%20generating%20an%20interrupt.%20Therefore%2C%20if%20you%20want%20to%20continue%20the%20next%20round%20of%20sampling%2Fhandling%2C%20you%20need%20to%20re-enable%20the%20channel%20request%20in%20the%20interrupt%2C%20that%20is%2C%20execute%20EDMA_EnableChannelRequest()%20again.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Celeste_Liu_0-1768475960456.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Celeste_Liu_0-1768475960456.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F372956i65725CCCF3720E9A%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Celeste_Liu_0-1768475960456.png%22%20alt%3D%22Celeste_Liu_0-1768475960456.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EHave%20a%20nice%20life.%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3ECeleste%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3E-----------------------------------------------------------------------------------------------------------------------%20%3CBR%20%2F%3ENote%3A%20If%20this%20post%20answers%20your%20question%2C%20please%20click%20the%20%22ACCEPT%20AS%20SOLUTION%20%22%20button.%20Thank%20you!%20%3CBR%20%2F%3E-----------------------------------------------------------------------------------------------------------------------%3C%2FP%3E%3C%2FLINGO-BODY%3E