Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 04, 2016, 02:50:49 02:50


Login with username, password and session length


Pages: [1]
Print
Author Topic: RS485 or CAN ?  (Read 3579 times)
0 Members and 1 Guest are viewing this topic.
quqnuss
Newbie
*
Offline Offline

Posts: 8

Thank You
-Given: 3
-Receive: 0


« on: November 01, 2007, 05:42:53 17:42 »

hello everyone,

first of all, because I couldn'st search in the forum that's why I am opening this topic .. so if it exist already, let me know and delete this topic.

I am told to build communication network among controllers. Coumputers could also be included, but if then in future, so computer inclusion is not that important right now.

can anyone write his/her experience about using CAN or RS485 as communication protocol ?
which one is better and why ?
any practical example schematic/project ?

regards.
Logged
chrisdodge
Newbie
*
Offline Offline

Posts: 9

Thank You
-Given: 5
-Receive: 4


« Reply #1 on: November 01, 2007, 07:59:12 19:59 »

RS485 is only a "physical" protocol ... it offers only data transport ... Easy to use, easy to hardware implement (just put RS485 differencial driver behind your PC or µC uart output.

CAN is far better than RS232/RS485 :
- multimaster protocol
- hardware CRC data error checking and recovering
- hardware auto Retry
- faster

But a lot of overhead .... 80 bits of payload out of 128 bits packet !



Logged
phamthaihoa
Newbie
*
Offline Offline

Posts: 8

Thank You
-Given: 8
-Receive: 2


« Reply #2 on: November 01, 2007, 08:07:05 20:07 »

hello everyone,

first of all, because I couldn'st search in the forum that's why I am opening this topic .. so if it exist already, let me know and delete this topic.

I am told to build communication network among controllers. Coumputers could also be included, but if then in future, so computer inclusion is not that important right now.

can anyone write his/her experience about using CAN or RS485 as communication protocol ?
which one is better and why ?
any practical example schematic/project ?

regards.

You can find sample project and schematic in www.mikroe.com
Logged
Lumos
Junior Member
**
Offline Offline

Posts: 89

Thank You
-Given: 63
-Receive: 11


« Reply #3 on: November 02, 2007, 05:39:05 05:39 »

hi,
My Homeautomation, I have control with RS485 built.
1 Master (18F252) and 10 slaves (18F4433,16F628...) to work without problems.
Very easy handling
Programmed in Proton Basic.
Logged
mcr
V.I.P
Junior Member
*****
Offline Offline

Posts: 84

Thank You
-Given: 185
-Receive: 22


« Reply #4 on: November 02, 2007, 07:05:52 07:05 »

RS485 is your choice.


RS485 is only a "physical" protocol ... it offers only data transport ...
CAN is far better than RS232/RS485

To use CAN, you should understand first how the info is transmited and received, the physical layer: the protocol.

If your assigment (looks like you're in school) is to just communicate devices, RS485 is your choice; you still have to document yourself on the protocol to see the implementation of it.

Go to http://www.bb-elec.com/tech_articles/rs422_485_app_note/table_of_contents.asp for the info.
Logged
Ret12_12
Junior Member
**
Offline Offline

Posts: 75

Thank You
-Given: 104
-Receive: 32


« Reply #5 on: November 02, 2007, 06:12:06 18:12 »

hi,
My Homeautomation, I have control with RS485 built.
1 Master (18F252) and 10 slaves (18F4433,16F628...) to work without problems.
Very easy handling
Programmed in Proton Basic.

Hi,

Whats happed in case if 2 or more slave try to transmitted at the same time ?

Can you please share the code when transmit and when receive ?
Logged
micro_tools
Guest
« Reply #6 on: November 02, 2007, 08:17:14 20:17 »


1) rs 485 network is typicali one master and many slave
2) on CAN bus collision is handled at hardware level

Best regards
micro_tools

Logged
mcr
V.I.P
Junior Member
*****
Offline Offline

Posts: 84

Thank You
-Given: 185
-Receive: 22


« Reply #7 on: November 02, 2007, 10:08:13 22:08 »

Whats happed in case if 2 or more slave try to transmitted at the same time ?


Read this:
http://www.bb-elec.com/tech_articles/rs422_485_app_note/table_of_contents.asp



Can you please share the code when transmit and when receive ?

If you read the application note you'll notice the lack of "code" of this protocol. If you want code you must define what is it that you want to communicate, and with what.

Please, read the application note.
Logged
Lumos
Junior Member
**
Offline Offline

Posts: 89

Thank You
-Given: 63
-Receive: 11


« Reply #8 on: November 03, 2007, 10:47:17 10:47 »

Hi Ret12_12

Already in the program, it is excluded, which is 2 slaves report
Logged
mana111
Newbie
*
Offline Offline

Posts: 28

Thank You
-Given: 9
-Receive: 6


« Reply #9 on: November 04, 2007, 01:15:15 13:15 »

Hi Ret12_12

Already in the program, it is excluded, which is 2 slaves report

Can you please upload the circuits also??
Logged
Lumos
Junior Member
**
Offline Offline

Posts: 89

Thank You
-Given: 63
-Receive: 11


« Reply #10 on: November 05, 2007, 09:43:22 09:43 »

Hi mana111

I do not, so what if you can start.
Is specially tailored to me.
Very properly, it is also not, but see themselves
Logged
microled
Newbie
*
 Muted
Offline Offline

Posts: 11

Thank You
-Given: 15
-Receive: 2


« Reply #11 on: November 20, 2007, 10:56:57 22:56 »

485 is easier to use and implement
can lots of overhead harder to implement but much more powerful
Logged
piclover
Newbie
*
Offline Offline

Posts: 29

Thank You
-Given: 26
-Receive: 97


« Reply #12 on: November 22, 2007, 01:19:29 13:19 »

I have expirience with RS485: PIC16F877A as a master and on other side PIC16F876A as a slave. Speed is 115200 b/s. As converter is SN75176. No problem at all  Smiley
Logged
Math
Guest
« Reply #13 on: November 22, 2007, 10:34:03 22:34 »

RS485 or CAN, it really depends on the application where you wanna use it. If you want to make a apllication with cars it would be the best to use CAN, but in your case I would prefer RS485.
Logged
jorge7458
Newbie
*
Offline Offline

Posts: 27

Thank You
-Given: 7
-Receive: 14


« Reply #14 on: November 26, 2007, 06:54:58 18:54 »

Hello a quite common confusion exists: 
DOG is a protocol that defines the message (bit,bps,crc,etc) and 485 are an electric norm, you cannot compare one with other. - 
It is as comparing RS232 with MODBUS. - 
I wait they have understood each other 
Jorge
Logged
micropar
Active Member
***
Offline Offline

Posts: 173

Thank You
-Given: 44
-Receive: 13


« Reply #15 on: November 26, 2007, 07:32:50 19:32 »

hi all,

RS-485 is very low level embedded micro's network, but easy to implement with 9 bit Master-slave protocol, first implemented by our Father of Micros, Intel, as Bitbus in 70s.

CAN is robust protocol with its own hardware standard and automatic error detections, originated in 90s by BOSCH for in car communication, but needs upper level application support or firmware library such as CAN-Open or CAN-Kingdom for its full and efficient utilization.

Is any one has ready made source codes for above 485 and CAN to try with PICmicros?

Thanks in advance,

Regards,
--micropar--
Logged
yoda
V.I.P
Junior Member
*****
Offline Offline

Posts: 58

Thank You
-Given: 609
-Receive: 17


« Reply #16 on: December 14, 2007, 06:28:34 18:28 »

Hi quqnuss ,

You should choose RS485, CAN is to much overhead for your need (if you want to communicate between microcontrollers).
If you make one station the master, and give all the other ones a name as slave (slav01. slav02 and so on) you can setup a simple network by letting anyone talk to the master only, and only if they are requested to, by the master.
The master distributes all the data then. You can program this for a normal serial output but then convert it to RS485 (with a MAX485 ic) to get balanced lines.
These 2x 2 balanced lines should be distributed to all stations (several hundred meters max.), including a ground or return line to be secure. On the software side you only have to resolve the problem that only one station at the time is transmitting (all others are listening).
This can be arranged because only the master takes initiatives (by polling the slaves sequencially), the slaves only answer if they recoqnise their own name.
Good luck.

p.s. I have in the past, transfered data over 19 Km distance this way, using rented ordinary tel. lines, and a baudrate low enough.
« Last Edit: August 01, 2008, 10:38:38 10:38 by yoda » Logged
benco
Newbie
*
Offline Offline

Posts: 8

Thank You
-Given: 5
-Receive: 0


« Reply #17 on: May 02, 2008, 11:08:14 23:08 »

We had some job in the fabric and two computers  communicated with RS485 on 700 meters /shield cable 4x1 cuprum/
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC