lpcware

lpc1114 i2c minimum setup, baremetal, difficulties

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by nxpuser100 on Tue Dec 22 20:27:44 MST 2015
I'm having difficulty getting initial interrupt raised using the i2c peripheral master transmit/start bit.

I'm not using any toolchain (no cmsis, no other libraries, all baremetal).

I'm making the assumption that most of the lpc1114 default reset is adequate for my needs, the micro is running using IRC (no external crystal).

My i2c initialization is as follows.

IOCON_PIO0_4 |= 0x1;
IOCON_PIO0_5 |= 0x1;
SYSAHBCLKCTRL |= (1<<5); /* I2C_ENABLE */
PRESETCTRL |= (1<<1); /* I2C_RST */
I2C0CONCLR = (1<<2) | (1<<3) |(1<<5) | (1<<6);
I2C0SCLL = 0x3c; /* I2C_PCLK 12MHz (i.e. internal IRC), Standard Mode */
I2C0SCLH = 0x3c; /* I2C_PCLK 12MHz (i.e. internal IRC), Standard Mode */
NVIC_ISER |= (1<<15); /* enable NVIC Interrupt 15 */
I2C0CONSET = (1<<6); /* I2C0CON_I2EN */

Then I issue start.

I2C0CONSET = (1<<5); /* I2C0CON_STA */

But I never receive the expected interrupt after issuing start.

As mentioned I'm not using CMSIS, I am using the default IRC and I have not configured use of the PLL.  I'm doing this as a learning exercise but it appears I have more setup to do (or I've made some other error).

Any suggestions would be appreciated.

Kind regards.


Outcomes