LPC1114 I2c issues

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPC1114 I2c issues

1,209件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Vidar on Sat Mar 24 05:27:06 MST 2012
Hi,

Im not too familiar with programming the NxP yet. Im trying to test the I2C communication between two lpc expresso boards with an oscilloscope using example code from red_code. The problem is that we can't see any events on the oscilloscope besides that both SDA and SCL lines are pulled high(pull-up resistors are 4,7k). Is there any common mistakes that may be the problem? Help will be highly appreciated:)

Many thanks
Vidar
0 件の賞賛
返信
4 返答(返信)

1,082件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Sun Mar 25 00:51:33 MST 2012

Quote: Vidar
Im trying to test the I2C communication between two  lpc expresso boards with an oscilloscope using example code from  red_code.



You might want to explain a bit more on which "example from red_code"  you are using. Probably you are referring to the examples from Code Red  that are delivered with the LPCXpresso environment (from the  lpcxpresso\Examples\NXP\LPC1000\LPC11xx\ directory ?).
And which of the examples ?
Did you make any changes to the examples ?
Which pins did you connect between the two devices ?
Are there any pull ups (if you see a high voltage I expect there are) ?

First of all, try this with just the master board (no slave connected) - you should at least see the start condition and the slave address on the I2C lines. Then, instead of using an lpc1114 as a slave you might want to use a readily existing I2C device (I/O port expander or something like a 24LC08 EEPROM).

Do you have one of those 'modern' oscilloscopes with an LCD screen? Then you could trigger on a falling edge on the SDA line to capture the start condition and the slave address.

you could also have a look (here) at my website - there is a newer version of the I2C driver (master mode only) but more importantly, it also shows a logic analyzer picture of an I2C transaction that might be helpfull.

Regards,
[INDENT]Rob
[/INDENT]
0 件の賞賛
返信

1,082件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat Mar 24 09:42:21 MST 2012

Quote: Vidar
...we can't see any events on the oscilloscope...


Not sure which sample you are using, but if you use i2c sample in

...\LPCXpresso_4.2.0_264\lpcxpresso\Examples\NXP\LPC1000\LPC11xx\NXP_LPCXpresso1114-302_2011-02-07.zip

you should see a few short signals at PIO0_5 (I2C-SDA) / PIO0_4 (I2C-SCL) after starting the program even it there's nothing connected (except pullups of course) :):)
0 件の賞賛
返信

1,082件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat Mar 24 07:40:57 MST 2012
Common mistakes are:

#1 Forget to use pullups :)

#2 Forget to enable clock for I2C and IOCON in SYSAHBCLKCTRL :confused:

#3 Forget to set pin function to I2C :mad:

If you don't see any signals you should use your debugger (Peripherals View) to check:

#1 SYSAHBCLKCTRL clock settings

#2 Correct I2C Pin function in IOCONFIG register

#3 If I2C engine is really trying to write/read something :rolleyes:
0 件の賞賛
返信

1,082件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by kamat on Sat Mar 24 06:20:11 MST 2012
Hi Vidar,
In case you are not transmitting data continuously over the I2C, then there will simply be a quick burst and no activity on the bus thereafter.
Use a digital storage oscilloscope in a single trigger mode so that it can capture this hard to notice event.
0 件の賞賛
返信