Page 1 of 1

pwm

Posted: Fri Mar 25, 2011 7:36 am
by GreenE
Hey Guys,
I am working on an application which involves controlling a valve with PWM signal. The " MOD5213PWMdemo" example was helpful as far as learning about pwm registers. Are there any other examples available for mod5213?

Re: pwm

Posted: Fri Mar 25, 2011 12:52 pm
by Ridgeglider

Re: pwm

Posted: Fri Mar 25, 2011 1:52 pm
by joepasquariello
GreenE,

I posted a 5213 PWM test program to the application forum.

It's a PWM test program I wrote for the MOD5213 a couple of years ago. It configures PWM output on PWM0 and counts pulses on DTIN3. The function for setting up PWM0 is general enough to allow setting clock frequency, PWM periods, and duty cycles, but it's up to you to choose values that "make sense". The example shown should give you a good start.

When setting register bits, I use the macros in FreeScale's standard header files for the 5213. You can download them from FreeScale by searching for "MCF5213 header files". I just put all of headers into the MOD5213\Include folder, and since that's in the standard include search path, you don't have to change any settings in your NBE project.

Let us know if it's helpful.

Joe