AnsweredAssumed Answered

Help with PWM and DMA.

Question asked by AITOR ARANZABAL on Sep 20, 2018

Hello all,


I need some help with DMA. I read a lot of examples and application notes, but I am not able to make my firmware work. I am working with TWR-K64 board and Kinetis KDS v3.2.0 with Processor Expert (no SDK). I would really appreciate your help.

The background is as follows:

  • Please find attached a hand made simple schematic.
  • There is an external ADC with a parallel digital output, connected to the PORTC of the microcontroller.
  • The ADC gives a conversion in every rising edge of the clock input.
  • Pin PTD5 of the microcontroller is connected to the external ADC clock, and I create a clock signal through the PWM (Please, find attached PWM.png).
  • PTD5 pin is configured as a DMA request in every rising edge (Please, find attached PTD5 init.png)
  • DMA is configured to read the information of PORTC and write it down in an array[]. In this example, DMA is configured to be finished after 8 ADC conversions (Please, find attached DMA.png and DMA_MUX.png).


At this beginning, I am working only with the TWR-K64 board without the external ADC (so I assume that PORTC always will be zero as the external ADC is not connected). The PTD5 pin and Yellow led are displayed in the oscilloscope.

When tact switch SW3 (from TWR-K64) is pushed, the led turns on and the PWM starts, and both should come off after 8 PWM periods in the event  “DMACH1_OnComplete” 


However it does not work. Please find attached the project in case somebody could have a look. 


Thank you in advance.