Fujitsu MB91460 SERIES FR60 User Manual page 788

32-bit microcontroller
Table of Contents

Advertisement

Chapter 37 Output Compare
7.Q & A
7.11 How do I enable interrupts?
Enabling of interrupts is done with interrupt request permission bit (OCS01. ICE[1:0]), (OCS23. ICE[1:0]),
(OCS45. ICE[1:0]), (OCS67. ICE[1:0]).
Interrupt disabled
Enable interrupts
Interrupt requests are cleared with interrupt request bits (OCS01. ICP[1:0]), (OCS23. ICP[1:0]), (OCS45.
ICP[1:0]), (OCS67. ICP[1:0]).
Interrupt request clear
7.12 Compare value calculation procedure
• Toggle output pulse
(Example) To output a period: A, phase difference 1/4 phase pulse
OCU0
OP0
OCU1
OP1
Formula: Compare 0 value = (A/2) / count clock
Compare 1 value = (A/4) / count clock
(Count clock: time set with free-run timer)
Note: To clear free-run timer 2 on compare 0 match setting (TCCS2.MODE="1") and CMOD="0" setting are necessary.
Calculation example: A=1024us, count clock =125ns
• PWM output
(Example) To output a period: A, duty 1/4 - 3/4 ("L") PWM,
OCU1
OP1
1/4-3/4
1/4-3/4
Formula: Compare 0 value = A / count clock
Compare 1 value = (A/4) / count clock (when duty 1/4)
Note: To clear free-run timer 0 on compare 0 match setting (TCCS0.MODE="1") and CMOD="1" setting are necessary.
Calculation example: A=1024us, count clock =125ns
772
Interrupt request permission bit (ICE0, ICE1)
A
A
Phase difference 1/4
1/4
Compare 0 value = (1024000 / 2) / 125 - 1 = 4095 = FFFh
Compare 1 value = (1024000 / 4) / 125 - 1 = 1023 = 7FFh
A
A
(A x 3/4) / count clock (when duty 3/4)
(count clock: time set with free-run timer)
Compare 0 value = 1024000 / 125 - 1 = 8191 = 1FFFh
Compare 1 value = (1024000 / 4) / 125 - 1 = 1023 = 7FFh (when duty 1/4)
(1024000 x 3 / 4) / 125 - 1 = 1023 = BFFh (when duty 3/4)
Set to "0"
Set to "1"
Interrupt request bit (ICP0, ICP1)
Write "0"

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fr60Mb91460 series

Table of Contents