I'm running 4 pwm channels in single edge operation. I am sometimes
not getting the shadow register latched into the match registers. If
I use the following code I sometimes get a glitch where the latch
register doesn't cause the the value to get loaded into the match
register.
void LPC210xSetPwm1(uint16_t PwmValue)
{
PWMMR1 = PwmValue;
PWMLER = 0x0002;
}
void LPC210xSetPwm2(uint16_t PwmValue)
{
PWMMR2 = PwmValue;
PWMLER = 0x0004;
}
etc
If I use the following code to latch all 4 pwm shadow registers
instead of individual I never get a glitch.
void LPC210xSetPwm1(uint16_t PwmValue)
{
PWMMR1 = PwmValue;
PWMLER = 0x002e;
}
void LPC210xSetPwm2(uint16_t PwmValue)
{
PWMMR2 = PwmValue;
PWMLER = 0x002e;
}
etc
Has anybody had similiar problems or got and explanation.
regards DougMessage
PWM glitch
2004-08-20 by douglasbolton
Attachments
- No local attachments were found for this message.