I2C doesn't work (LPCXpresso 1769 EVB)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2C doesn't work (LPCXpresso 1769 EVB)

797 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by PatrickChang on Thu Nov 17 03:48:24 MST 2011
Hi,
I am new to use LPCX1769 and trying to let LPC1769 MCU as a host to control the other i2c slave devices.

I had imported a project called "I2C"(from "NXP_LPCXpresso1769_MCB1700_2011-02-11.zip") and completed the project compiling.

After record the program to the flash rom, I plug the POWER-IN + GND + I2C/SCL/SDA connectors. (There are 4.7k-Ohm pull-high resistors connect to SCL and SDA)
And check it works or not.
The result shows it doesn't work.
I'd tried PORT_USED form 1 to 3, but there  is no any signal change (I plug SCL to an oscillscope, the signal is flat).

Could someone tell me what is wrong?
0 Kudos
7 Replies

645 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Mon Jan 16 17:02:43 MST 2012
What I am afraid of is that he says that he just imported and compiled the project... did he put the addresses of the slaves in the software?
I don't think the resistors are the source of the problem here.
Did he notice that there is already an eeprom 24LC on board?
Are the signals on the bus correct? Is there an ack or nack transmitted by the slaves?

Serge
0 Kudos

645 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by atomicdog on Mon Jan 16 12:48:56 MST 2012

Quote: Zero
2 pairs of pullups (3.3k parallel to 4.7k = 2k) are still inside safe I2C conditions. Even reducing pullups to 1k isn't crucial :) So this problem isn't caused by 2 additional 4.7ks :rolleyes:


You're assuming you know what his setup looks like and how much bus capacitance there is.
0 Kudos

645 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Jan 16 12:18:08 MST 2012

Quote: atomicdog
The LPC1769 Xpresso board already has 3.3k pullups on one of the Ports.



2 pairs of pullups (3.3k parallel to 4.7k = 2k) are still inside safe I2C conditions. Even reducing pullups to 1k isn't crucial :) So this problem isn't caused by 2 additional 4.7ks :rolleyes:
0 Kudos

645 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by atomicdog on Mon Jan 16 11:08:11 MST 2012

Quote: PatrickChang
Hi,
I am new to use LPCX1769 and trying to let LPC1769 MCU as a host to control the other i2c slave devices.

I had imported a project called "I2C"(from "NXP_LPCXpresso1769_MCB1700_2011-02-11.zip") and completed the project compiling.

After record the program to the flash rom, I plug the POWER-IN + GND + I2C/SCL/SDA connectors. (There are 4.7k-Ohm pull-high resistors connect to SCL and SDA)
And check it works or not.
The result shows it doesn't work.
I'd tried PORT_USED form 1 to 3, but there  is no any signal change (I plug SCL to an oscillscope, the signal is flat).

Could someone tell me what is wrong?

Which I2C port is the software written for. The LPC1769 Xpresso board already has 3.3k pullups on one of the Ports. So try removing the extra pullups if your using that port.
0 Kudos

645 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Mon Jan 16 08:28:09 MST 2012

Quote: guillaumeL
Do we need to add Pull-up on SDA/SCL?



User manual:


Quote:

3. Pins: Select I2C0, I2C1, or I2C2 pins through the PINSEL registers. Select the pin
modes for the port pins with I2C1 or I2C2 functions through the PINMODE registers
(no pull-up, no pull-down resistors) and the PINMODE_OD registers (open drain)
(See Section 8.5).
Remark: I2C0 pins SDA0 and SCL0 are open-drain outputs and fully I2C-bus
compliant (see Table 73). I2C0 can be further configured through the I2CPADCFG
register to support Fast Mode Plus (See Table 99).
Remark: I2C0 is not available in the 80-pin package.
Remark: I2C pins that do not use specialized I2C pads (as identified in Table 73) can
be configured to an open-drain mode via the relevant IOCON registers, and can be
used with fast mode (400 kHz) and standard mode (100 kHz) I2C. These pins do not
include an analog filter to suppress line glitches, but a similar function is performed by
the digital filter in the I2C block itself. These pins should be configured as: no pull-up,
no pull-down, open drain mode.

So to stay fully I2C-bus compliant you should just add external pullups (4.7k-10k) :)

How to calculate the correct value you can read in Chapter 17.2 of  'I2C-BUS SPECIFICATION'
[FONT=GillSans,Bold][SIZE=4]
[/SIZE][/FONT]http://www.nxp.com/acrobat_download2...8/39340011.pdf
0 Kudos

645 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by guillaumeL on Mon Jan 16 08:16:12 MST 2012
Hello,

  just to add a question about your setting. Do we need to add Pull-up on SDA/SCL? Can we do that setting a specific configuration on the LPC1769 port?

Regards.
0 Kudos

645 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by serge on Thu Nov 17 08:59:06 MST 2011
Have you checked:[LIST=1]
[*]That SCL nor SDA are low when there is no communication going on. You say that the signal is flat but not if it is low or high.
[*]That the slave address(es) is (are) correct? Due to the direction bit this address is shifted and for example address &H40 becomes &H80 (sorry for the short notation). You should carefully read the datasheets of the slaves.
[*]Are the addresslines of the slaves correctly set?
[*]Are all I2C-registers correctly set? Meaning selecting speed (timing), selecting pins, etc etc.
[*]Is the chosen speed not too high for the connected slaves?
[/LIST]Have you connected a I2C viewer/tester?
Also worth trying is debugging your project and stepping through it. Your projectcode may 'hang' somewhere in an endless loop so that it even never executes the code for the I2C.
I noted that you connected resistors between 3v3 and the SCL and SDA lines, this is good and sometimes a beginners error.:rolleyes:

Also a good thing to do is to export your project and post it here so that we can review it.:D
0 Kudos