View previous topic :: View next topic |
Author |
Message |
teix
Joined: 22 Mar 2005 Posts: 5 Location: Portugal
|
For a smart sensor probe : use I2C or RS422/485 ? |
Posted: Tue Mar 22, 2005 4:36 am |
|
|
My design is a data acquisition system consisting of a mainframe that can accept one of a few sensors connected to the mainframe by a short cable (about 1 meter long).
The probe could have a small PIC to some processing and also include address and calibration data to identify which probe is connected. The CCS functions for I2C the probe needs : start , write and stop that can be software functions are implemented in a small PIC; in the main frame, I have more space for a PIC with hardware I2C as seems I need to use I2C_POOL.
My question is: this is a reasonable choice? Is I2C robust and acceptable outside a PCB, to transmit over a cable of 1 meter long or if more reliable to use RS422 or RS485 or even to use one wire with the PIC BUS described in the CCS manual?
For me the number of wires in the cable is not important, but easy software is.
Thanks for any advice . |
|
|
rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
|
|
Posted: Tue Mar 22, 2005 8:27 am |
|
|
Without knowing more about the environment where you expect these things to run, my knee-jerk reaction is to tell you that a RS-485 bus will be more robust (noise insensitive) than I2C with long cables. But I'm certian a poor RS-485 net is just as easy to create as a poor I2C net...
I would consider a 4 wire RS-485 + shield with a common power, common ground lead (don't use the shield for ground return), TX and RX. If you daisy-chain the nodes, pehaps a 5th wire to use as a voltage sense return so that your voltage regulation circuit can compensate for some of the IR drop in the power lead of the cable(s). Or just use 4 wires and have local regulation at each node and design your sourcing supply to provide sufficient headroom under worst case conditions.
I would also consider optoisolated RS-485 if there is the potential for lots of noise (industrial environment with rotating machinery for example). Makes it easier to stop ground loops on the measurement side. There are schemes for optoisolating I2C too.
OK, let the abuse begin! _________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month! |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Tue Mar 22, 2005 8:28 am |
|
|
Hi teix,
Transmiting data using either RS485 or I2C doesnīt matter at short
distances. Long time ago I made a project where 12 PICs (PIC16C54)
comunicate using three-wire in daisy-chain mode using a paralell line 12m
long. Itīs running using a CRC error detecting check. The com is
supervised and a report is generated every 10min. Never get an error
reported in years, the hardware is very simple and with a good software
you will get a very reliable config.
RS485 is my favourite and the best choice when the enviromental is noisy
and the distances are longger than 15m.
Humberto |
|
|
teix
Joined: 22 Mar 2005 Posts: 5 Location: Portugal
|
|
Posted: Tue Mar 22, 2005 1:01 pm |
|
|
rwyoung wrote: | Without knowing more about the environment where you expect these things to run, my knee-jerk reaction is to tell you that a RS-485 bus will be more robust (noise insensitive) than I2C with long cables. But I'm certian a poor RS-485 net is just as easy to create as a poor I2C net...
|
Thanks. The environement is a lab with a few small motors: not too noisy nor too quiet. As I2C have pullups that can be about 3k I guess is necessary lots of energy to induce a voltage enought to change the logic levell with such pullup. The RS485 as differential is best but seems to need more software: the CRC and separate data and adress and if I choose I2C all seems to me to be done in CCS I2C functions. |
|
|
rwyoung
Joined: 12 Nov 2003 Posts: 563 Location: Lawrence, KS USA
|
|
Posted: Tue Mar 22, 2005 1:06 pm |
|
|
If you go with the I2C stuff, look in the code library / snippit forum. Mark has put some good I2C master / slave code in there. _________________ Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month! |
|
|
teix
Joined: 22 Mar 2005 Posts: 5 Location: Portugal
|
|
Posted: Tue Mar 22, 2005 1:14 pm |
|
|
Humberto wrote: | Hi teix,
Transmiting data using either RS485 or I2C doesnīt matter at short
distances.
...
Never get an error
reported in years, the hardware is very simple and with a good software
you will get a very reliable config.
Humberto |
Thanks. It was my idea but was not sure: at short distances I can choose either but seems to me that I2C have easier software. |
|
|
teix
Joined: 22 Mar 2005 Posts: 5 Location: Portugal
|
|
Posted: Wed Mar 23, 2005 1:07 am |
|
|
rwyoung wrote: | If you go with the I2C stuff, look in the code library / snippit forum. Mark has put some good I2C master / slave code in there. |
Thanks a lot. Im curious about the possibilities of I2C for this application. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
Re: For a smart sensor probe : use I2C or RS422/485 ? |
Posted: Wed Mar 23, 2005 10:50 am |
|
|
teix wrote: | My design is a data acquisition system consisting of a mainframe that can accept one of a few sensors connected to the mainframe by a short cable (about 1 meter long).
The probe could have a small PIC to some processing and also include address and calibration data to identify which probe is connected. The CCS functions for I2C the probe needs : start , write and stop that can be software functions are implemented in a small PIC; in the main frame, I have more space for a PIC with hardware I2C as seems I need to use I2C_POOL.
My question is: this is a reasonable choice? Is I2C robust and acceptable outside a PCB, to transmit over a cable of 1 meter long or if more reliable to use RS422 or RS485 or even to use one wire with the PIC BUS described in the CCS manual?
For me the number of wires in the cable is not important, but easy software is.
Thanks for any advice . |
We use it to commuicate between boards at distances far greater than 1 meter. But if I were to design it, I would use RS485 |
|
|
teix
Joined: 22 Mar 2005 Posts: 5 Location: Portugal
|
Re: For a smart sensor probe : use I2C or RS422/485 ? |
Posted: Thu Mar 24, 2005 1:34 am |
|
|
Mark wrote: |
We use it to commuicate between boards at distances far greater than 1 meter. But if I were to design it, I would use RS485 |
Thanks Mark !
Probably my decision will be :
- Rs485 (when necessary opto-isolated) in the connection between each probe and the mainframe: using adress to identify the probe that is connected and the cable could also be longer when necessary;
- I2C between cards in the mainframe, as the trafic can be here more complex: seems to me the CCS software functions will do most of the job easily |
|
|
|