On the fly I2C SDA Pin change

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
ALDE_1053476
Level 3
Level 3
10 replies posted 10 questions asked 10 sign-ins

Hello, 

In my design I need to change on the fly the position of SDA Pin (SCL pin is left unchanged).

Can you please show me the instructions to write?

 

Thanks,

Alfonso

0 Likes
1 Solution

Alfonso,

If your sensors were SPI with separate MOSI and MISO, it would be easy.  The issue is that you want I2C with a BIDIRECTIONAL SDA line.  This is the major issue.

Here are some other links that possibly address a similar issue.

Two-I2C-slaves-with-the-same-address

This one's about an external I2C master. PSoC5LP-Muxing-an-external-I2C-master-onto-an-internal-I2C-Bus 

Trouble-using-I2C-Mux 

I'm not an I2C expert but I know what you want to do is difficult because SDA is bidirectional.

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
4 Replies
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Alfonso,

Your requirements are confusing.

I downloaded your project.  That didn't make your requirements any clearer.

Can you go into more detail about your requirements?

Are you trying to use more than I2C component going to the same SDA pin?

Are you trying to change which pin has the SDA signal from the same I2C component?

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
ALDE_1053476
Level 3
Level 3
10 replies posted 10 questions asked 10 sign-ins

Hi Len,

I have to manage an array of IIC sensors all with the same Address (0x52 Write, 0x53 Read).

I have the constraint of minimizing the total number of connections.

So I decided to have a separate SDA Line per each sensor, while sharing one common SCL Line.

In other words, Sensor 1 is connected to pins "SCL" and "SDA_1", Sensor 2 to "SCL" and "SDA_2" ....

So I need to redirect SDA Signal of my IIC to Pin "SDA_1" prior to communicate with Sensor 1, to Pin "SDA_2" prior to communicate  with Sensor 2, and so on.

Thanks,

Alfonso

0 Likes

Alfonso,

If your sensors were SPI with separate MOSI and MISO, it would be easy.  The issue is that you want I2C with a BIDIRECTIONAL SDA line.  This is the major issue.

Here are some other links that possibly address a similar issue.

Two-I2C-slaves-with-the-same-address

This one's about an external I2C master. PSoC5LP-Muxing-an-external-I2C-master-onto-an-internal-I2C-Bus 

Trouble-using-I2C-Mux 

I'm not an I2C expert but I know what you want to do is difficult because SDA is bidirectional.

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
ALDE_1053476
Level 3
Level 3
10 replies posted 10 questions asked 10 sign-ins

Hi Len,

thanks for Your suggestions, 

however I think there must be another solution: 

when I drag and drop from PSoC Creator SDA Signal from one pin to another (and then rebuild)

IDE automatically generate a new executable that works fine (using the new pin).

I guess IDE writes different values in The GPIO Control Registers and maybe in other registers that manage signal routing.

If I knew the names of these registers and / or the files where these instructions are implemented, I can solve the problem

 

Thanks,

Alfonso

0 Likes