CAN Receive

<< Click to Display Table of Contents >>

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

CAN Receive

Previous pageReturn to chapter overviewNext page

User Interface

How this block appears in a Simulink model?

can_rx_isr_block

What can be configured?

can_rx_isr_configuration

Configuration item

Selectable option/ Value

Description

CAN Module

1

2

Select CAN module number.

Identifier Type

Standard | Extended

Select ID type, standard id (11 bits) or Extended (29 bits).

Filter type

Mask | Specific

Select filter type for accept or ignore input data from bus.

Mask: accept more than 1 ID

Specific: accept only matched ID value specified.

Identifier, ID

(ID value)

A specific filter ID in specific type, or ID pattern for Mask type.

Mask

This configuration used when Filter type is Mask, to specify the data bit in ID value is need to be matched or don't care.

Example:

         Identifier value set to '00000000100' (binary)

         And Mask value set to '11111111100' (binary)

         *** bit value is Mask, 1-represent to "Must match" and 0-"don't care".

         *** bit 0 and bit 1 of Mask value is 0, which mean bit 0 and bit1 of ID to accept can be any (don't care).

         *** bit 2 to bit 10 of Mask value is 1, which mean bit 2 to bit 10 of ID must be matched to the Identifier value.

         *** So, the pattern of ID to accept is 00000001xx

                                 - '00000000100' (4)

                                 - '00000000101' (5)

                                 - '00000000110' (6)

                                 - '00000000111' (7)


Enable ISR on filter match

Checked | Unchecked

To enable or disable function-call subsystem on event ID match.

Use DLC

Checked | Unchecked

To enable or disable output port for variable DLC value.

Data type

double | single | uint32 | int32 | uint16 | int16 | uint8 | int8

Select output port data type.

Extended buffer size

8 | 16 | 32 | 64

Extension message buffer, number of valid message in buffer is determine by output port "Msg pending".

Sample time

Sample time value


When to use this block?

Use this block generate interrupt when filter ID is matched.

How does this block work?

This block can be:

1. Asynchronous (interrupt) block, the output must connected to Function-Call Subsystem. The function call will active if data receive matched to the filter configuration.

2. Message buffer, user may check number of message received by "Msg pending" port. Recommend use Do-While subsystem to process all pending message in buffer.

Demos

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