Hi,
I'm trying to setup i2c, but with no success. I'll be grateful if somebody can point me to what I'm doing wrong.
Here is my code:
PRCMPeripheralClkEnable(PRCM_I2CA0, PRCM_RUN_MODE_CLK); // Configure PIN_01 for I2C0 I2C_SCL PinTypeI2C(PIN_01, PIN_MODE_1); // Configure PIN_02 for I2C0 I2C_SDA PinTypeI2C(PIN_02, PIN_MODE_1); MAP_PRCMPeripheralClkEnable(PRCM_I2CA0, PRCM_RUN_MODE_CLK); MAP_PRCMPeripheralReset(PRCM_I2CA0); MAP_I2CMasterInitExpClk (PRCM_I2CA0, 80000000, false); // send 0x01 byte - this part works fine on a tiva launchpad, but not here I2CMasterSlaveAddrSet(PRCM_I2CA0, 0x42 >> 1, false); I2CMasterDataPut (PRCM_I2CA0, 0x01); I2CMasterControl (PRCM_I2CA0, I2C_MASTER_CMD_SINGLE_SEND); while(I2CMasterBusy(PRCM_I2CA0)); // <-- it hangs here
So it always hangs in the while loop and looking with the LA - no data is sent - both lines remain dead.
My wirings are SCL -> p01, SDA -> p02
Both lines have pull up resistors and I've removed the J2, J3, J4 jumpers.
Any idea what I may be doing wrong?
Thanks in advance!