Panasonic F77G Cell Phone User Manual


 
III - 55
Chapter 3 Interrupts
External Interrupts
AC Zero-Cross Detector Setup Example (External interrupt 1)
AC zero-cross detector generates the external interrupt 1 (IRQ1) by using P21/ACZ pin.
An example setup procedure, with a description of each step is shown below.
(1) Set the P21IM flag of the noise filter control
register (NFCTR0) to "1" to select the AC
zero-cross detector signal as the external
interrupt 1 generation factor.
(2) Set the interrupt level by the IRQ1LV 1-0
flag of the IRQ1ICR register.
If the interrupt request flag has been already
set, clear the interrupt flag.
[ Chapter 3 3-1-4. Interrupt flag setup ]
(3) Set the IRQ1IE flag of the IRQ1ICR register to
"1" to enable the interrupt.
Setup Procedure
(1) Select the AC zero-cross detector
signal.
NFCTR0 (x'3F8E')
bp7 : P21IM = 1
(2) Set the interrupt level.
IRQ1ICR (x'3FE3')
bp7-6 : IRQ1LV1-0= 10
(3) Enable the interrupt.
IRQ1ICR (x'3FE3')
bp1 : IRQ1IE = 1
Description
When the input signal level from P21/ACZ pin crosses 1/2 VDD, the external interrupt 1 is generated.