Figure 7.3.2 Pwm Compare Register (Comr) - Fujitsu F2MC-8L MB89620 Series Hardware Manual

8-bit microcontroller
Table of Contents

Advertisement

7.3 Structure of 8-bit PWM Timer
7.3.2 PWM Compare Register (COMR)
The PWM compare register (COMR) sets the interval time for the interval timer
function. The register value sets the "H" width of the pulse for the PWM timer function.
n PWM Compare Register (COMR)
Figure 7.3.2 shows the bit structure of the PWM compare register.
As the register is write-only, bit manipulation instructions cannot be used.
W: Write-only
X: Indeterminate
l
Interval timer operation
This register is used to set the value to be compared with the counter value. The register
specifies the interval time.
The counter is cleared when the counter value matches the value set in this register, and the
interrupt request flag bit is set to "1" (CNTR: TIR = "1").
If data is written to the COMR register during counter operation, the new value applies from the
next cycle (after the next match is detected).
Note: The setting value of the COMR register during the interval timer operation (when the instruction
cycle is the divide-by-four source oscillation (4/F
PWM timer operation
l
This register is used to set the value to be compared with the counter value. The register
therefore sets the "H" width of the pulse.
The PTO pin outputs an "H" level until the counter value matches the value set in this register.
From the match until the counter value overflows, the PTO pin outputs an "L" level.
If data is written to the COMR register during counter operation, the new value applies from the
next cycle (after the next overflow).
Note: The setting value of the COMR register during the PWM timer operation (when the instruction cycle
is the divide-by-four source oscillation (4/F
146
CHAPTER 7 8-BIT PWM TIMER
Address
Bit 7
Bit 6
0013
H
W
W

Figure 7.3.2 PWM Compare Register (COMR)

COMR register value = interval time/(count clock cycle × instruction cycle) – 1
COMR register value = duty ratio (%) × 256
PWM wave cycle = count clock cycle × instruction cycle × 256
Bit 5
Bit 4
Bit 3
Bit 2
W
W
W
W
)) is calculated as follows:
C
)) is calculated as follows:
C
Bit 1
Bit 0
Initial value
XXXXXXXX
W
W
MB89620 series
B

Advertisement

Table of Contents
loading

Table of Contents