Atmel Evaluation Kit for AT32uC3A0512, 32-Bit AVR Microcontroller Atmel ATEVK1105 ATEVK1105 数据表

产品代码
ATEVK1105
下载
页码 826
108
AT32UC3A
The NMI is non-maskable within the CPU in the sense that it can interrupt any other execution
mode. Still, as for the other external interrupts, the actual NMI input line can be enabled and dis-
abled by accessing the registers in the External Interrupt Module. These interrupts are not
enabled by default, allowing the proper interrupt vectors to be set up by the CPU before the
interrupts are enabled.
17.5.3
Keypad scan support
The External Interrupt Module also includes support for keypad scanning. The keypad scan fea-
ture is compatible with keypads organized as rows and columns, where a row is shorted against
a column when a key is pressed.
The rows should be connected to the external interrupt pins with pullups enabled in the GPIO
module. These external interrupts should be enabled as low level or falling edge interrupts. The
columns should be connected to the available scan pins. The GPIO must be configured to let the
required scan pins be controlled by the EIC module. Unused external interrupt or scan pins can
be left controlled by the GPIO or other peripherals.
The Keypad Scan function is enabled by writing :EN to 1, which starts the keypad scan counter.
The SCAN outputs are tristated, except SCAN[0], which is driven to zero. After 2
(SCAN:PRESC+1)
RC clock cycles this pattern is left shifted, so that SCAN[1] is driven to zero while the other out-
puts are tristated. This sequence repeats infinitely, wrapping from the most significant SCAN pin
to SCAN[0].
When a key is pressed, the pulled-up row is driven to zero by the column, and an external inter-
rupt triggers. The scanning stops, and the software can then identify the key pressed by the
interrupt status register and the SCAN:PINS value.
The scanning stops whenever there is an active interrupt request from the EIC to the CPU.
When the CPU clears the interrupt flags, scanning resumes.
32058K
AVR32-01/12