CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

For a smart sensor probe : use I2C or RS422/485 ?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
teix



Joined: 22 Mar 2005
Posts: 5
Location: Portugal

View user's profile Send private message

For a smart sensor probe : use I2C or RS422/485 ?
PostPosted: Tue Mar 22, 2005 4:36 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Tue Mar 22, 2005 8:27 am     Reply with quote

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... Wink

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! Very Happy
_________________
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

View user's profile Send private message

PostPosted: Tue Mar 22, 2005 8:28 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Mar 22, 2005 1:01 pm     Reply with quote

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... Wink



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

View user's profile Send private message Send e-mail

PostPosted: Tue Mar 22, 2005 1:06 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Mar 22, 2005 1:14 pm     Reply with quote

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. Smile
teix



Joined: 22 Mar 2005
Posts: 5
Location: Portugal

View user's profile Send private message

PostPosted: Wed Mar 23, 2005 1:07 am     Reply with quote

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

View user's profile Send private message Send e-mail

Re: For a smart sensor probe : use I2C or RS422/485 ?
PostPosted: Wed Mar 23, 2005 10:50 am     Reply with quote

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

View user's profile Send private message

Re: For a smart sensor probe : use I2C or RS422/485 ?
PostPosted: Thu Mar 24, 2005 1:34 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group