27.12.2012 Views

Atmel AT89C51ID2 Data Sheet - Keil

Atmel AT89C51ID2 Data Sheet - Keil

Atmel AT89C51ID2 Data Sheet - Keil

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>AT89C51ID2</strong><br />

Keyboard Interface The <strong>AT89C51ID2</strong> implements a keyboard interface allowing the connection of a<br />

8 x n matrix keyboard. It is based on 8 inputs with programmable interrupt capability on<br />

both high or low level. These inputs are available as alternate function of P1 and allow to<br />

exit from idle and power down modes.<br />

4289A–8051–09/03<br />

The keyboard interface interfaces with the C51 core through 3 special function registers:<br />

KBLS, the Keyboard Level Selection register (Table 60), KBE, The Keyboard interrupt<br />

Enable register (Table 59), and KBF, the Keyboard Flag register (Table 58).<br />

Interrupt The keyboard inputs are considered as 8 independent interrupt sources sharing the<br />

same interrupt vector. An interrupt enable bit (KBD in IE1) allows global enable or disable<br />

of the keyboard interrupt (see Figure 28). As detailed in Figure 29 each keyboard<br />

input has the capability to detect a programmable level according to KBLS. x bit value.<br />

Level detection is then reported in interrupt flags KBF. x that can be masked by software<br />

using KBE. x bits.<br />

This structure allow keyboard arrangement from 1 by n to 8 by n matrix and allow usage<br />

of P1 inputs for other purpose.<br />

Figure 28. Keyboard Interface Block Diagram<br />

P1:x<br />

Figure 29. Keyboard Input Circuitry<br />

P1.0<br />

Vcc<br />

Internal Pullup<br />

KBLS. x<br />

KBE. x<br />

Power Reduction Mode P1 inputs allow exit from idle and power down modes as detailed in Section “Power<br />

Management”, page 73.<br />

0<br />

1<br />

Input Circuitry<br />

P1.1 Input Circuitry<br />

P1.2 Input Circuitry<br />

P1.3 Input Circuitry<br />

P1.4 Input Circuitry<br />

P1.5 Input Circuitry<br />

P1.6 Input Circuitry<br />

P1.7 Input Circuitry<br />

KBF. x<br />

KBD<br />

IE1<br />

KBDIT<br />

Keyboard Interface<br />

Interrupt Request<br />

77

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!