TI中文支持网
TI专业的中文技术问题搜集分享网站

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

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

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

jason hu2:

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

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

P2.0没有用,

da qin zheng sheng:

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

da qin zheng sheng:

P2IFG (0x8B) – Port 2 Interrupt Status FlagBit Name Reset R/W Description7:6 – 00 R0 Reserved5 DPIF 0 R/W0 USB D+ interrupt-status flag. This flag is set when the D+ line has an interrupt request pendingand is used to detect USB resume events in USB suspend state. This flag is not set when theUSB 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 requestpending, the corresponding flag bit is set.

赞(0)
未经允许不得转载:TI中文支持网 » CC2541中的I2C具体是P2IFG的哪一位?
分享到: 更多 (0)