A similar story as for the Mustang. Let me therefore not to retell the whole story here.
Check /Assets/Images/ for the pinout and the CAN bus settings.
Don't worry 🙂 Just hit Alt-K to generate /Drivers/CMCIS/ and /Drivers/STM32G4xx_HAL_Driver/ based on the .ioc file. After a couple of seconds your project will be ready for building.
Termination (pull-together) resistors in ISO 11898-2, also called high-speed CAN (HS-CAN)1
- Why Are Termination Networks in CAN Transceivers So Important? (Texas Instruments)
- How to test if your CAN termination works correctly (Kvaser)
- Using termination to ensure recessive bit transmission (Kvaser)
- CAN Physical Layer and Termination Guide (NI)
The terminating resistors are there essentially to take care of two things: preventing reflections at the ends of the transmission line2 and enabling the recessive state of the bus to occur.
... and continue with some calculations to understand why the standard specifies the 120 Ohms terminators on both ends
- Dielectric Constants of Insulations
- Twisted-Pair Impedance Calculator (Farnell)
- AN5878 How to design a robust automotive CAN system (ST)
The parasitic capacitance of the bus then limits the transition speed from the dominant state to the recessive one. That is why the standard specifies cable max length for a given bitrate.
In the case of low speed, e.g. 125 kbps, and a short line (mine is less than 1 meter long), you can make it operational on a lab/home workbench even with a non-twisted pair and no termination resistor on the IPC side - the 120 Ohms termination on the transceiver evaluation board is sufficient. However, if you want to make the bus up to the specs, use a dedicated twisted pair and add the second termination.
Pull-up and pull-down resistors in ISO 11898-3, also called low-speed (LS) or fault-tolerant CAN (up to 125 kbit/s)
- CAN-Bus: Introduction and History (Altium)
- CAN Physical Layer and Termination Guide (NI)
- CAN Low Speed + interfejs High Speed = Sukces! (Systemy Wbudowane)
- Can High Speed vs. Can Low Speed - różnice między protokołami (Systemy Wbudowane)
- CAN Bus Explained - A Simple Intro [2024] (CSS Electronics)
- Determining the Necessary Termination Resistance for the Board (NI)
Easy to figure out if the relevant resistors are already the part of the device. Simply measure CAN_L to CAN_H, CAN_H to GND and CAN_L to V_DD resistances. If the pull-together resistor is present it is ISO 11898-2. If CAN_H is pulled down to GND and CAN_L is pulled up to V_DD it is ISO 11898-3. None of the two? You have to add the relevant resistors. Most evaluation boards popular among DIYers implement pull-together resistor or no resistors at all as they use a HS-CAN transceiver:
To use them with this particular IPC, i.e. the LS-CAN device, you have to remove the pull-together resistor and add the two resistors compliant with the fault-tolerant CAN. For some inspiration please visit /Assets/Images/. Obviously, the communication between the devices can go into the single-wire mode only if their transceivers are compatible with this mode. However, as long as both CAN_L and CAN_H lines are fully-functional, you don't need a fault-tolerant transceiver to successfully talk with the fault-tolerant one - the "regular" one will do the job equally well.
The same story applies to CAN sniffers. Their factory configuration is usually of HS-CAN type. However, you can easily retrofit them with just two resistors to make them talk to LS-CAN devices. Have a look at my MKS CANable V2.0 as an example of such a retrofit:
Bus failure management:
- Supports single-wire transmission modes with ground offset voltages up to 1.5 V;
- Automatic switching to single-wire mode in the event of bus failures, even when the CAN_H bus wire is short-circuited to V_CC;
- Automatic reset to differential mode if bus failure is removed;
- Full wake-up capability during failure modes.
What if a transceiver with the pull-together resistor is used? You will still be able to send messages to the IPC. However, you will be unable to read the ACK bit send by the cluster or any other messages send by the cluster. BTW, the exemplary code reads the brightness button on the left-hand side of the cluster and sets the brightness accordingly. The inability to read messages from the IPC would come from automatic switching to single-wire (single-ended, non-differential) mode in the event of bus failures. And yes, connecting the pull-together resistor to that IPC is correctly interpreted as a partial bus failure. Nevertheless, these are just my ramblings in case of you wondering what if. There is no point in mixing both approaches on one bus. Simply do it right and arrange the resistors on your side to reflect the physical layer on the IPC side.
Create your own home laboratory/workshop/garage! Get inspired by ControllersTech, DroneBot Workshop, Andreas Spiess, GreatScott!, ElectroBOOM, Phil's Lab, atomic14, That Project, Paul McWhorter, Max Imagination, and many other professional hobbyists sharing their awesome projects and tutorials! Shout-out/kudos to all of them!
Warning
Automotive hacking - do try this at home 😎
190+ challenges to start from: Control Engineering for Hobbyists at the Warsaw University of Technology.
Stay tuned!
Footnotes
-
Reflections of signals on conducting lines (Wikipedia) ↩