Chapter 3 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.

 

Setup Procedure

 

 

 

Description

 

 

 

 

(1)

Select the AC zero-cross detector

(1)

Set the P21IM flag of the noise filter control

 

signal.

 

 

 

register (NFCTR0) to "1" to select the AC

 

NFCTR0 (x'3F8E')

 

 

zero-cross detector signal as the external

 

bp7

: P21IM

= 1

 

interrupt 1 generation factor.

(2)

Set the interrupt level.

 

(2)

Set the interrupt level by the IRQ1LV 1-0

 

IRQ1ICR (x'3FE3')

 

 

flag of the IRQ1ICR register.

 

bp7-6

: IRQ1LV1-0= 10

 

 

 

 

 

 

 

 

If the interrupt request flag has been already

 

 

 

 

 

set, clear the interrupt flag.

 

 

 

 

 

[

Chapter 3 3-1-4. Interrupt flag setup ]

(3)

Enable the interrupt.

 

(3)

Set the IRQ1IE flag of the IRQ1ICR register to

 

IRQ1ICR (x'3FE3')

 

 

"1" to enable the interrupt.

 

bp1

: IRQ1IE

= 1

 

 

 

 

 

 

 

 

 

 

When the input signal level from P21/ACZ pin crosses 1/2 VDD, the external interrupt 1 is generated.

External Interrupts

III - 55

Page 149
Image 149
Panasonic F77G, MN101C77C user manual IRQ1IE