Signal generation through PWM + DMA

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

Signal generation through PWM + DMA

1,133 Views
juanpablovega
Contributor I

Hi!

In my project I need to generate a signal, measure it and then analyse it.

Of course, I want the generation and the measurement not to load the CPU.

I've already been able to make the tuple PDB/ADC/DMA work, for the acquisition part. And it's just great.

Now, to generate the signal, I though that something like FTM/DMA/FTM(PWM) would work, but I can't manage to trigger the DMA with the first FTM.

I'm working with the PEx and I'm only using init_xxx components.

As for the FTM, I enabled the clock, the counter, the modulus, the external trigger with CNTIN, but nothing happened. When I say that nothing happened I mean that I never seem to be interrupted by the end of the major loop of the DMA.

As for the DMA, the source muxing is set to FTMx_CHx, and the rest is almost a copy of the other DMA component.

I'm lost... And I'm sure it's a really stupid problem.

Has anyone had any problem related to DMA triggering via the FTM?

Hardware: FRDM K20D50M

Tags (4)
0 Kudos
2 Replies

626 Views
dhruvonline
Contributor III

Hi All,

Could you please post the  PDB/ADC/DMA(processor Expert) working code with K20 Device.

I have to measure the 10 channels continuously using the DMA. Request you to please suggest.

Regds,

Dhruv

0 Kudos

626 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Juan,

I've inculded the sample code base on CW10.4 about FTM+DMA in the reply. I think it should be useful for reference and please refer to it for details.

If you have any other questions, please feel free to contact with me.

Have a nice day!

Best regards,

Ping

0 Kudos