• AVR Freaks

Helpful ReplyHot!What can we do with CAN and LIN?

Page: 12 > Showing page 1 of 2
Author
WeHongKongers
Super Member
  • Total Posts : 268
  • Reward points : 0
  • Status: offline
2020/10/22 04:25:56 (permalink)
1 (2)

What can we do with CAN and LIN?

Hello Guys,
I find that they are shown to work with cars -
Controller Area Network (CAN) and Local Interconnect Network (LIN)
 
As you know, developing a product to work with car is not simple.  One must work in the car manufacturers or have much resources and equipments to test on cars.
 
Now, I raise a question - what can we do with CAN and LIN besides applications in car?
 
#1
ric
Super Member
  • Total Posts : 28943
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: What can we do with CAN and LIN? 2020/10/22 04:31:00 (permalink) ☄ Helpfulby WeHongKongers 2020/10/22 04:44:13

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#2
WeHongKongers
Super Member
  • Total Posts : 268
  • Reward points : 0
  • Status: offline
Re: What can we do with CAN and LIN? 2020/10/22 04:44:05 (permalink)
-2 (2)
Ric,
They sound very specific.
 
CAN should be able to drive a Cruise Missile.
 
 
post edited by WeHongKongers - 2020/10/22 04:45:50
#3
Antipodean
Super Member
  • Total Posts : 1941
  • Reward points : 0
  • Joined: 2008/12/09 10:19:08
  • Location: Didcot, United Kingdom
  • Status: offline
Re: What can we do with CAN and LIN? 2020/10/22 05:12:04 (permalink) ☄ Helpfulby WeHongKongers 2020/10/23 05:37:48
0 (2)
They are both very general communication systems. 
 
I am aware of CAN being used on everything from model railway controllers (at least three different manufacturers come to mind) to spacecraft.
 
LIN is a useful serial protocol to use where it is nice to cut costs by not having a crystal and the protocol automatically works out the baud rate of the transmitting device.
 

Do not use my alias in your message body when replying, your message will disappear ...

Alan
#4
Mysil
Super Member
  • Total Posts : 3947
  • Reward points : 0
  • Joined: 2012/07/01 04:19:50
  • Location: Norway
  • Status: online
Re: What can we do with CAN and LIN? 2020/10/22 05:30:42 (permalink) ☄ Helpfulby WeHongKongers 2020/10/23 05:37:56
+2 (2)
Hi,
Both CAN and LIN  are just communcation. 
 
There is communication between different devices from different manufacturers that make for all the standard and specification documents with tables of messages and priorities, for different purposes.
 
You may use either one or the other to communicate between devices of your own design,
and for your own purposes.
Both put some effort in making sure that communication is correct,
but do not try to hide contents of communication. You may add encryption of the contents in software. 
 
Or you may listen in on what is going on in your car or boat network.
There are application notes and demo code around. There may be open source application code for some areas.
 
    Mysil
#5
katela
Super Member
  • Total Posts : 1905
  • Reward points : 0
  • Joined: 2013/06/11 05:25:18
  • Location: South Africa
  • Status: offline
Re: What can we do with CAN and LIN? 2020/10/22 06:20:51 (permalink) ☄ Helpfulby WeHongKongers 2020/10/23 05:38:06
+1 (1)
They are just communication systems. If they fit in your application requirement, you can use them, it doesn't have to be in automotive.
The automotive industry use them because they fit in their environment.
You can easily exchange sensor data between two microcontrollers with CAN bus for example! The chose of whether to use I2C, SPI, USART, etc in this case will depend on various factors, such as bit rate, distance, noise, etc. 

Free online Microcontroller Tutorials and Projects for Hobbyists and students. From beginners to advanced. Website: www.studentcompanion.co.za
YouTube Tutorials: https://www.youtube.com/StudentCompanionSA
#6
NKurzman
A Guy on the Net
  • Total Posts : 19023
  • Reward points : 0
  • Joined: 2008/01/16 19:33:48
  • Location: 0
  • Status: offline
Re: What can we do with CAN and LIN? 2020/10/22 07:07:00 (permalink) ☄ Helpfulby WeHongKongers 2020/10/23 05:38:29
+1 (1)
J1939 is CAN for Communication in large Trucks. It is not proprietary.
If you look at other CAN protocols you will find that they are often dedicated to specific industries.
#7
crosland
Super Member
  • Total Posts : 2091
  • Reward points : 0
  • Joined: 2005/05/10 10:55:05
  • Location: Warks, UK
  • Status: offline
Re: What can we do with CAN and LIN? 2020/10/22 10:08:30 (permalink) ☄ Helpfulby WeHongKongers 2020/10/23 05:38:46
+2 (2)
katela
The automotive industry use them because they...

 
...were invented for automotive use, by Bosch.
 
CAN is also very common in industrial control.
#8
JPortici
Super Member
  • Total Posts : 1202
  • Reward points : 0
  • Joined: 2012/11/17 06:27:45
  • Location: Grappaland
  • Status: offline
Re: What can we do with CAN and LIN? 2020/10/22 11:10:25 (permalink) ☄ Helpfulby WeHongKongers 2020/10/23 05:38:57
+1 (1)
CAN is RS 485 with a bunch of goodies on it. Made by bosch so it's used in everything automotive, but what alternatives are there, really?
It's (relatively) simple and robust and cheap.
I tend to design it into products if i have a network of boards broadcasting data
 
For faster there is (now) CAN FD.
For cheaper there is LIN. (and they are throwing new LIN networks in unforseen places now that even the door handle is canbus).
For application specific there is SENT.
For backbone/high data bandwidth, flexray never really got off but we have MOST, ethernet and optic fibre for multimedia, ADAS and ECU programming
#9
crosland
Super Member
  • Total Posts : 2091
  • Reward points : 0
  • Joined: 2005/05/10 10:55:05
  • Location: Warks, UK
  • Status: offline
Re: What can we do with CAN and LIN? 2020/10/22 11:28:31 (permalink)
+1 (1)
Jack_M
CAN is RS 485 with a bunch of goodies on it.



Not really. The signalling levels are completely different for a start.
 
#10
JPortici
Super Member
  • Total Posts : 1202
  • Reward points : 0
  • Joined: 2012/11/17 06:27:45
  • Location: Grappaland
  • Status: offline
Re: What can we do with CAN and LIN? 2020/10/22 12:38:44 (permalink)
-1 (1)
My bad, I was oversemplifying. I should have said "Think of CAN as RS495 with a bunch of goodies"
#11
Mysil
Super Member
  • Total Posts : 3947
  • Reward points : 0
  • Joined: 2012/07/01 04:19:50
  • Location: Norway
  • Status: online
Re: What can we do with CAN and LIN? 2020/10/22 13:02:11 (permalink)
0
RS485 have 2 signal states that are symmetric and opposite.
 
CAN have 2 signal states where one state is active, dominant with both lines driven, one High and the other Low.
The other signal state is passive, recessive with signal level pulled together by resistors.
This have some properties simlar to Open Collector party line,
and allow CAN messages with higher priority to override other messages.
It also give a possibility to distinguish if a message is Acknowledged by one or more receivers, or Not at all.
Also CAN is designed as a true Peer to Peer protocol, where any device may send a message,
and any device may acknowledge if the message is relevant.
Messages are labeled with the type of information they contain, not nessesarily the identity of the receiver.
 
    Mysil
#12
upand_at_them
Super Member
  • Total Posts : 739
  • Reward points : 0
  • Joined: 2005/05/16 07:02:38
  • Location: Pennsylvania
  • Status: online
Re: What can we do with CAN and LIN? 2020/10/22 13:15:43 (permalink)
0 (2)
HKPhysicistNow, I raise a question - what can we do with CAN and LIN besides applications in car?
 

 
This is rather a pointless question.  Find something that you want to do, THEN go about figuring out how to do it.
 
#13
Antipodean
Super Member
  • Total Posts : 1941
  • Reward points : 0
  • Joined: 2008/12/09 10:19:08
  • Location: Didcot, United Kingdom
  • Status: offline
Re: What can we do with CAN and LIN? 2020/10/22 14:39:22 (permalink)
-1 (1)
crosland
Jack_M
CAN is RS 485 with a bunch of goodies on it.

Not really. The signalling levels are completely different for a start.

 
Umm, not for standard CAN transceivers, unless you are operating the transceivers at a very different voltage to not mal logic levels.
 
In a space craft instrument we used a space qualified RS485 transceiver as a CAN transceiver by fiddling the signals on the cpu side so that we had the proper dominant/recessive operation.
 
Apart from the dominant/recessive hardware function the major difference to most other protocols is the message flags at the beginning of the message, and the 8 byte limit per frame (greater on CANFD I believe).
 

Do not use my alias in your message body when replying, your message will disappear ...

Alan
#14
crosland
Super Member
  • Total Posts : 2091
  • Reward points : 0
  • Joined: 2005/05/10 10:55:05
  • Location: Warks, UK
  • Status: offline
Re: What can we do with CAN and LIN? 2020/10/23 02:32:24 (permalink)
0
Mysil
RS485 have 2 signal states that are symmetric and opposite.
 
CAN have 2 signal states where one state is active, dominant with both lines driven, one High and the other Low.
The other signal state is passive, recessive with signal level pulled together by resistors.

Correct.
 
Mysil
Messages are labeled with the type of information they contain, not nessesarily the identity of the receiver.

Nothing to do with the CAN spec wich only defines the physical layer. There are lots of different protocols that determine what the messages mean and what they contain.
#15
crosland
Super Member
  • Total Posts : 2091
  • Reward points : 0
  • Joined: 2005/05/10 10:55:05
  • Location: Warks, UK
  • Status: offline
Re: What can we do with CAN and LIN? 2020/10/23 02:36:50 (permalink)
0
Ant.i.p.o.d.ean
crosland
Jack_M
CAN is RS 485 with a bunch of goodies on it.

Not really. The signalling levels are completely different for a start.

 
Umm, not for standard CAN transceivers, unless you are operating the transceivers at a very different voltage to not mal logic levels.

See Mysil's answer in post #12
 

In a space craft instrument we used a space qualified RS485 transceiver as a CAN transceiver by fiddling the signals on the cpu side so that we had the proper dominant/recessive operation.

Without seeing a schematic it's difficult to comment on what you did but the fact remains the signalling is incompatible. You may have used RS485 transceivers as PHYs with CAN controllers, but did you mix this on a CAN segment with normal CAN transceivers or was it a closed system? If the latter then it probably wasn't CAN.
 
#16
Antipodean
Super Member
  • Total Posts : 1941
  • Reward points : 0
  • Joined: 2008/12/09 10:19:08
  • Location: Didcot, United Kingdom
  • Status: offline
Re: What can we do with CAN and LIN? 2020/10/23 04:41:28 (permalink)
0
crosland
Ant.i.p.o.d.ean
crosland
Jack_M
CAN is RS 485 with a bunch of goodies on it.

Not really. The signalling levels are completely different for a start.

 
Umm, not for standard CAN transceivers, unless you are operating the transceivers at a very different voltage to not mal logic levels.

See Mysil's answer in post #12

 
Yup, and what he describes is a differential signal  pulled one way by active devices and the other way by resistors. CAN also requires a terminator at each end of the bus which limits the differential voltage in the recessive state.
 

In a space craft instrument we used a space qualified RS485 transceiver as a CAN transceiver by fiddling the signals on the cpu side so that we had the proper dominant/recessive operation.

Without seeing a schematic it's difficult to comment on what you did but the fact remains the signalling is incompatible. You may have used RS485 transceivers as PHYs with CAN controllers, but did you mix this on a CAN segment with normal CAN transceivers or was it a closed system? If the latter then it probably wasn't CAN.
 
 
Well they used standard CAN interfaces for bench testing. I believe the basic schematic was provided by the team we were interfacing with. IIRC it basically involved driving the tristate or direction pin with the tx signal either grounding or tying high the normal transmit data pin (I don't recall which).
 
As a side issue to this if using a polled serial protocol on an RS485 signal a CAN transceiver can be used so one doesn't need to fiddle with a direction pin.
 
 

Do not use my alias in your message body when replying, your message will disappear ...

Alan
#17
WeHongKongers
Super Member
  • Total Posts : 268
  • Reward points : 0
  • Status: offline
Re: What can we do with CAN and LIN? 2020/10/23 05:36:15 (permalink)
-2 (2)
upand_at_them
HKPhysicistNow, I raise a question - what can we do with CAN and LIN besides applications in car?
 

 This is rather a pointless question.  Find something that you want to do, THEN go about figuring out how to do it.
 



Because my question is not from an engineer's viewpoint.  I reverse the procedure.
 
I like to put many tools in front of me and see what new things can be cooked from these tools.
#18
crosland
Super Member
  • Total Posts : 2091
  • Reward points : 0
  • Joined: 2005/05/10 10:55:05
  • Location: Warks, UK
  • Status: offline
Re: What can we do with CAN and LIN? 2020/10/23 06:29:34 (permalink)
+1 (1)
Ant.i.p.o.d.ean
crosland
Ant.i.p.o.d.ean
crosland
Jack_M
CAN is RS 485 with a bunch of goodies on it.

Not really. The signalling levels are completely different for a start.

 
Umm, not for standard CAN transceivers, unless you are operating the transceivers at a very different voltage to not mal logic levels.

See Mysil's answer in post #12

 
Yup, and what he describes is a differential signal  pulled one way by active devices and the other way by resistors. CAN also requires a terminator at each end of the bus which limits the differential voltage in the recessive state.
 
 



No, what he describes is CAN signalling.
 
RS485 is a differential bus. Logic 1 and 0 are signalled by nominally equal and opposite differential voltages between the two line.
 
CAN terminology uses dominant and recessive. In the dominant state there is a positive differential between CANH and CANL. In the recessive state there is nominally zero voltage between them due to the terminators that connect between CANH and CANL (can actually be a few 10s of mV +ve or -ve). See parameters D12 and D13 in the MCP2551 data sheet. 
 
 
#19
ric
Super Member
  • Total Posts : 28943
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: What can we do with CAN and LIN? 2020/10/23 14:57:22 (permalink)
0
Dummy post to try to suppress blinking page#2 (probably caused by someone leaving "Anti-podean's" username in a quote)

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#20
Page: 12 > Showing page 1 of 2
Jump to:
© 2020 APG vNext Commercial Version 4.5