I'm using the F28M35xx ISO controlCARD with the F28M35H52C1 microcontroller and I can't start
an I2C comunication with ARM core to the EEPROM. The pins that interface with the EEPROM are PIN6 and PIN7 of PORT B, and after a few tries I realized that the AFSEL register of PIN7 in PORT B doesn't set, so I couldn't see the I2C_CLOCK signal in an oscilloscope.
My code is
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
GPIOPinConfigure(GPIO_PB7_I2C0SCL);
GPIOPinConfigure(GPIO_PB6_I2C0SDA);
HWREG(GPIO_PORTB_BASE + GPIO_O_AFSEL) |= (GPIO_PIN_6 | GPIO_PIN_7);
(just after this line the register it's set as 0x00000040 instead of 0x000000C0 while debugging step by step)
GPIOPinTypeI2C(GPIO_PORTB_BASE, GPIO_PIN_6 | GPIO_PIN_7);
I2CMasterInitExpClk(I2C0_MASTER_BASE, SysCtlClockGet(SYSTEM_CLOCK_SPEED), false);
And then I'm stucked in the while
while (I2CMasterBusy(I2C0_MASTER_BASE)) {
}
Is there any mistake in my code?
(There's the sentence HWREG(SYSCTL_MWRALLOW) = 0; before all this code)