Communications Controller
CMX850
1.5.10 Keyboard Encoder
The CMX850 keyboard encoder has the following features:
• Full N-key rollover, with key debounce and separate press/release indication.
• 8-character first-in first-out data buffer.
• Automatic sleep/wake-up option for low-power operation and reduced EMI.
• 8 row input pins with integral pull-up resistors.
• Between 1 and 13 column drive pins (up to 16 if using multiplexed memory interface).
• Fully autonomous operation, interrupt driven.
Enabling the keyboard encoder automatically configures the Port 1 (P1.7-0) pins as row inputs with pull-up
resistors, and configures a user-selectable number of Port4 and Port5 pins as open-drain column drivers.
This is done without altering the 8051’s port control registers. Those port 4 and port 5 pins which are not
configured as column drivers remain as general-purpose port pins. When the keyboard encoder is disabled,
all column output and row input pins automatically revert to their previous general-purpose port functions.
The keyboard matrix scan period is approximately 9.3ms. The CMX850 keyboard encoder does not have an
in-built facility for ghost key elimination or auto repeat generation. If these features are required, they should
be performed in software by the 8051 µC.
The keyboard encoder is accessed through the KBCON, KBSTAT and KBBUF SFRs.
1.5.10.1
Keyboard Control Register (KBCON)
KBCON: SFR Address $EC
All bits are cleared to 0 on reset.
Bit:
7
6
5
4
Enable
Auto-
sleep
enable
Debounce period
3
2
1
0
Number of column drivers
KBCON Register b7: Enable
b7 = 1 Enable keyboard encoder (requires 32.768kHz clock to be active)
b7 = 0 Disable and powersave the keyboard encoder, and clear the data buffer
KBCON Register b6: Auto-sleep enable
The auto-sleep function enables the keyboard encoder to enter a low power mode after
approximately 50ms of inactivity (i.e. no key pressed). The keyboard scanner automatically
resumes operation when a key is pressed. Auto-sleep mode reduces power consumption and EMI in
the CMX850.
b6 = 1 Enable auto-sleep
b6 = 0 Disable auto-sleep
© 2003 CML Microsystems Plc
44
D/850/6