Content originally posted in LPCWare by deeearth on Thu May 30 03:48:40 MST 2013
hi all,
Ive been trying to use the LPCxpressco as a slave device, so that i can sent an a couple of bytes to the board to say what pin/port i want to toggle, and light up some leds.
In my main program would just run forever when an i2c event happens an interupt is called, main will check when the slave state is has sent the nack then turn on the led.
attached is the program as i currently have it, could someone please help, ive just taken the example from the NXP i2c slave changed the address, and commented out any slave transation that i shouldnt need as per fig 95 on the UM10360 user manual.
What i can see with the i2c logger is the slave acking the i2c but when i only sent 3 bytes of slave address, pin then port an ack gets sent each time i dont understand why the i2c stat isnt read as 0x88 to nack the last byte.
if anyone has any ideas or better yet working i2c slave code would be great!
thanks
Dee