
7.0 Device Operation
(Continued)
Table 4
shows the pin configuration for all four combinations
of control bit settings (data output and direction) for the
general-purpose I/O pins. GEN_IO_3 cannot be put into the
high impedance (Hi-Z) input mode. When programmed as
an input, it can only be configured as an input with a weak
pullup.
TABLE 4. General Purpose I/O Pin Configuration
GEN_IO_DIR
Bit
0
0
GEN_IO_OUT
Bit
0
1
Direction
State
Input
Input
Hi-Z
Weak
Pullup
Drive Low
Drive High
1
1
0
1
Output
Output
7.2.3 External Interrupts
When the GEN_IO_0 or GEN_IO_1 pins are configured as
inputs, a SET_EXT_INT command (0xD1) can be used to
enable receiving external interrupts on either or both of these
pins. Setting the EX_0 or EX_1 bits in the data byte of the
SET_EXT_INT command (as shown in
Figure 6
) enables the
corresponding pin as an external interrupt input. When en-
abled as an interrupt input, any rising or falling edge causes
the IRQ output to be asserted. If the LM8333 was in Halt
mode, it also wakes up into Active mode.
When both GEN_IO_0 and GEN_IO_1 are configured as
interrupt inputs, bits 1 and 2 of the interrupt code indicate
which input asserted the interrupt. However, if only one of
GEN_IO_0 or GEN_IO_1 is configured as an interrupt input,
both bits 1 and 2 of the interrupt code will be set when an
interrupt occurs.
TABLE 5. Interface Commands for Controlling the LM8333
Function
FIFO_READ
Cmd
0x20
Dir
R
Data Bits
128
Data
Description
Event Codes from
FIFO
Read an event from the FIFO.
Maximum 14 event codes stored in the FIFO.
MSB = 1: key pressed.
MSB = 0: key released.
Repeats a FIFO read without advancing the FIFO
pointer, for example to retry a read after an error.
Maximum 14 event codes stored in the FIFO.
MSB = 1: key pressed.
MSB = 0: key released.
Default is 10 ms. Valid range 1255.
Time~n x 4 ms
Read port data.
Specify port mode. (Drive 0 or 1 when the port is
configured as an output; select Hi-Z or pullup when
the port is configured as an input.)
Select port direction (input or output).
Sets the low pulse time of the PWM signal.
Sets the high pulse time of the PWM signal.
Activate, reactivate, or stop PWM.
Reads the interrupt code, acknowledges the interrupt,
deasserts the IRQ output, and clears the code.
Enables/disables external interrupts on GEN_IO_0 and
GEN_IO_1.
Status Information.
Requests rescanning the keypad (for example, after
an error was reported).
Specifies the time after the last event during which the
LM8333 stays active before entering Halt mode. The
active time must be greater than the debounce time.
Reads and clears the error code.
RPT_FIFO_READ
0x21
R
128
Event Codes from
FIFO
DEBOUNCE
0x22
W
8
nnnn nnnn
GEN_IO_IN
GEN_IO_OUT
0x30
0x31
R
W
8
8
0000 nnnn
0000 nnnn
GEN_IO_DIR
PWM_HI
PWM_LO
PWM_CTL
READ_INT
0x32
0x40
0x41
0x42
0xD0
W
W
W
W
R
8
16
16
8
8
0000 nnnn
(n+1) x t
C
(n+1) x t
C
0000 0nnn
0000 nnnn
SET_EXT_INT
0xD1
W
8
0000 00nn
READ_STAT
SCAN_REQ
0xE0
0xE3
R
W
8
8
000n nnnn
ACTIVE
0xE4
W
8
nnnn nnnn
READ_ERROR
0xF0
R
8
0nnn nnnn
20210608
FIGURE 6. SET_EXT_INT Command Data Byte
L
www.national.com
9