beautypg.com

2 register description, 1 eicra - external interrupt control register a, Atmega128rfa1 – Rainbow Electronics ATmega128RFA1 User Manual

Page 219

background image

219


8266A-MCU Wireless-12/09

ATmega128RFA1

16.2 Register Description

16.2.1 EICRA – External Interrupt Control Register A

Bit

7

6

5

4

3

2

1

0

NA ($69)

ISC31

ISC30

ISC21

ISC20

ISC11

ISC10

ISC01

ISC00

EICRA

Read/Write

RW

RW

RW

RW

RW

RW

RW

RW

Initial Value

0

0

0

0

0

0

0

0

The External Interrupts 3 - 0 are activated by the external pins INT3:0 if the SREG I-flag
and the corresponding interrupt mask in the EIMSK is set. The level and edges on the
external pins that activate the interrupts are defined in the following tables. Edges on
INT3:0 are registered asynchronously. Pulses on INT3:0 pins wider than the minimum
pulse width of typical 50 ns will generate an interrupt. Shorter pulses are not
guaranteed to generate an interrupt. If low level interrupt is selected, the low level must
be held until the completion of the currently executing instruction to generate an
interrupt. If enabled, a level triggered interrupt will generate an interrupt request as long
as the pin is held low. When changing the ISCn bit, an interrupt can occur. Therefore, it
is recommended to first disable INTn by clearing its Interrupt Enable bit in the EIMSK
Register. Then, the ISCn bit can be changed. Finally, the INTn interrupt flag should be
cleared by writing a logical one to its Interrupt Flag bit (INTFn) in the EIFR Register
before the interrupt is re-enabled. When changing the ISCn1/ISCn0 bits, the interrupt
must be disabled by clearing its Interrupt Enable bit in the EIMSK Register. Otherwise
an interrupt can occur when the bits are changed.

Bit 7:6 – ISC31:30 - External Interrupt 3 Sense Control Bit

Table 16-126 ISC3 Register Bits

Register Bits

Value

Description

0x00

The low level of INTn generates an interrupt
request.

0x01

Any edge of INTn generates asynchronously
an interrupt request.

0x02

The falling edge of INTn generates
asynchronously an interrupt request.

ISC31:30

0x03

The rising edge of INTn generates
asynchronously an interrupt request.

Bit 5:4 – ISC21:20 - External Interrupt 2 Sense Control Bit

Table 16-127 ISC2 Register Bits

Register Bits

Value

Description

0x00

The low level of INTn generates an interrupt
request.

0x01

Any edge of INTn generates asynchronously
an interrupt request.

0x02

The falling edge of INTn generates
asynchronously an interrupt request.

ISC21:20

0x03

The rising edge of INTn generates
asynchronously an interrupt request.

Bit 3:2 – ISC11:10 - External Interrupt 1 Sense Control Bit