PWM trigger DMA

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

PWM trigger DMA

892 Views
phuongly1
Contributor I

Hi,

I am using MIMXRT1052. I generated pwm output signals by either flexPwm or by Quarter Timer. I want to use the rising or falling edge of this pwm signal to trigger DMA that reads data from the existing source then writes the data to gpio output pin. I read the MIMXRT1050 reference manual but I could not find the right registers to do this. Please help.

Thank you.

0 Kudos
2 Replies

730 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Phuong,

You can try to use QTMR. There is a demo called evkbimxrt1050_qtmr_inputcapture_outputpwm_dma. You can find it in SDK_2.5.0_EVKB-IMXRT1050\boards\evkbimxrt1050\driver_examples\qtmr\inputcapture_outputpwm_dma.

It shows 2 function of QTMR. One is capture, the other is pwm. In the pwm part, it use DMA to fill CMPLD register. You can also use it to move data from existing source to destination register.

EDMA_PrepareTransfer(

                            &transferConfig,

                             (uint16_t *)&g_Cmpld1Value,    //source data address

                             2,                                                // width

                             (uint16_t *)&BOARD_QTMR_BASEADDR->CHANNEL[BOARD_QTMR_PWM_CHANNEL].CMPLD1, //destination data address

                             2,

                             2,

                             2,
                             kEDMA_MemoryToPeripheral);

Regards,

Jing

0 Kudos

731 Views
phuongly1
Contributor I

Thank you for replying my question. Your suggestion is not what I want to do. I would like to use pwm wave form to trigger DMA on every rising or falling edge. Actually, I found the solution on XBARA. I could pass my flexPWM or quart timer to XBARA as input then output to DMA base on rising or falling edge of my signal. Everything is working as I expected now.

Thank you

0 Kudos