单片机应用技术第四章.pdf
文本预览下载声明
第4章 数字I/O模块
1、内容 2、要求
① 数字I/O模块概述 ① 了解端口输入输出电路
② 数字I/O模块寄存器设置 ② 掌握MSP430单片机数字I/O模块的
③ 端口输入输出电路 特点与配置方法。
④ 端口功能 ③ 掌握MSP430单片机数字I/O模块按
⑤ 寄存器与控制位 键、LED接口方法。
⑥ 数字I/O端口应用
⑦ 习题
1 Digital I/O Module
1 数字I/O模块概述
The digital I/O features include:
① Independently programmable individual I/Os
② Any combination of input or output
③ Individually configurable P1 and P2 interrupts.
④ Independent input and output data registers
⑤ Individually configurable pullup or pulldown resistors
MSP430系列具有高达12组数字I/O端口(P1 to P11 and PJ). 大部分端口有8个I/O线。
Each I/O line is individually configurable for input or output direction, and each can be
individually read or written. Each I/O line is individually configurable for pullup or pulldown
resistors, as well as, configurable drive strength, full or reduced.
PJ contains only 4 I/O lines.
Ports P1 and P2 always have interrupt capability. Each interrupt for the P1 and P2 I/O lines can
be individually enabled and configured to provide an interrupt on a rising or falling edge of an
input signal.
所有P1 口I/O线共用一个中断矢量P1IV,所有P2 口I/O线共用一个中断矢量P2IV。On some
devices, additional ports with interrupt capability may be available and contain their own
respective interrupt vectors.
Individual ports can be accessed as byte-wide ports or can be combined into word-wide
ports and accessed via word formats. Port pairs P1 and P2, P3 and P4, P5 and P6, and
so on, are associated with the names PA, PB, PC, and so on, respectively. All port
registers are handled in this manner with this naming convention except for the interrupt
vector registers; for example, PAIV does not exist for P1IV and P2IV.
When writing to port PA with word operations, all 16 bits are written to
显示全部