-
Notifications
You must be signed in to change notification settings - Fork 47
Teensy 4 Can Device
The volvo-cem-cracker project is based on a Teensy 4 microcontroller, but any Arduino board that is above 150/200 MHz and has built-in CAN controllers should work. It utilizes two CAN transceivers for communication with the car's Central Electronic Module (CEM). There are many distinct types of CAN transceivers available, both in 3.3V and 5V varieties, but it is important to ensure that the logic level of the Arduino board and the CAN transceiver match. Using a 5V logic on a 3.3V board can cause damage to the microcontroller. Bench Cracking could possibly get away with only HS Can as the LS can connection is to silence the bus only.
When powering the volvo-cem-cracker device, either from an external power source or the OBD2 port, you will need to cut the trace on the back of the Teensy that separates the USB 5V and the 5V from the pin. Alternatively, you can cut the red 5V power cable inside a micro-USB cable to prevent mixing the 5V from the USB and the 5V running the board, this created cable is called the special USB cable. Please note this cable is only for when the device is working in the car and running from external power!
Power should be at least a couple of amps to make sure sufficient power is always available, ideally a buck dc-dc inverter drawing 12v from the obd2 port. any >2amp power supply will work but make sure the ground is shared between all devices to make sure there are no communication problems.
SN65HVD230 transceivers are ideal although some members have found 5v transceivers have worked where 3.3v ones haven't so if your setup isn't working and its not a wiring fault then swapping for a 5v model with a logic level shifter between it and the teensy. Generally if the chip has canH canL and the rx tx pins for the teensy it should work.
Teensy 4 is the device this code was written for specifically although multiple users have reported the 4.1 teensy also works fine. Generally, if neither is available it can be replaced with similar, minimum of 150/200mhz and built in can controllers as these would add more complexity and points of failure if external to the Arduino board. esp32 based devices do not work due to signalling issues!
This part is very generic, any obd2 cable or male connector should work though the cheaper cables don't generally twist the can lines which can mess with the process Can should be twisted all along the cables if possible as it's a differential signal.
Can should be twisted for as much of the length as possible, cat 5e or 6 cables are good for this as they are pre-twisted and are designed to be a similar impedance to CAN, power cables should be the right gauge to effectively distribute power etc.