CAN Communication Protocol

Thread Starter

umerrai1

Joined Mar 29, 2021
246
Hi Everyone,

Hope everybody is doing great.

I want to ask that does anybody has experience in CAN communication protocol?
 

Thread Starter

umerrai1

Joined Mar 29, 2021
246
Thank you for the reply. I am new to it please excuse me for asking any useless question.

I have a sensor which is using CAN protocol. Can I convert this into RS232 protocol or ttl logic?
 

Ian0

Joined Aug 7, 2020
9,677
I’d suggest a MCU with a CAN module to receive the data, then you could re-output it however you like. That is relatively easy, when you get to know your MCU’s CAN interface.
Otherwise, it’s going to be tricky - there isn't a viable hardware solution.
With a CAN transceiver IC you can convert the data stream to TTL levels, but for CAN to work, something has to insert the acknowledge pulse at exactly the right time, otherwise the sender will retransmit indefinitely.
Then you have to decode the data which is a continuous data stream of about 60 bits, for which you need very accurate clock timing.
Wikipedia explains the data timing.
https://en.wikipedia.org/wiki/CAN_bus#Data_frame
 

Papabravo

Joined Feb 24, 2006
21,159
Thank you for the reply. I am new to it please excuse me for asking any useless question.

I have a sensor which is using CAN protocol. Can I convert this into RS232 protocol or ttl logic?
Yes, this is pretty straightforward using a microcontroller with both a CAN Controller and a UART (Universal Asynchronous Receiver Transmitter). I have actually done this.
I don't think the ATMega 2560 has an onborad CAN controller. That is not a problem if the board has an external CAN controller because I know it has two UARTs.
 

Ian0

Joined Aug 7, 2020
9,677
Yes. That’s got a Microhip MCP2515 in it which is like the CAN module in many MCUs. It communicates to you MCU via the SPI interface.
Read the datasheet carefully, and don’t get confused between Message Number and Message Buffer Number.
Do you know the CAN message number that you are trying to receive?
 

Thread Starter

umerrai1

Joined Mar 29, 2021
246
Thank you for the support. I am looking into it. I put this project aside for a while. I still have other projects to complete. After completion of these projects, I will look into it.
 
Top