AnsweredAssumed Answered

Suggestion of chagnes in sct_pwm.c o LPCOpen

Question asked by Jeremy Hsiao on Jan 14, 2019
Latest reply on Jan 16, 2019 by jeremyzhou

Hi,

 

After study PWM example code of LPCOpen 3.0.3 for LPC11U68, it is recommended that some of the value should be updated to avoid confusion. Yes, the function performed as expected but the register setting weren't consistent with  description on comments.

 

in sct_pwm.c (line 124)

 

/* Setup match counter 0 for the number of ticks in a PWM sweep, event 0
will be used with the match 0 count to reset the counter. */
LPC_SCT1->MATCH[0].U = cycleTicks;
LPC_SCT1->MATCHREL[0].U = cycleTicks;
LPC_SCT1->EVENT[0].CTRL = 0x00001000;      // ==> suggested to be (1 << 12)
LPC_SCT1->EVENT[0].STATE = 0xFFFFFFFF;   // ==> suggested to be "1" for stateless (ref: 18.6.23 of UM10732)
LPC_SCT1->LIMIT_L = (1 << 0);

 

(line 181)

/* Don't use states */
LPC_SCT1->STATE_L = 0;                                    // So this is a stateless example

Outcomes