MOD5234 eTPU PWM function fails to produce requested pulse

Discussion to talk about software related topics only.
Post Reply
cbyrne
Posts: 23
Joined: Thu Jun 10, 2010 1:30 pm

MOD5234 eTPU PWM function fails to produce requested pulse

Post by cbyrne »

The eTPU on the 5234 has a Pulse Width Modulator function. We are having a little trouble achieving the pulse with parameters we need. What could be the problem?

We are trying to produce a 20Hz pulse with 50% duty cycle with the eTPU on a MOD5234. When we call with the following parameters, an Oscilloscope shows a 20Hz pulse with a 3.2% duty cycle (the parameter 5000 specifies a 50.00% duty cycle):
fs_etpu_pwm_init (5,
FS_ETPU_PRIORITY_HIGH,
20,
5000,
FS_ETPU_PWM_ACTIVEHIGH,
FS_ETPU_TCR1,
etpu_a_tcr1_freq);

However when we change the frequency from 20Hz to 1000Hz, the scope does show a 1000Hz frequency with 50% duty cycle as requested:

fs_etpu_pwm_init (5,
FS_ETPU_PRIORITY_HIGH,
1000,
5000,
FS_ETPU_PWM_ACTIVEHIGH,
FS_ETPU_TCR1,
etpu_a_tcr1_freq);

The Freescale app note AN2849 for the eTPU PWM function advertises a supportedrange of 1Hz to 100KHz. The function does not return an error when called with 20Hz frequency.

Anyone have experience with this particular function?

Thanks
fanat9
Posts: 56
Joined: Thu Apr 24, 2008 4:23 pm
Location: Boston
Contact:

Re: MOD5234 eTPU PWM function fails to produce requested pulse

Post by fanat9 »

FS_ETPU_TCR1 is high frequency one. Try FS_ETPU_TCR2.
cbyrne
Posts: 23
Joined: Thu Jun 10, 2010 1:30 pm

Re: MOD5234 eTPU PWM function fails to produce requested pulse

Post by cbyrne »

Yes, that did the trick. Thanks.
Post Reply