Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

PWM glitch

2004-08-20 by douglasbolton

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 Doug

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.