sx150x_89b-datasheet

ADVANCED COMMUNICATIONS & SENSING
Rev 4 – 26
th
April 2011 14 www.semtech.com
SX1508B/SX1509B
World’s Lowest Voltage Level Shifting GPIO
with LED Driver and Keypad Engine
Figure 9 - 2-Wire Serial Interface, Read Operation
When successive register data (RD1...RDn) is read by the master, the register address will be automatically
incremented or kept fixed depending on the setting programmed in RegMisc.
4.5 I/O Banks
4.5.1 Input Debouncer
Each input can be individually debounced by setting corresponding bits in RegDebounce register. At power up
the debounce function is disabled. After enabling the debouncer, the change of the input value is accepted only if
the input value is identical at two consecutive sampling times.
The debounce time common to all IOs can be set in RegDebounceConfig register from 0.5 to 64ms (fOSC =
2MHz).
4.5.2 Keypad Scanning Engine
SX1508B, and SX1509B integrate a fully programmable keypad scanning engine to implement keypad
applications up to 8x8 matrix (i.e. 64 keys).
Please note that SX1509B also implements an Auto Sleep/Wakeup feature to save power consumption when no
key has been pressed for a programmed time.
IO3
IO2
IO1
IO0
IO4
IO5
IO6
IO7
SX1508B
- IO[3-0] as outputs (scanning)
- IO[7-4] as inputs
X
Y
RegKey
Data
=
X
Y
Figure 10 – 4x4 Keypad Connection to SX1508B
Following procedure should be implemented on the host controller for a 4x4 keypad:
1. Set RegDir to 0xF0 (IO[3-0] as outputs, IO[7-4] as inputs) , set RegOpenDrain to 0x0F (IO[3-0] as open-drain
outputs), set RegPullup to 0xF0 (pull-ups enabled on inputs IO[7-4]).
2. Enable and configure debouncing on IO[7-4] (RegDebounceEnable = 0xF0, Ex : RegDebounceConfig = 0x05)
3. Enable and configure keypad scanning engine (Ex : RegKeyConfig = 0x7D) This will start an infinite loop with
the following sequence to IO[3:0]: ZZZ0, ZZ0Z, Z0ZZ, 0ZZZ. Make sure that scan interval is set to higher value
than the debounce time.
4. When a key is pressed, NINT goes low, key scan is halted and the key coordinates are stored in RegKeyData:
The column data will be stored in RegKeyData[7:4] (Note: column indication is active low)