
ML610Q421/ML610Q422/ML610421 User’s Manual
Chapter 11 PWM
11 – 8
11.3 Description of Operation
The PWM0 counter registers (PW0CH, PW0CL) are set to an operating state (P0STAT is set to “1”) on the first falling
edge of the PWM clock (P0CK) that are selected by the PWM0 control register 0 (PW0CON0) when the P0RUN bit of
PWM0 control register 1 (PW0CON1) is set to “1” and increment the count value on the 2nd falling edge.
When the count value of PWM0 counter registers and the value of the PWM0 duty buffer (PW0DBUF) coincide, the
PWM flag (P0FLG) is set to “0” on the next timer clock falling edge of P0CK.
When the count value of PWM0 counter registers and the value of the PWM0 period buffer (PW0PBUF) coincide, the
PWM flag (P0FLG) is set to “1” on the next falling edge of P0CK and PWM0 counter registers is set to “0000H” and
incremental counting continues. At the same time, the value of the PWM0 duty register (PW0DH, PW0DL) is
transferred to the PWM0 duty buffer (PW0DBUF) and the value of PWM0 period register (PW0PH, PW0PL) to the
PWM0 period buffer (PW0PBUF).
When the P0RUN bit is set to “0”, PWM0 counter registers stop counting after counting once the falling of the PWM
clock (P0CK). Confirm that PW0CH and PW0CL are stopped by checking that the PnSTAT bit of the PWM0 control
register 1 (PW0CON1) is “0”. When the P0RUN bit is set to “1” again, PWM0 counter registers restarts incremental
counting from the previous value on the falling edge of P0CK.
To initialize PWM0 counter registers to “0000H”, perform write operation in either of PW0CH or PW0CL. At that time,
P0FLG is also set to “1”. When data is written in the PWM0 duty register (PW0DH, PW0DL) during count stop
(P0RUN is in a “1” state), the data is transferred to the PWM0 duty buffer (PW0DBUF) and when data is written in the
PWM0 period register (PW0PH, PW0PL), the data is transferred to the PWM0 period buffer (PW0PBUF).
The PWM clock, the point at which an interrupt of PWM0 occurs, and the logic of the PWM output are selected by
PWM0 control register 0 (PW0CN0).
The period of the PWM0 signal (TPWP) and the first half duration (TPWD) of the duty are expressed by the following
equations.
T
PWP
=
PW0P + 1
P0CK (Hz)
T
PWP
=
PW0D + 1
P0CK (Hz)
PW0P:
PWM0 period registers (PW0PH, PW0PL) setting value (0001H to 0FFFFH)
PW0D:
PWM0 duty registers (PW0DH, PW0DL) setting value (0000H to 0FFFEH)
P0CK:
Clock frequency selected by the PWM0 control register 0 (PW0CON0)
Содержание ML610421
Страница 1: ...ML610Q421 ML610Q422 ML610421 User s Manual Issue Date Feb 9 2015 FEUL610Q421 06...
Страница 15: ...Chapter 1 Overview...
Страница 44: ...Chapter 2 CPU and Memory Space...
Страница 49: ...Chapter 3 Reset Function...
Страница 53: ...Chapter 4 MCU Control Function...
Страница 69: ...Chapter 5 Interrupts INTs...
Страница 93: ...Chapter 6 Clock Generation Circuit...
Страница 110: ...Chapter 7 Time Base Counter...
Страница 121: ...Chapter 8 Capture...
Страница 129: ...Chapter 9 1 kHz Timer 1kHzTM...
Страница 135: ...Chapter 10 Timers...
Страница 160: ...Chapter 11 PWM...
Страница 172: ...Chapter 12 Watchdog Timer...
Страница 180: ...Chapter 13 Synchronous Serial Port...
Страница 195: ...Chapter 14 UART...
Страница 216: ...Chapter 15 I2 C Bus Interface...
Страница 231: ...Chapter 16 NMI Pin...
Страница 237: ...Chapter 17 Port 0...
Страница 246: ...Chapter 18 Port 1...
Страница 252: ...Chapter 19 Port 2...
Страница 259: ...Chapter 20 Port 3...
Страница 270: ...Chapter 21 Port 4...
Страница 282: ...Chapter 22 Port A...
Страница 290: ...Chapter 23 Melody Driver...
Страница 304: ...Chapter 24 RC Oscillation Type A D Converter...
Страница 327: ...Chapter 25 Successive Approximation Type A D Converter...
Страница 338: ...Chapter 26 LCD Drivers...
Страница 371: ...Chapter 27 Battery Level Detector...
Страница 378: ...Chapter 28 Power Supply Circuit...
Страница 381: ...Chapter 29 On Chip Debug Function...
Страница 384: ...Appendixes...
Страница 435: ...Revision History...