Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to get SOF, EOF, CRC etc of a CAN Frame.

Vindsan

New Member
I have a CAN device to which I am trying to communicate using a CAN Ethernet adapter. Adapter is the PCAN Ethernet Gateway DR. So I have set up the ID address and set everything up and then I communicated with the CAN device which is the IVTS from ISAscale using the PCAN software called PCAN View and it worked perfectly. But the problem is in the software I only need to enter the CAN ID and the Data and software calculates everything else like Start of Frame, CRC check, End of Frame etc. I am trying to write a program where I just send the entire CAN Frame via TCP/IP and receive its response., but I don't know how to calculate the entire CAN frame. I have the CAN ID and the Data to send from the datasheet of IVTS from ISAscale, but rest of the data for CAN frame I have no idea. Can you please educate forward me to any link or source on how to calculate the remaining stuff for a CAN frame. Thank you.
 
The CAN specification should be available from multiple sources. Here for example:

The SOF, or Start Of Frame is a single dominant bit. (see p. 43 of the CAN specification)

The EOF, or End Of Frame is a sequence of seven recessive bits (see p.14 of the CAN specification)

The CRC polynomial is:
1721918415075.png

(see p. 13 of the CAN specification)

Normally people don't worry about the details of a CAN frame that are handled in hardware when encapsulating a CAN frame inside another protocol. For example, I once developed a CAN to RS-232 to CAN bridge that worked flawlessly in both directions. This is all accomplished with the identifier, the data length, and the data. No other information needs to travel across the RS232 link.
 

Latest threads

New Articles From Microcontroller Tips

Back
Top