微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 无线和射频 > TI蓝牙设计交流 > CC2541中的I2C具体是P2IFG的哪一位?

CC2541中的I2C具体是P2IFG的哪一位?

时间:10-02 整理:3721RD 点击:

cc2541 的 I2C 的 中断标志位具体是哪位啊? 

我看到demo中是直接把整个P2IFG给清0了。但是现在管脚比较紧张,用到了P2_1,需要用中断来做。谁知道I2C的具体中断标志位啊

P2.1 P2.2 用来下载程序了,最好是不要用,

P2.3 P2.4 用于低频晶振接口

P2.0没有用,

20.1.7 I2C Interrupt The I2C module has an interrupt line to the CPU to signal that it requires service. The I2C module uses interrupt number 6, which is also shared with Port 2 inputs; hence, the interrupt routine must also handle Port 2 interrupts if they are enabled. For an interrupt request to be generated, IEN2.P2IE must be set to 1. When an interrupt request has been generated, the CPU starts executing the ISR if there are no higher-priority interrupts pending. An interrupt is generated from the I2C module when one of the 26 out of 27 possible I2C component states is entered. The only state that does not cause an interrupt to be generated is state 0xF8, which indicates that no relevant state information is available. The corresponding I2CCFG.SI flag must be cleared by software at the end of the ISR. 20.1.8 I2C Pins The SCL and SDA pins of the I2C module are connected to pins 2 and 3, respectively, on the CC2533 and CC2541. These pins are pulled up during reset to avoid floating pins. After reset, they are controlled by the I2C module and use an internal pullup resistor of 20 kΩ to hold bus signals high. If these pins are not to be used for I2C, they can be used as GPIO by setting the I2CWC.OVR bit. In this mode, pins 2 and 3 can be set up as outputs, as inputs with optional pullup, or as 4-mA drive-strength outputs like the other GPIO pads on the device by using the configuration bits in I2CWC. Their values are read or controlled using the I2CIO register. These pins cannot be configured to generate GPIO interrupts. 20.2 I2C Registers

P2IFG (0x8B) – Port 2 Interrupt Status Flag
Bit Name Reset R/W Description
7:6 – 00 R0 Reserved
5 DPIF 0 R/W0 USB D+ interrupt-status flag. This flag is set when the D+ line has an interrupt request pending
and is used to detect USB resume events in USB suspend state. This flag is not set when the
USB controller is not suspended.
4:0 P2IF[4:0] 0 0000 R/W0 Port 2, inputs 4 to 0 interrupt status flags. When an input port pin has an interrupt request
pending, the corresponding flag bit is set.

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top