Hi Everyone, I am trying to following I2C example code from " BOOSTXL-SENSORS _SensorGUI_ MSP432P401R " to get my I2C working.(Code attached) Below is my code for calling the I2C_driver.c. It got stuck into the loop waiting for the "ui8Status" to get changed during i2cwrite I put a break point in the IRQ function, But it never goes into the interrupt. I used a different I2C code without IRQ, it works fine. What could be the problem? How came the interrupt is not happening? Thanks advance for the help, Eddy (Please visit the site to view this file)(Please visit the site to view this file) void main(void) { volatile uint32_t index; // Stop WDT and disabling master interrupts MAP_WDT_A_holdTimer(); MAP_Interrupt_disableMaster(); // Enabling SRAM Bank Retention SYSCTL->SRAM_BANKRET |= SYSCTL_SRAM_BANKEN_BNK7_EN; for (index = 0;index < 100;index++); // Configure clocks startCrystalOscillator(); setSystemClock(CPU_FREQ); // Initialize i2c initI2C(); MAP_Interrupt_enableMaster(); uint16_t val; val = 0x03; writeI2C(0X39, 0X80, (uint8_t*)&val, 1); writeI2C(0X39, 0X80, (uint8_t*)&val, 1); }
↧