http://www.www.datasheet4u.com

900,000+ Datasheet PDF Search and Download

Datasheet4U offers most rated semiconductors datasheets pdf




  Microchip Technology Semiconductor Electronic Components Datasheet  

AN1043 Datasheet

Unique Features of the MCP23X08/17 GPIO Expanders

No Preview Available !

AN1043 pdf
AN1043
Unique Features of the MCP23X08/17 GPIO Expanders
Author: Pat Richards
Microchip Technology Inc.
INTRODUCTION
GPIO expanders provide easy I/O expansion using
standard serial interfaces. GPIO products are used to
increase the I/O on an MCU or provide remote I/O
using a serial interface.
This application note discusses the feature set and use
of the MCP23X08/17 (8-bit and 16-bit) GPIO Expand-
ers.
The MCP23X08 are 8-bit GPIO Expanders:
• MCP23008: I2C™ Interface
• MCP23S08: SPI Interface
The MCP23X17 are 16-bit GPIO Expanders:
• MCP23017: I2C Interface
• MCP23S17: SPI Interface
The functions and features of the MCP23X08 and
MCP23X17 are basically the same, except where
otherwise noted.
FEATURES
This application note discusses some of the features of
the MCP23X08/17 and how they may be used in an
application:
• I/O Port Description
• 8/16-Bit Mode (MCP23X17 only)
• Interrupt Features
- Mapping Interrupts
- Mirroring Interrupts (MCP23X17 only)
- Servicing Interrupts
• Internal Address Pointer Control
• Hardware Address Pin on SPI
I/O PORT DESCRIPTION
The I/O port is highly configurable for maximum
flexibility. Figure 1 is a simplified block diagram of an
I/O port pin. The port can either drive logic levels on the
pin, or read logic levels from the pad. The level on the
pad can be read at any time, regardless if the pin is
configured as an input or an output.
The IODIR register controls the direction of the pins
(input or output). More specifically, the IODIR registers
simply enables/disables the output driver. When the
driver is activated (IODIR = 0), the pad is driven to the
state in the latch register (OLAT). When deactivated
(IODIR = 1), the driver is high impedance.
The I/O port has multiple, individual configurations.
Each pin can
be configured as an input. The output driver is
disabled (high impedance)
be configured as an output. The output driver
is enabled and the value in the latch is driven on
the pin.
enable a weak pull-up resistor
emulate an open-drain configuration. This is
accomplished by clearing the output latch (OLAT)
bit to a zero and using the direction register
(IODIR) to set the level on the pin. A pull-up
resistor is required to pull the pin to voltage when
the pin is an input
- To drive a 0: configure the pin as an output
(IODIR = 0) so the port drives whatever is in
OLAT (logic 0 in this case)
- To float a 1: set the pin as an input
(IODIR = 1). The output driver is disabled
and the pull-up resistor pulls the pin to a
logic 1
© 2006 Microchip Technology Inc.
DS01043A-page 1
Free Datasheet http://www.datasheet4u.com/


  Microchip Technology Semiconductor Electronic Components Datasheet  

AN1043 Datasheet

Unique Features of the MCP23X08/17 GPIO Expanders

No Preview Available !

AN1043 pdf
AN1043
FIGURE 1:
I/O PORT BLOCK DIAGRAM
VDD
MCP23X08/17
Data Bus
Write
Write
Read
Port
D SET Q
QCLR
OLAT or
GPIO
D SET Q
QCLR
IODIR
Q SET D
Q CLR
I/O
Pad
Input
Buffer
8/16 BIT MODE (MCP23X17 ONLY)
The MCP23X17 has the unique ability to appear to the
MCU as either two (2) 8-bit GPIO expanders, or as a
single 16-bit GPIO expander.
This is accomplished by splitting the 16 I/O ports into
two separate 8-bit I/O ports (Port A and Port B) via
IOCON.bank.
Each port has a group of dedicated registers. Table 1
shows how the register groups (Port A and Port B) are
mapped when in 8-bit or 16-bit mode.
Note:
Unlike all other registers which are not
shared between the two ports (Port A and
Port B), there is one register (IOCON).
which is shared between the ports and
affects both equally.
8-Bit Mode:
When in 8-bit mode, the ports’ registers are separated:
• Port A register addresses range from 00h – 0Ah
• Port B register addresses range from 10h – 1Ah
16-bit Mode:
When in 16-bit mode, the ports’ registers are
interleaved to emulate 16-bit wide registers:
• Port A and Port B register addresses range from
00h – 15h. The registers are still addressed as
8-bit ports, meaning that the 16-bit mapping pair
is always an even number (e.g., IODIR starts at
00h, IPOL starts at 02h, etc.)
TABLE 1: MEMORY MAP
8-bit Mode
16-bit Mode
Register
Name
Address
(hex)
Register
Name
Address
(hex)
IODIRA 00 IODIRA 00
IPOLA
01 IODIRB 01
GPINTENA
02
IPOLA
02
DEFVALA
03
IPOLB
03
INTCONA
04 GPINTENA 04
IOCON
05 GPINTENB 05
GPPUA
06 DEFVALA 06
INTFA
07 DEFVALB 07
INTCAPA 08 INTCONA 08
GPIOA
09 INTCONB 09
OLATA 0A IOCON 0A
IODIRB 10 IOCON 0B
IPOLB
11 GPPUA 0C
GPINTENB
12
GPPUB
0D
DEFVALB
13
INTFA
0E
INTCONB
14
INTFB
0F
IOCON
15 INTCAPA 10
GPPUA
16 INTCAPB 11
INTFB 17 GPIOA 12
INTCAPB
18
GPIOB
13
GPIOB 19 OLATA 14
OLATB 1A OLATB 15
DS01043A-page 2
© 2006 Microchip Technology Inc.
Free Datasheet http://www.datasheet4u.com/


Part Number AN1043
Description Unique Features of the MCP23X08/17 GPIO Expanders
Maker Microchip
Total Page 10 Pages
PDF Download
AN1043 pdf
Download PDF File


Buy Electronic Components




Related Datasheet

1 AN1042 High Fidelity Switching Audio Amplifiers Using TMOS Power MOSFETs ON Semiconductor
ON Semiconductor
AN1042 pdf
2 AN1042D High Fidelity Switching Audio Amplifiers Using TMOS Power MOSFETs ON Semiconductor
ON Semiconductor
AN1042D pdf
3 AN1043 Unique Features of the MCP23X08/17 GPIO Expanders Microchip
Microchip
AN1043 pdf
4 AN1048 RC Snubber Networks ON Semiconductor
ON Semiconductor
AN1048 pdf
5 AN1048D RC Snubber Networks ON Semiconductor
ON Semiconductor
AN1048D pdf






Part Number Start With

0    1    2    3    4    5    6    7    8    9    A    B    C    D    E    F    G    H    I    J    K    L    M    N    O    P    Q    R    S    T    U    V    W    X    Y    Z

site map

webmaste! click here

contact us

Buy Components