Panasonic MN101C77C, F77G user manual Both Edges Interrupt, IRQ2IE

Models: F77G MN101C77C

1 544
Download 544 pages 59.61 Kb
Page 142
Image 142

Chapter 3 Interrupts

3-3-5 Both Edges Interrupt

Both Edges Interrupt (External interrupts 0 to 4)

Both edges interrupt can generate interrupt at both the falling edge and the rising edge by the input signal from external input pins. CPU also can be returned from standby mode by both edges interrupt.

Both Edges Interrupt Setup Example (External interrupts 0 to 4)

External interrupt 2 (IRQ2) is generated at the both edges of the input signal from P22 pin. An example setup procedure, with a description of each step is shown below.

 

Setup Procedure

 

 

 

Description

 

 

 

 

(1)

Select the both edges interrupt.

(1)

Set the EDGSEL2 flag of the both edges

 

EDGDT (x'3F8F')

 

 

interrupt control register (EDGDT) to "1" to

 

bp2

: EDGSEL2 = 1

 

select the both edges interrupt.

(2)

Set the interrupt level.

 

(2)

Set the interrupt level by the IRQ2LV1-0 flag of

 

IRQ2ICR (x'3FE4')

 

 

the IRQ2ICR register.

 

bp7-6

: IRQ2LV1- 0 = 10

 

The interrupt request flag of the IRQ2ICR

 

 

 

 

 

register may be set, so make sure to clear the

 

 

 

 

 

interrupt request flag (IRQ2IR).

 

 

 

 

 

[

Chapter 3 3-1-4 Interrupt flag setup ]

(3)

Enable the interrupt.

 

(3)

Set the IRQ2IE flag of the IRQ2ICR register

 

IRQ2ICR (x'3FE4')

 

 

to "1" to enable the interrupt.

 

bp1

: IRQ2IE

= 1

 

 

 

 

 

 

 

 

 

 

At the both edge of the input signal from P22 pin, an external interrupt 2 is generated .

When the both edge interrupt is selected, the interrupt request generates at the both edge, regardless of the REDGn flag of the external interrupt control register (IRQnICR).

The interrupt request flag may be set to "1" at switching the interrupt edge. So, clear the interrupt request flag before the interrupt enable. Also, select the both edge interrupt before the interrupt enable.

The external interrupt pin is recommended to be pull-up, in advance.

III- 48 External Interrupts

Page 142
Image 142
Panasonic MN101C77C, F77G user manual Both Edges Interrupt, IRQ2IE