Content originally posted in LPCWare by raymond.centek on Fri Jan 20 00:57:43 MST 2012
I also encountered the similar problem.
According to the code at "lpc17xx_pwm.c" version 2.1 (31-3-2011), the method to write one Match Register (void PWM_ConfigMatch()) is write MR and "OR" the corresponding Latch to high.
In my case, when event occured, I need to change two PWM value. The first method I tried is to call "PWM_ConfigMatch" twice only. Using this method sometimes will cause the channel output full power, i.e., always output high. I investigated the registers about PWM when it goes wrong, but the values were what I assigned to.
The second method which I currently use to avoid the problem is using the function "PWM_MultiMatchUpdate" in PWM library. However, I need to assign the array of struct, which I think is an inefficient way to do.
I mentioned the pwm library is because I think if the official library(though I'm not sure if it is really the official library from NXP. I assume it is) use this method as well, the MCU should be support this method.
I want to know if the second method is the only method I can use to avoid the problem, or there is something need to do if I want to use method one.