Controller Area Network (CAN)

Status
Not open for further replies.

Parth86

Member
Microcontroller send or receive data to other device using protocol's. CAN is one of them protocol. Does wireless communication happen between MCU and device when CAN used. Do we use CAN in automotive industry only. What are example of CAN in consumer electronics.
 
Does wireless communication happen between MCU and device when CAN used.
No.

Do we use CAN in automotive industry only.
No.

What are example of CAN in consumer electronics.
Google "CAN network applications" for plenty of examples.

These are questions you could easily answer for yourself with just a little bit of research, rather than asking others to spend their time finding the answers for you.
 
These are questions you could easily answer for yourself with just a little bit of research, rather than asking others to spend their time finding the answers for you.
I did google search before posting question. most of the example I found with engine or vehicle. That's what I said I was looking for example consumer electronics not for automotive industry.

I am trying to find out what's the special is in CAN that doesn't have in uart, i2c and spi
 

You need to have some idea of how each of these protocols work for things to have any meaning. It's not just enough to look up how CAN works. You need to look up how SPI, i2C, and UART/RS-485 roughly work in hardware and sotftware

You won't find CAN in consumer electronics because consumer electronics don't need to run communication cables hundreds of meters (or even a few meters) in a noisy environment where there are multiple devices sitting along the communication cable and more than one of them can be a master.

The physical layer of CAN is most similar to RS-485 which is a form of UART in that they are both asynchronous, half-duplex, differential transmission.

Unlike CAN, RS-485 does not have dominant/recessive states so messages cannot override each other. RS485 multi-master messages must collide and restart from the beginning, or the "permission" to be transmit must be passed around from one master to another. RS-485 also does not have addressing or priority or error checking. If you want any of these things in RS485 you must do it in software and consume CPU cycles (and some of these things like priority cannot be done in RS485 since RS485 doesn't have dominant/recessive logic states). These features are standardized in CAN which means that they can be, and are processed in hardware which is much more efficient.

The software layer of CAN has the most useful aspects of I2C, namely multi-master and dominant/recessive logic states which allow masters to talk over and override each other mid-communication.

Unlike CAN, I2C is synchronous, not differential, and not and is limited in speed due to the use of pull-ups to achieve it's dominant/recessive bits. Also, unlike CAN, I2C messages write to registers whereas CAN has "mailboxes".

You could create a multi-master scheme for RS-485 in software but it's clunky and inelegant and inefficient compared to CAN. This is because CAN has dominant/recessive logic states so it lets the highest priority CAN message talk over and override all lower priority messages currently being transmitted by other masters on the line. You can't do this with RS485. RS-485 multi-master systems must either detect message collisions and restart the message or pass the "permission" to transmit from master to another before the next master can transmit.

Basically, CAN combines the hardware aspects of RS-485 with the talk-over multi-master capability of I2C but also adds priority levels and error detection.

SPI is completely different. SPI is duplex, synchronous, not differential, and no dominant/recessive states. all of which are the opposite of CAN.
 
Last edited:
I am trying to find out what's the special is in CAN that doesn't have in uart, i2c and spi
If you Google "intro to can bus" you'll find links to all sorts of introductory material that will answer your questions.
 
Can is used on a couple of industrial machines where I work.
There are at least a couple of versions of Can.
One of the major differences in can and other busses is the fact that Can has a built in method to prioritize devices that request comms from the master device, the way Can is laid out automatically gives higher priority addresses access if 2 or more devices request at the same time, making it usefull for real time applications like vehicles.
 
Last edited:
What is the application if you dont mind me asking, a long time ago now, i used CAN or a form of it for model railway control. Its really frustrating to get going, but these days dedicated controllers make it a bit easier. If you need priority messages and alot of redundancy then CAN has its merits, but for alot of applications there is IMHO better (read much easier) ways to do things. Even Rs232 with hand rolled messages can be useful.

Without being condescending, if you got to ask the very basics on CAN, then expect a steep curve. I personally found it hard to debug, i think modern usb LA's have an advantage in this kind of situation however, how many nodes you looking at?
 
Wut? There was a time when CAN did not have dedicated controllers? I have never even heard of, let alone run into CAN that was not already in hardware.
 
Wut? There was a time when CAN did not have dedicated controllers? I have never even heard of, let alone run into CAN that was not already in hardware.
No sorry i was talking about the all in one things you get now. Not the pic CAN controllers on the chip, I have a silicon labs dev board for can, it has everything on it, simple plug and play....when i did my model rail it was pics and Can on the chip.
 
Ok i get it you want precise.

These days you can buy all in one solutions, before that you had to set up the chips and the addresses etc by software, again like the pic ones, it isnt as bad now with dedicated boards designed to do the grunt, i seen a couple with spi interfaces on!
 

OIC. When I hear CAN controller, I think a hardware peripheral on a MCU. It had sounded like you rolled your own in software somehow with some sort of hardware.
 
OIC. When I hear CAN controller, I think a hardware peripheral on a MCU. It had sounded like you rolled your own in software somehow with some sort of hardware.
No, I was comparing the what i would now call the raw hardware like the pic CAN peripheral, with more modern chips that seem to do it all with simple spi or whatever commands sent to them. With the pics you had to really read the data sheet, the newer all in one CAN chips seem much easier, but its still not something i would want to do lightly. Unless a small network, then you got to ask yourself if you really need CAN. Its great on cars and such, high speed and great redundancy, even multi loco model rail has some use, but honestly i think most things can be done with easier solutions, or maybe i tend to look for quick and easy these days as time gets shorter.....

Roll my own in software indeed!! Whatever next! lol Not so long ago i might have considered that fun, now i shudder lol
 
Please link to one of these all-in-one CAN chips. I have never seen one.
 
Please link to one of these all-in-one CAN chips. I have never seen one.
**** you want me to go on silicon labs and trawl through there now awful site???

Go have a look first, if you really cant find them then i will go find them for you. But honestly dont make me do something you can do.
 
https://www.silabs.com/products/development-tools/isolation/isolated-can-evaluation-kit

there is one kind of, go look on there now awful site, dont expect it under auto, because auto is now radio and things for seats etc, the mcu's with CAN are like pics except some the 8051 solutions, i tried the search thing but it didnt bring up the dev kits! I used to wing my way arounf there site hence why i used them so much! now the site is a non logical mess, but go do a search, if you really want simple CAN they have it, but finding it isnt easy, maybe go ask on the forum, they are helpful unlike the microchip site.

i know it sounds really rude of me, but honestly if i thought you really was looking for one to use i would expend the energy, but your not. Your trying to say they dont exist, i have told you where they do exist, i am not going to go photograph a unicorn when i told you where to find the unicorn!!

No I am not having a go at you! yes read alot of my older posts, i loved sil labs and have alot of there gear, no i dont use them any more because the site is just...............HORRID
rant off

they have better versions of mc's
MCP2515
or the spi thing from farnell. (not sure who makes that).
Seriously do a google there is loads about

I should have guessed this one
https://www.hobbytronics.co.uk/leonardo-canbus

Scrap farnell its the microchip controller one with spi interface.

you see my point though, you no longer have to worry about the interface, its all on the chip.

One i didnt know about!
https://www.nxp.com/docs/en/brochure/75017405.pdf

Seems pretty all in one to me.

try and copy that with say two 18f4685 micros.
like not so long ago...

or try some of these
https://www.nxp.com/products/analog...work/can-transceiver-and-controllers:MC_53485

The main point is, with a micro like a pic, you set up the mode, you set if or when it receives or transmits etc etc etc, with the all in ones you dont, you simply use the interface to send the message and the controller does the leg work, or am i talking gibberish again?

I know you know about these chips, i dont get why you say you havnt seen them??????
 
Last edited:
I know you know about these chips, i dont get why you say you havnt seen them??????
You're right, I have seen them. But the way you described them was completely unlike the way I perceive them so I thought you were talking about something different lol. I find it far easier to write and read the CAN registers inside the peripheral on an MCU directly with my code than to essentially do the same thing to another device over an SPI connection. You were extolling the ease of use versus the internal CAN peripheral so I thought you were talking about something else entirely lol.

So it seems that when we say CAN controller, we actually do mean the same thing (just internal or external). Just the way you described an external CAN controller was entirely unlike what I actually thought of an external CAN controller.
 
Last edited:
Ah got ya!!

No two different applications and types of people. Few people are like you, pommie,Ian etal. Even me to some extent, roll up the sleeves READ the data sheet and manually set up the chips in code. These days its find a lib on the net normally arduino based and use that to run a CAN network, so the external chips that can be controlled via spi offer the ability for people who cant code to set up a network. You use the arduino or whatever RDE to talk to the chip and do the work.

having said that, there is a sil labs chip that is entirely plug and play, its a transceiver with a micro inbuilt, alot like there transceiver radio micros. But anything more than 12 months old seems really hard to find these days on there site.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…