This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
如题:
程序中应用到了EUSCI_B0的I2C模式,应用示例代码[examples\nortos\MSP_EXP432P401R\driverlib\i2c_master_rw_repeated_start-master_code]中的读写中断方式。
程序卡死在了读I2C_masterSendMultibyteStart函数中的
while (BITBAND_PERI(EUSCI_B_CMSIS(moduleInstance)->CTLW0, EUSCI_B_CTLW0_TXSTT_OFS) || !BITBAND_PERI(EUSCI_B_CMSIS(moduleInstance)->IFG, EUSCI_B_IFG_TXIFG0_OFS));
调试时,查看CTLW0和IFG寄存器,STT位长时置1, TXIFG0位长时为0.
其它条件:MSP432作主机,从机地址为0x1F。 不知问题出在何处?
您好,非常感谢你的回复。
我使用的1832.u2c_druver.c和6622.i2c_driver.h文件, 我这出现运行程序之后, 会进入Cortex-M4 Processor Exceptions中断,而不是进入设备中断。你遇到过这种现象吗?
我调用i2c_driver.c文件中的API过程:
void main(void)
{
int i = 0;
uint8_t rxBuf[10] = { 0 };
Clock_Init48MHz();
MAP_WDT_A_holdTimer();
initI2C(EUSCI_B1_BASE);
while (1) {
readI2C(EUSCI_B1_BASE, 0x68, 0x00, rxBuf, 1);
for (i = 0; i < 2000; i++);
}
}
首先,恭喜你的问题得到了解决。 在问题得到解决后,应该分享一下问题出现的原因或解决流程或方法。 只有每个人都乐于分享,我们才能在遇到问题时有所求,有所果,有所成。 谢谢。