
152
2. APPLICAT ION
MITSUBISHI MICROCOMPUTER
3819 Group
2.7 Zero cross detection circuit
3819 Group USER’S MANUAL
2.7.4 Zero cross detection circuit application example 2
Clock count using ZCR interrupt (using a noise filter)
Outline :
The clock is counted up every second by using the ZCR interrupts.
Specifications :
f(X
IN
)=4 MHz
The noise filter (sampling clock : f(X
IN
)/256) is used.
(Pulse less than 64
μ
s is eliminated as a noise.)
The commercial frequency (50 Hz or 60 Hz) is input.
The clock is counted up by using the ZCR interrupts.
Figure 2.7.8 shows a setting of related registers.
Fig. 2.7.8 Setting of related registers [Clock count using ZCR interrupt (using a noise filter)]
ZCR active edge : Falling edge active (
Note
)
INTEDGE
Interrupt edge selection register (Address:3A
16
)
0
IREQ1
Interrupt request register 1 (Address:3C
16
)
Set the INT
1
/ZCR interrupt request bit to “0”
0
ICON1
Interrupt control register 1 (Address:3E
16
)
INT
1
/ZCR interrupt : Enabled
1
IREQ1
Interrupt request register 1 (Address:3C
16
)
ZCR interrupt request
Passing through the zero cross detection circuit (
Note
)
ZCRCON
Zero cross detection control register (Address:39
16
)
1
1 1
Noise filter sampling clock : f(X
IN
)/256
0
Selection of one-sided edge detection
interrupt edge selection register, make sure the following contents.
1. During changeing, set bit 1 of the interrupt control register 1 (disable ZCR interrupt) to “0”.
2. After changeing, set bit 1 of the interrupt request register 1 (no ZCR interrupt request) to “0”.
However, the value of bit 1 of the interrupt request register 1 is changed with a maximum delay
of 2 sampling clocks by using a noise filter. Thus, after changing, set this bit to “0” after a wait
of 2 sampling clocks.
When changing the values of bit 0 of the zero cross detection control register and bit 1 of the