Can bus basics #
If not familiar with CAN bus, this might come handy at first : https://en.wikipedia.org/wiki/CAN_bus
CAN bus wiring and termiantion #
CAN bus consists of two wires – CAN H and CAN L
Devices that are on the end of the bus, must have “termination” – termination is the 120Ohm resistor. Goal is to have about 60Ohms of resistance when measuring between CAN Hi and CAN Lo. Without that – CAN bus communication will be dead.
CAN bus speed #
When configuring CAN bus, You need to specify CAN bus speed of each module.
Be sure that all devices connected to same bus must have same CAN bus speed selected. If device which is only listening to CAN bus have wrong speed set – this device will not see any message. If device which is transmitting data over CAN bus have wrong speed set up – it may brake whole CAN bus communication.
CAN data coding #
CAN Data frame has maximum length of 8 bytes.
For example D7 and D6 from HEX to BIN is 1101 0111 1101 0110 (16bits), and this 2 bytes are used to transfer some data.
Depending of the endianness bytes will be read from left to right (D7->D0) or from right to left (D7<-D0). While assigning data to specified bytes we use offsets and lengths. Length tells us on how many bytes or bits our information is transferred and offsets tell us exactly where it is located. Offset is always from left to right no matter the type of endianness.
For example RPM read from right to left located on D7 and D6 will be read 1101 0110 (D6) 1101 0111 (D7).
Summing everything up : We know ECU sends some data for us at D4 and D3 with right to left endianness we must select Little-endian, offset = 3 and length = 2.
GCU CAN settings #
Inputs and outputs configuration fields :
- CANbus module – on which canbus module frame should be transmitted/received
- Alias
- Frame type – select type of frame :
- Standard (11 identifier bits)
- Extended (29 identifier bits)
- Frame ID – id of the frame, in HEX, preceded by “0x”
- Data type – format for decoding/coding data in input/output.
- Bitfield – allows to pass positive integer values. BUT Offset and length is specified in BITS not BYTES
- Signed BE(big endian)/LE(little endian) – allows to pass negative and positive integer values
- Unsigned BE/LE – allows to pass only positive integer values
- Float BE/LE – allows to pass floating point numbers – INPUTS ONLY
- Other – used for shifter/dash configuration
- Hidden – used for shifter/dash configuration
- Bit counter field – used for shifter/dash configuration – OUTPUTS ONLY
- BMW e46 M3 Checksum – used for shifter/dash configuration – OUTPUTS ONLY
- Offset – offset of input data in frame
- Length – number of bytes/bits to use to get the data from message
- Saturate – limits values from GCU min to GCU max value. Saturation is set individually for CAN in/raw value and CAN out/raw value.
- Default value – value which should be used when GCU does not receive frame OR no value is generated for the output
- Timeout – how to handle situation when GCU stops receiving frame
- GCU Min Value – Linearization Guide
- GCU Max Value – Linearization Guide
- Out Min Value – Linearization Guide
- Out Max Value – Linearization Guide
CAN bus presets: #
GCU supports predefined CAN Presets. CAN presets are one-click configs for CAN communication with popular devices like ECUs, selectors, dashes or others.
Enabling preset is very simple. Go to GEARBOX – GENERAL SETTINGS and choose desired positions from dropdowns.
NOTE: if there are objects created MANUALLY they can cause CAN collision with presets. Make sure that all manually added objects related to preset devices are removed prior to setting up CAN preset.
Supported devices list along with detailed signals will be published later.
- CAN dump sniffing with HTG GCU
How to record and analyze CAN bus communication with HTG tuning GCU. - CAN bus outputs
Description of numeric CAN bus outputs of HTG GCU