Embedded Protocol CAN

  • CAN – Controller Area Network
  • Developed by Robert Bosch.
  • Serial Communication
  • Half-duplex communication.
  • Asynchronous Type.
  • Multi-master protocol – allowing it to connect multiple nodes
  • Its Message Based.
  • Two-wire configuration, consisting of CAN H (H-High) and CAN L (L-Low). Two-wire bus interconnects all nodes within the network. The wires typically constitute a twisted pair with a nominal impedance of 120 Ω.
  • CAN supports communication over relatively short distances, typically up to 40 meters at speeds of 1 Mbps
  • CAN Frame formats: CAN 2.0A and CAN2.0B

Protocol Frame Format

SOF11-BitIdentifierRTRIDEr0DLC0…8 bytesCRCACKEOFIFS

AcronymLenth(BitsDescription
SOF1Start Of Frame
11 Bit Identifier11Establishes message priority; lower binary value indicates higher priority
RTR1Remote Transmission Request
IDE1Identifier Extension
r01Reserved Bit
DLC4Data Length Code
0…8 Bytes0 to 64
(8Byte Max)
Data Bytes
CRC15Cyclic Redundancy Check
ACK1Acknowledgement
EOF7End Of Frame
IFS37-Bit Interframe Space
CAN-bus-frame-with-stuff-bit-and-correct-CRC

Analyzer by Microchip 

Get Start

  1. Connect CAN_H, CAN_L, and Ground to the Microchip CAN Analyzer Hardware along with the testing hardware (Microcontroller).
  2. Open the Windows tool and navigate to Microchip CAN BUS Analyzer.
  3. Ensure that Normal Mode and Error Normal display a green background.
  4. Proceed to Setup Hard > Hardware Setup > Set CAN bit-rate control.
  5. Configure Logfile setup if you intend to log the CAN data.
  6. Click Rolling Trace to initiate the monitoring process.
  7. You can now observe the captured data within the tool interface.


USB to CAN Bus Adapter by VSCOM


Troubleshoot

If you’re not getting any data or can’t see any data in the tool?

TaskDescription
Check hardware connectionsEnsure all hardware connections are properly connected.
Verify CAN driver settingsConfirm that all CAN drivers are enabled.
Configure Interrupts using HALCoGen toolEnsure Interrupts are correctly configured in the HALCoGen tool for the TMS570LC4357 Controller.

Applications

ApplicationDescription
Automotive IndustryExtensively used for communication between electronic control units (ECUs) in vehicles, enabling functions like engine management, diagnostics, and ADAS.
Industrial AutomationEmployed in factory automation systems for communication between PLCs, sensors, actuators, and other devices, facilitating manufacturing processes.
Medical DevicesUtilized in medical equipment for communication between devices such as patient monitors, infusion pumps, and diagnostic equipment.
Aerospace and DefenseUsed for communication between avionics, navigation systems, flight control systems, and other electronics in aircraft, spacecraft, and military vehicles.
Marine and MaritimeEmployed in marine applications for communication between navigation systems, propulsion systems, and monitoring equipment on boats and ships.
Home AutomationIncreasingly used for communication between smart devices, home appliances, security systems, and environmental controls in residential settings.
Electric VehiclesIntegral to the communication network in electric and hybrid vehicles, enabling coordination between powertrain components and battery management systems.
Rail TransportationUtilized for communication between train control systems, signaling systems, passenger information systems, and onboard electronics in railway operations.

Advantage and Disadvantage

AdvantagesDisadvantages
High reliability and fault toleranceHigher cost compared to some other protocols
Real-time capability, suitable for time-critical applicationsRequires termination resistors and careful network design
Support for multi-master communicationLimited maximum cable length without additional hardware
Flexible data rates and message prioritizationMore complex implementation compared to simpler protocols
Built-in error detection and handling mechanismsPotential electromagnetic interference in noisy environments
Wide industry adoption and supportLimited support for longer-distance communication without additional hardware

CAN Interview Questions

Please turn AdBlock off, and continue learning

Notice for AdBlock users

Please turn AdBlock off
Index

Discover more from ArunEworld

Subscribe now to keep reading and get access to the full archive.

Continue reading