Content originally posted in LPCWare by atomicdog on Wed May 09 21:23:14 MST 2012
Quote: guillaumeL
The pinning is like this:
P0.27 and P0.28 are I2C pins
P0.15, P0.16, P0.17 and P0.18 are SPI pins
P0.27 and P0.15 are connected (as show in the previous picture)
When I use I2C the setting of LPC is like this:
P0.27 is SDA.
[LIST]
[*]PINMODE_OD = 1 (open drain mode)
[*]PINSEL = 0x01 (SDA mode)
[/LIST]
P0.28 is SCL.
[LIST]
[*]PINMODE_OD = 1 (open drain mode)
[*]PINSEL = 0x01 (SCL mode)
[/LIST]
P0.15/16/17/18 .
[LIST]
[*]PINMODE = 0 (pull up resistor set)
[*]PINSEL = 0 (GPIO mode)
[*]FIODIR = 0 (input mode)
[*]PINMODE_OD = 0 (normal mode)
[/LIST]
I try to use debugger with scope to check the signal waveform but:
with the configuration below, there is an offset on SDA line
For I2C to work properly both the SDA and SCL lines need to be open drain. Which means you have to set P0.15 to open drain (if it's even possible for the 1769).