130
CHAPTER 7 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.
■
PWM compare register (COMR)
Figure 7.3-4 "PWM compare register (COMR)" shows the bit structure of the PWM compare register.
As the register is write-only, bit manipulation instructions cannot be used.
Figure 7.3-4 PWM compare register (COMR)
●
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).
Reference:
The COMR setting for interval timer operation can be calculated using the following formula.
COMR register value = interval time/(count clock cycle x instruction cycle) – 1
●
PWM timer operation
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 PWM 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 PWM 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).
Reference:
In PWM timer operation, the COMR setting and the PWM cycle time can be calculated using the
following formulas.
COMR register value = duty ratio (%) x 256
PWM wave cycle = count clock cycle x instruction cycle x 256
Address
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Initial value
0013
H
XXXXXXXX
B
W
W
W
W
W
W
W
W
W: Write-only
X: Indeterminate
Summary of Contents for MB89950 Series
Page 2: ......
Page 3: ...FUJITSU LIMITED F2MC 8L 8 BIT MICROCONTROLLER MB89950 950A Series HARDWARE MANUAL ...
Page 4: ......
Page 10: ...vi ...
Page 34: ...20 CHAPTER 2 HANDLING DEVICES ...
Page 134: ...120 CHAPTER 6 WATCHDOG TIMER ...
Page 236: ...222 CHAPTER 10 UART ...
Page 276: ...262 CHAPTER 12 LCD CONTROLLER DRIVER ...
Page 310: ...296 APPENDIX ...
Page 311: ...297 INDEX INDEX The index follows on the next page This is listed in alphabetic order ...
Page 316: ...302 INDEX ...
Page 318: ......