AnsweredAssumed Answered

LPC82x I2C Error

Question asked by Tiago Fernandes on Sep 27, 2016
Latest reply on Oct 11, 2016 by Carlos_Mendoza

Hello,

I'm trying to use the I2C in the LPC82x but I have some troubles. I configure the micro as shown below, however when I'm trying to the the signal with osciloscope (read mode:digital signals) the signals (SDA and SCL) are always high. What I'm doing wrong?

 

/* Enable the clock to the Switch Matrix */
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_SWM);
/* Connect the I2C_SDA and I2C_SCL signals to port pins(P0.10, P0.11) */
Chip_SWM_EnableFixedPin(SWM_FIXED_I2C0_SDA);
Chip_SWM_EnableFixedPin(SWM_FIXED_I2C0_SCL);
/* Enable standard mode/Fast mode for I2C pins */
Chip_IOCON_PinSetI2CMode(LPC_IOCON, IOCON_PIO10, PIN_I2CMODE_STDFAST);
Chip_IOCON_PinSetI2CMode(LPC_IOCON, IOCON_PIO11, PIN_I2CMODE_STDFAST);

/* Disable the clock to the Switch Matrix to save power */
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SWM);

Chip_I2C_Init(LPC_I2C0);
Chip_I2C_SetClockDiv(LPC_I2C0, 2);
Chip_I2CM_SetBusSpeed(LPC_I2C0, I2C_BITRATE);      //I2C_BITRATE=100kHz
Chip_I2CM_Enable(LPC_I2C0);

 

 

After this configurations I call a function to write to a slave device. Which configurations I'm doing worng or are missing?

 

Best Regards,

Tiago

Outcomes