首页|嵌入式系统|显示技术|模拟IC/电源|元件与制造|其他IC/制程|消费类电子|无线/通信|汽车电子|工业控制|医疗电子|测试测量
首页 > 分享下载 > 嵌入式系统 > PIC16F877A的MCP23016 IO扩展接口

PIC16F877A的MCP23016 IO扩展接口

资料介绍
This application note describes how to use a
PIC16F877A as an I
2
C™ master to communicate with
the Microchip MCP23016 I
2
C I/O Expander slave
device.
An I/O Expander device is used to increase the I/O
capability of a microcontroller (refer to Figure 1). A
microcontroller’s I
2
C port can be used as a communi-
cation channel with MCP23016(s) to expand the micro-
controller’s I/O count. By using two I
2
C pins (and one
general-purpose I/O pin, if using the interrupt capability
of the MCP23016), 16 to 128 general-purpose I/Os can
be gained. The MCP23016 has three address pins
which can be used to provide unique addresses for up
to eight devices.
Each device attached to the I
2
C bus must be assigned
a unique address unless all devices (with the same
address) are receiving the same data and do not trans-
mit any data. When the master initiates a data transfer,
the address of the slave device is transmitted. Within
the address, the LSb (R/W bit) specifies whether the
master reads from, or writes to, the slave. For write
operations, a series of bytes would be transmitted from
the master. For read operations, the master waits for
the bus to be free (i.e., SCL line not pulled low) and
then clocks the data to be received from the slave.
M AN245
Interfacing The MCP23016 I/O Expander
With The PIC16F877A
What can you do with an I/O Expander?
Author: Abdelwahab Fassi-Fihri
Microchip Technology Inc. An I/O Expander can also be used to monitor switches
and/or sensors, drive LEDs and/or relays, as well as
other general-purpose I/O functions. An I/O Expander
INTRODUCTION can have several uses in a variety of applications. Typ-
This
标签:PIC16F877AMCP23016IO扩展
PIC16F877A的MCP23016 IO扩展接口
本地下载

评论