2 pins in parallel

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

2 pins in parallel

3,428 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by guillaumeL on Wed May 09 02:04:47 MST 2012
Hello, I have a component able to communicate with SPI and I2C.
The same pin of this component is connected to a I2C pin and to a SPI pin (in parallel) of a LPC1769. The problem is when I want to communicate with I2C link, there is an voltage offset on the I2C line (see pictures).

I try to change the SPI pin to input (high impedance) but I change nothing. Do you have an idea?

Regards
0 Kudos
Reply
15 Replies

3,411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Polux rsv on Thu May 10 05:07:08 MST 2012
Which kind of device is connected to the LPC1769 ???
What are trying to do ???
I know devices, like BMA180 accelerometers, which are able to "talk"  I2c OR SPI, but not both at the same time.

Angelo
0 Kudos
Reply

3,411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by guillaumeL on Thu May 10 02:41:43 MST 2012
I have found the problem. Between P0.15 pin and SPI/I2C pin, I have a level shifter. This level shifter is always enabled and have a influence on the signal. If I bypass it it works fine.

Sorry for the Disturbance
0 Kudos
Reply

3,411 Views
lpcware
NXP Employee
NXP Employee
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).
0 Kudos
Reply

3,411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_Europe on Wed May 09 15:21:24 MST 2012
Hello guillaumeL,

is the ground between the controllers properly connected?
0 Kudos
Reply

3,411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed May 09 09:46:26 MST 2012

Quote: guillaumeL
I try 500Ohm and 1K. With a voltage at 1.8V



You will try or you did try?

I still don't understand your schematic :confused:

#1 Which pins did you connect ?

#2 Is there already an offset if you connect SPI pin (?) and SDA pin (?) without device?

#3 Which voltages show this pins if there's nothing connected?
0 Kudos
Reply

3,411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by guillaumeL on Wed May 09 08:48:21 MST 2012
I try 500Ohm and 1K. With a voltage at 1.8V
0 Kudos
Reply

3,411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed May 09 08:38:30 MST 2012
How strong is your external pullup?
0 Kudos
Reply

3,411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by guillaumeL on Wed May 09 08:35:32 MST 2012
Sorry, one word is missing :)
It is forced to '0'.
0 Kudos
Reply

3,411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed May 09 08:19:45 MST 2012

Quote: guillaumeL
I have tried it but in this case, the SDA pin is forced to every time.



Forced to what :confused:
0 Kudos
Reply

3,411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by guillaumeL on Wed May 09 08:16:59 MST 2012
I have tried it but in this case, the SDA pin is forced to every time.
0 Kudos
Reply

3,411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed May 09 04:33:19 MST 2012

Quote: guillaumeL
P0.15/16/17/18 .
[LIST]
[*]PINMODE = 0 (pull up resistor set)
[/LIST]


Why don't you set PINMODE to 0b10 = no pullup / no pulldown :confused:
0 Kudos
Reply

3,411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by guillaumeL on Wed May 09 04:25:46 MST 2012
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
0 Kudos
Reply

3,411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed May 09 02:49:03 MST 2012

Quote: guillaumeL
But if I try to set the SPI pin (LPC side) as GPIO input, it doesn't work. There is the offset.



Which input :confused:  What are your exact PINMODE, PINSEL, PINMODE_OD settings?

Did you switch them via debugger to scope changes?
0 Kudos
Reply

3,411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by guillaumeL on Wed May 09 02:43:40 MST 2012
If I disconnected SPI phisically, it works.
But if I try to set the SPI pin (LPC side) as GPIO input, it doesn't work. There is the offset.
0 Kudos
Reply

3,411 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed May 09 02:14:14 MST 2012
What's happening if you disconnect SPI at LPC?
0 Kudos
Reply