CAN Config

From OpenMBD
< HANcoder‎ | STM32‎ | Blocks
Jump to: navigation, search
Supported Targets: Olimexino, E407, P405

General information about CAN Config

The 'CAN Config' block instructs the code generator to include CAN support. The block also configures the CAN controller communication speed and the reception acceptance filter.

Remarks

When not using the CAN config block, support for the given CAN channel is not included in the embedded target. Thereby every CAN message addressed to the controller is lost. The default configuration of the reception acceptance filter received all 11-bit CAN message identifiers.

Block

CANConfig.png

Mask

CANConfigMask.png

Block parameters

Parameter Description
Use CAN bus Check this box if this CAN channel should be used.
Baudrate [kbit/s] Select the baudrate of the CAN, options are 125, 250, 500 or 1000.
Reception filter Mask A value in the range 0x00000000 and 0x1fffffff. The mask part of the filter determines which bits in the received message identifiers should be matched to the corresponding bits in the code part. A mask bit value of 0 means don't care.
Reception filter Code A value in the range 0x00000000 and 0x1fffffff. The code part of the filter determines what bit values to match in the received message identifier.
Reception filter Mode Mode of the reception acceptance filter where you can configure what type of CAN message identifiers should be received.
Transmit buffer size The number of software transmit buffers in addition to the 3 internal hardware buffers of the CAN controller. 4 are sufficient at 500 kbits/sec, but more might be needed at lower baudrates because message transmission takes longer, resulting in the 3 internal hardware buffers of the CAN controller to be occupied longer.
Event buffer size The number of software event buffers to events such as message reception and message transmission completion. 8 are sufficient at 500 kbits/sec at 100% busload. More might be needed at higher baudrates because more messages will be received at a similar busload.

Examples

CAN Communication Example | OBD reader example

See Also

CAN receive | CAN send | XCP on CAN config