Hello TI,
I'm trying to get the MasterTimeoutSet function working on the I2C Modules, but I'm having no luck.
No matter how I try to set it, the I2C_MCLKOCNT register is remaining at 0x00000000
I've tried using driverlib - I2CMasterTimeoutSet(I2C0_BASE, 0x7D);
and I've tried doing direct register manipulation - HWREG(I2C0_BASE + I2C_O_MCLKOCNT) = 0x7D;
And in both cases, the I2C_MCLKOCNT register doesn't change. Am I doing something horribly wrong here?
I've wrapped the write in a while loop to confirm, and the while loop never exits.
SysCtlPeripheralDisable(SYSCTL_PERIPH_I2C0);
SysCtlPeripheralReset(SYSCTL_PERIPH_I2C0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0);
while(!SysCtlPeripheralReady(SYSCTL_PERIPH_I2C0));
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
GPIOPinConfigure(GPIO_PB2_I2C0SCL);
GPIOPinConfigure(GPIO_PB3_I2C0SDA);
GPIOPinTypeI2CSCL(GPIO_PORTB_BASE, GPIO_PIN_2);
GPIOPinTypeI2C(GPIO_PORTB_BASE, GPIO_PIN_3);
I2CMasterInitExpClk(I2C0_BASE, SysFreq, false); //False = 100kbs, True = 400kbs
while ((HWREG(I2C0_BASE + I2C_O_MCLKOCNT) & 0xFF) != 0x7D) {
HWREG(I2C0_BASE + I2C_O_MCLKOCNT) = 0x7D;
}
I2CMasterGlitchFilterConfigSet(I2C0_BASE, I2C_MASTER_GLITCH_FILTER_16);
Can you tell me how to get this register to actually set?
Thank you,
Ben