CAN Setup

<< Click to Display Table of Contents >>

Navigation:  STM32F4 Target > Block References > On-chip Peripherals > CAN >

CAN Setup

Previous pageReturn to chapter overviewNext page

User Interface

How this block appears in a Simulink model?

can1_setup_block

What can be configured?

can1_setup_configuration

Configuration item

Selectable option/ Value

Description

CAN Module

1 | 2

Select CAN module.

Advance configuration

Checked | Unchecked

Enable or Disable advance configuration option. If advance configuration mode disabled, user just select only Bit rate easily.

Resync Jump Width (SJW)

1tq | 2tq | 3tq | 4tq

SJW can be 1, 2, 3 or 4tq, But:

If BS1 < 4, then set SJW to BS1.

Bit segment 1 (BS1) + PROP_SEG

1tq | 2tq | 3tq | 4tq | .... | 16tq

Specify bit segment 1, result of calculation of propagation delay can include to this timing.

Bit segment 2 (BS2)

1tq | 2tq | 3tq | 4tq | .... | 8tq

Specify bit segment 2.

Conguration

Prescaler | Baudrate

Select to adjust Baudrate or Prescaler.

Note: Recommend to adjust Prescaler (BRP) and see output as Baudrate.

Baud rate prescaler (BRP)

1 | 2 | 3 | ... | 1024

Clock prescaler

Baud rate (bps)

(CAN speed value)


Time Quantum (Second), tq

(Prescaler * tPCLK1)


Bit rate (bps)

Maximum 1Mbps

Note: Cable length will effect to bit rate selection.

Auto Re-transmission

Enable | Disable

Enable or disable auto re-transmission feature.

Tx pin

(Select Tx pin)

Select the required pin to assign for CAN Tx.

Rx pin

(Select Rx pin)

Select the required pin to assign for CAN Rx.

When to use this block?

This block implement CAN bus, for network communication application.

How does this block work?

Put this block to a model to enable CAN module function. The block will setup communication speed, pin assignment (follow user configuration) and basic configuration.

Demos

1. Transmit-Receive
2.CAN Transmit-Receive Extended ID