Any example/extra info available on linking mcPWM to eDMA ?

Discussion to talk about software related topics only.
Post Reply
fd9750
Posts: 40
Joined: Fri Mar 29, 2013 8:08 am
Location: Belgium

Any example/extra info available on linking mcPWM to eDMA ?

Post by fd9750 »

Hi,

I have posed the same question on the Freescale community forum but I thought It would be worth giving it a go here as well.

After my previous post: "uCOS interfering with timing on MOD54115" I got various suggestions about achieving what I want by linking an mcPWM event to a DMA transfer, both here and on the Freescale community forum.

I fully agree: it is definitely the way to do things.

As suggested I had a look at the PeriodicAD example in the development kit and looked at V3 of the reference of the MCF54418 reference manual.

A lot became clear and setting up the eDMA module is fairly easy and understandable, mainly because of the example. In the reference manual I have found that I need to use and set up DMA channel 57 to link the DMA transfer to a register value match in the mcPWM module.

That is where I get stuck: I have found that to enable the DMA transfer bit VALDE in register PWM_SMnDMAEN needs to be set. What I can't find is how to link the DMA transfer to a particular PWM_SMnVALm register value match.

There is a lot of info on selecting particular capture DMA events (channel 56), equally lots on generating interrupts on particular value register matches and lots of info on setting up "Output triggers" on various value register matches but I can't find any info on setting up DMA events on specific value register matches.

Could it be that I need to use one of the other methods (interrupts/ output triggers) and simply not enable the Interrupts or output trigger links to the internal ADC's ?

Its likely to be a case of "glaringly obvious once pointed out" :oops: but for the moment I can't find it.

Any suggestion very much appreciated.
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: Any example/extra info available on linking mcPWM to eDM

Post by dciliske »

Ouch... I'll sit down and chat with the guy who did our PWM example and have him get me up to speed with that peripheral; maybe then I can figure this one out. Otherwise, it seems like your trying to shove 4 bits into a 1 bit hole.

The only other insight I might have is that it may be that it will always behave the same no matter which of the 4 PWM controllers requests a DMA transfer event, so as long as only one of them is attempting to do so, you're fine.

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
fd9750
Posts: 40
Joined: Fri Mar 29, 2013 8:08 am
Location: Belgium

Re: Any example/extra info available on linking mcPWM to eDM

Post by fd9750 »

Hi,

The answer to the problem has been given by Tom Evans at the Freescale community.

(https://community.freescale.com/message/329194#)

As suspected it is rather obvious once pointed out. :)
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: Any example/extra info available on linking mcPWM to eDM

Post by dciliske »

I was going to post this yesterday, before the server went down, and it's apparently moot now, but... if you look at the 'DMA Requests' section of the mcPWM chapter you'll find the line:
Each submodule can request a DMA read access for its capture FIFOs and a DMA write request for its double-buffered PWM_SMnVALm registers. Due to the limited number of DMA channels available on this device, the DMA requests are OR’d into two read and write requests.
-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
Post Reply