strange tpu pwm problem
"fatih_lokumcu" <[email protected]>
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I have a strange problem. I use the tpu pwm function to
produce a 20 hz pwm which varies between %5 and %10 duty cycles for
servo control.
I have metrowerks mpc5xx edition 8.0 with phycore 565 board.
It works fine between %6 and %10 duty cycles but all of the lower
duty cycle commands lead to a %0 duty cycle. (which has a low time of
250 ns.)
Here is my code:
UINT16 period ;
UINT16 hightime;
struct TPU3_tag *tpub = &TPU_B;
void InitServo(void) {
period = 35000;
hightime = 2232;
tpu_pwm_init(tpua,0,TPU_PRIORITY_HIGH,period,hightime,TPU_PWM_TCR1);
}
when TCR1 is used with PSCK = 0 it it divides the 56 mhz clock by 32
and period value of 35000 makes the wave 20 hz. So to produce the pwm
between 1ms and 2ms duty cycle hightime must be between 3500 and 1750.
The code above works fine until the hightime is set below 2232. I
tried to change the hightime with tpu_pwm_update function but nothing
has changed. There is no scheduling problem since no other tpu
funtion is used.
Also, the same code works with phycore mpc555 (with period = 25000
for 40 mhz of course.) without any problem.
Is there any explaination for this?
Thanks in advance,
Fatih Lokumcu.
-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MPC500/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/