NuMicro™ Mini51 Technical Reference ManualFeb 9, 2012 Page 199 of 342 Revision V1.03NUMICRO™ MINI51 TECHNICAL REFERENCE MANUALCenter-Aligned PWM (up/down counter)The center-aligned PWM signals are produced by the module when the PWM time base isconfigured in an Up/Down Counting mode. The PWM counter will start counting-up from 0 tomatch the value of CMRn (old); this will cause the toggling of the PWMn generator output to high.The counter will continue counting to match with the CNRn (old). Upon reaching this statescounter is configured automatically to down counting, when PWM counter matches the CMRn(old) value again the PWMn generator output toggles to low. Once the PWM counter underflows itwill update the PWM period register CNRn (new) and duty cycle register CMRn (new) withCHnMODE = 1.In Center-aligned mode, the PWM period interrupt is requested at down-counter underflow ifINT_TYPE (PIER[17]) =0, i.e. at start (end) of each PWM cycle or at up-counter matching withCNRn if INT_TYPE (PIER[17]) =1, i.e. at center point of PWM cycle.Figure 5.10-11, Figure 5.10-12 and Figure 5.10-13 describe the Center-aligned PWM timing andoperation flow.CNRn (new)CMRn (old)CNRn (old)CMRn (new)New Duty CyclePWM period New PWM periodNew CMRn is written New CNRn is writtenIf 16-bit PWM up/down counter underflows1. Update new duty cycle register (CMRn) if CHnMODE = 12. Update new period cycle register (CNRn) if CHnMODE = 1PWM periodPWMn generator ouput16-bit PWM counterFigure 5.10-11 Center-aligned Mode