Content originally posted in LPCWare by cfb on Sun Sep 30 17:08:38 MST 2012
My guess is that the reference to P0.15 is an error.
Have you initialised the I2C interface for the LPC1769 before calling the functions you attached?
We do this in Oberon with the following code. It should not be too hard to translate to C:
SYSTEM.PUT(MCU.PCONP, pconp + {26});
(* Connect I2C2 signals *)
(* P0.10 = SDA2, PINSEL0:21:20 = 10B *)
(* P0.11 = SCL2, PINSEL0:23:22 = 10B *)
SYSTEM.GET(MCU.PINSEL0, s);
SYSTEM.PUT(MCU.PINSEL0, s - {20, 22} + {21, 23});
(* no pull-up or pull-down *)
(* PINMODE0:21:20 = 10B *)
(* PINMODE0:23:22 = 10B *)
SYSTEM.GET(MCU.PINMODE0, s);
SYSTEM.PUT(MCU.PINMODE0, s - {20, 22} + {21, 23});
SYSTEM.GET(MCU.PINMODE_OD0, s);
SYSTEM.PUT(MCU.PINMODE_OD0, s + {10, 11})
If you are not familiar with Oberon code:
(* ... *) are comments
- {20, 22} means: clear bits 20 and 22
+ {21, 23} means: set bits 21 and 23