
PWM and CAPTURE
S3C880A/F880A
12-8
Table 12-1. PWM0 and PWM1 Control and Data Registers
Register Name
Mnemonic
Address (Set 1, Bank 0)
Function
PWM0 data registers
PWM0
F4H
8-bit PWM0 basic cycle frame value
PWM0EX
F5H
6-bit extension ("stretch") value
PWM1 data registers
PWM1
F6H
8-bit PWM1 basic cycle frame value
PWM1EX
F7H
6-bit extension ("stretch") value
PWM control register
PWMCON
F8H
PWM0 counter stop/start (resume),
and 3-bit prescaler for CPU clock; also
contains capture A control settings
PWM0 AND PWM1 FUNCTION DESCRIPTION
The PWM output signal toggles to Low level whenever the lower 8-bit counter matches the reference value
stored in the module's data register (PWM0, PWM1). If the value in the PWM data register is not zero, an
overflow of the lower counter causes the PWM output to toggle to High level. In this way, the reference value
written to the data register determines the module's base duty cycle.
The value in the 6-bit extension counter (the lower six bits of the upper counter) is compared with the extension
settings in the 6-bit extension data register (PWM0EX, PWM1EX). This 6-bit extension counter value (bits 2–7),
together with extension logic and the PWM module's extension register, is then used to "stretch" the duty cycle of
the PWM output. The "stretch" value is one extra clock period at specific intervals, or cycles (see Table 12-2).
If, for example, the value in the extension register is '1', the 32nd cycle will be one pulse longer than the other 63
cycles. If the base duty cycle is 50%, the duty of the 32nd cycle will therefore be "stretched" to approximately
51% duty. For example, if you write 80H to the extension register, all odd-numbered pulses will be one cycle
longer. If you write FCH to the extension register, all pulses will be stretched by one cycle except the 64th pulse.
PWM output goes to an output buffer and then to the corresponding PWM0 and PWM1 output pin. In this way,
you can obtain high output resolution at high frequencies.
Table 12-2. PWM Output "Stretch" Values for Extension Registers PWM0EX and PWM1EX
PWM0EX/PWM1EX Bit
"Stretched" Cycle Number
7
1, 3, 5, 7, 9,
…, 55, 57, 59, 61, 63
6
2, 6, 10, 14,
…, 50, 54, 58, 62
5
4, 12, 20,
…, 44, 52, 60
4
8, 24, 40, 56
3
16, 48
2
32
1
Not used
0
Not used