Forums

Re: Possible race condition when writing to PWMLER

Started by reallygene April 15, 2007
--- In l..., Tom Walsh wrote:
>
> reallygene wrote:
> >
> > Greetings.
> >
> > I have an application running on the LPC2210 that uses several PWM
> > outputs. I found that often, I would write a new match value to a
> > particular PWM, and set its latch enable bit, but the PWM output would
> > NOT change.
> >
> > After an hour of investigation, I believe I have discovered the cause;
> > that setting any particular bit in the PWM Latch Enable Register
> > PWMLER will CLEAR any other bits present in PWMLER, preventing those
> > match registers from updating.
> > Just a suggestion, I just went through an episode with the LPC2214
where
> I had to read VPBDIV twice to get the value. The first read would come
> back as a zero, the second would give the real value. Also, EXTMODE
and
> EXTPOLAR are really really borked! Maybe something, too, with the PWM
> where you may have to double-read?
>
> There is some errata on the LPC22xx PWM MATCH / COMPARE. You may wish
> to review that?
>
> Regards,
>
> TomW

I started with the published errata. For the PWM, the only one
involves capture/match interrupts, not the latching of of the match
value...

--Gene

An Engineer's Guide to the LPC2100 Series