News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

Question about Port expanders

Started by rick.curl, Apr 15, 2024, 11:59 PM

Previous topic - Next topic

rick.curl

I'm working on a project where I will need to have an off-board port expander.  It could be up to 15 feet away from the control board. I'm planning to use an Ethernet-type cable to go between the main board and the remote expander. Speed is not a concern. I will only be changing the state of I/O pins every few minutes.

My question is- would I be better off with an SPI expander or an I2C expander?

Thanks for any input on this.

-Rick 

Gamboa

Rick,

In this post I talk about a solution that I developed a few years ago with RS485. In my humble opinion, 15 feet is about 4 meters and the I2c and SPI protocols are not designed for those distances, although they could work.

https://protoncompiler.com/index.php/topic,515.msg3469.html#msg3469

Regards,
Gamboa
Long live for you

RGV250


keytapper

To transmit data at such distance I think that bluetooth might be an option. Assumed that there are none or few obstacles.
But also the receiver should be able to understand the coming in data. Thus it would be rather two MCU connection.
Ignorance comes with a cost

John Lawton

Hi Rick,

you don't say how many I/O pins are involved, but I assume that you have more than 7 so you couldn't just use the ethernet cables + return for the purpose, old style.

If you need some sort of port expansion then it could be digital in the form of a shift register like the 74HC595 although noise on the control lines might be a problem, but amenable to filtering at the shift register end and/or by opto-isolation.

John

rick.curl

Wow!  Thanks for all the responses!
I will need a minimum of 11 I/O pins. This is part of a medical treatment machine, so I think I'd better avoid Bluetooth. Those DS2408's look interesting, but since I would have to use two of them the code gets more complicated (because of the serial numbers).
I found this article: I2C-RS485 adapter that may be part of the answer too.

I think some experimentation is called for.

Thanks again!!

-Rick

RGV250

Hi Rick,
That looks a novel approach, A couple of things spring to mind. In the schematic it shows 220 ohm terminating resistor where all the networks we had at work have 120 ohm. I am not sure how you would get on with ethernet cable instead of the correct cable, probably OK for the small distance but just thought I would mention it.

Bob

kcsl

If I understand correctly, you want to remotely control 11 I/O pins, and since you are looking at SPI, I2C or whatever, then I also assume you intend to have some type of decoding logic at the remote end, which would also need power.

Since you are not adverse to putting some type of hardware at the remote end, how about just using a PIC?
Connect the master and remote together via a shielded serial cable with a couple of MAX232s, and since you now have processing capabilities at both ends and it's for a medical application, you can implement checksums or other forms of signal integrity checking, including positive feedback to the master that the remote command has been received and executed. You can even poll the remote device to make sure it's physically connected and alive.


Joe
There's no room for optimism in software or hardware engineering.

Dompie

#8
Rick,
for these types of situations I use a P82B715 from TI (click for datasheet). It is an I2C Bus Extender.
Works great and according to specs up to 50m (I've used it up to 10 meters).

Greetings
Johan


@keytapper: Thanks!!! Correct the linkaddress and max distance

John Lawton

Quote from: rick.curl on Apr 16, 2024, 12:47 PMI will need a minimum of 11 I/O pins. This is part of a medical treatment machine, so I think I'd better avoid Bluetooth.

Ah, medical. I think you should consider opto-isolation to avoid any danger of shock to the patient.

keytapper

Quote from: Dompie on Apr 16, 2024, 03:50 PMfor these types of situations I use a P82B715 from TI (click for datasheet). It is an I2C Bus Extender.
Probably this link will work. As a I2C Bus Extender it's a great idea. Also 50 m distance is good.
Ignorance comes with a cost

Parmin

In the past I use CAN communication for such job.
Such as MCP2551 transceiver works well in noisy environment and quite straight forward to use.

rick.curl

Quote from: John Lawton on Apr 16, 2024, 05:12 PM
Quote from: rick.curl on Apr 16, 2024, 12:47 PMAh, medical. I think you should consider opto-isolation to avoid any danger of shock to the patient.
Generally, I agree, but in this case the equipment will not be in direct contact with the patient (similar to an X-ray machine).

rick.curl

Quote from: Dompie on Apr 16, 2024, 03:50 PMRick,
for these types of situations I use a P82B715 from TI (click for datasheet). It is an I2C Bus Extender.
Works great and according to specs up to 50m (I've used it up to 10 meters).
Thank you!! Somewhere in the cobwebs of my mind I was thinking I remembered something like this, but I couldn't find it anywhere. I think that settles it.  I2C + P82B715!

-Rick