PIC16F877A的MCP23016 IO扩展接口
时间:2019-12-24
大小:369.59KB
阅读数:243
查看他发布的资源
资料介绍
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……
版权说明:本资料由用户提供并上传,仅用于学习交流;若内容存在侵权,请进行举报,或
联系我们 删除。