zoukankan      html  css  js  c++  java
  • Chapter4 数字I/O模块

    1、数字I/O模块概述

      MSP430拥有12组数字I/O端口,为P1到P11和PJ,每个端口8位。可按位设置输入输出、片内上下拉及外设复用模式。P1和P2具有中断功能,可设置中断脉冲沿类型。

    2、数字I/O模块寄存器设置

      ①PxIN(Input Registers)

        Bit=0:Input is low

        Bit=1:Input is high

      ②PxOUT(Output Registers)

       When configured as I/O function, OUTPUT direction.

        Bit=0:Output is low

        Bit=1:Output is high

       When configured as I/O function, INPUT direction and the Pullup/Pulldown resistor is enabled.

        Bit=0:Pin is pulled down

        Bit=1:Pin is pulled up

      ③PxDIR(Direction Registers)

        Bit=0:Port pin is switched to input direction

        Bit=1:Port pin is switched to output direction

      ④PxREN(Pullup or Pulldown Resistor Enable Registers)

        Bit=0:Pullup/pulldown resistor disabled

        Bit=1:Pullup/pulldown resistor enabled

      ⑤PxDS(Output Drive Strength Registers)

        Bit=0:Reduced drive strength

        Bit=1:Full drive strength

      ⑥PxSEL(Function Select Registers)

        Bit=0:I/O Function is selected for the pin

        Bit=1:Peripheral module is selected for the pin

      Warnin:Setting PxSEL does not automatically set the pin direction.

    3、中断端口P1,P2相关寄存器

      ①PxIFG(Interrupt Flag)

        Bit=0:No interrupt is pending

        Bit=1:An interrupt is pending

      Warning:MSP430为边沿触发中断

      ②PxIES(Interrupt Edge Select Registers)

        Bit=0:Respective PxIFG flag is set with a low-to-high transtion

        Bit=1:Respective PxIFG flag is set with a high-to-low transtion

      ③PxIE(Interrupt Enable Registers)

        Bit=0:The Interrupt is disabled

        Bit=1:The Interrupt is enabled

      ④PxIV(Interrupt Vector)    16位

  • 相关阅读:
    A/B test模块使用以及配置
    Linux下的tar压缩解压缩命令详解
    php mysql转义特殊字符的函数(转)
    cas server + cas client 单点登录 原理介绍
    php二维码的生产以及下载
    shiro 获取已经登录的用户
    Sql 根据多条件查询重复的数据 MySQL删除重复数据
    js base64 转PDF并下载,js baser64转图片并下载
    当同时安装Python2和Python3后,如何兼容并切换使用详解(比如pip使用)
    我的博客初始“话”
  • 原文地址:https://www.cnblogs.com/starle/p/5613498.html
Copyright © 2011-2022 走看看