09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Controller area network (bxCAN) <strong>RM0090</strong><br />

Figure 231. Filter bank scale configuration - register organization<br />

FSCx = 1<br />

FSCx = 0<br />

Filter Bank Scale<br />

Config. Bits1 FBMx = 0<br />

FBMx = 1<br />

FBMx = 0<br />

FBMx = 1<br />

Filter Bank Mode 2<br />

One 32-Bit Filter - Identifier Mask<br />

ID<br />

Mask<br />

Mapping<br />

Two 16-Bit Filters - Identifier Mask<br />

ID<br />

Mask<br />

ID<br />

Mask<br />

Mapping<br />

Filter match index<br />

CAN_FxR1[31:24]<br />

CAN_FxR2[31:24]<br />

STID[10:3] STID[2:0] EXID[17:13]<br />

EXID[12:5]<br />

Two 32-Bit Filters - Identifier List<br />

ID<br />

ID<br />

Mapping<br />

CAN_FxR1[31:24] CAN_FxR1[23:16] CAN_FxR1[15:8] CAN_FxR1[7:0]<br />

CAN_FxR2[31:24] CAN_FxR2[23:16] CAN_FxR2[15:8] CAN_FxR2[7:0]<br />

STID[10:3] STID[2:0] EXID[17:13]<br />

EXID[12:5]<br />

EXID[4:0] IDE RTR 0<br />

CAN_FxR1[15:8]<br />

CAN_FxR1[31:24]<br />

STID[10:3]<br />

Four 16-Bit Filters - Identifier List<br />

ID<br />

ID<br />

ID<br />

ID<br />

Mapping<br />

CAN_FxR2[15:8]<br />

CAN_FxR2[31:24]<br />

CAN_FxR1[15:8]<br />

CAN_FxR1[31:24]<br />

CAN_FxR2[15:8]<br />

CAN_FxR2[31:24]<br />

STID[10:3]<br />

CAN_FxR1[7:0]<br />

CAN_FxR1[23:16]<br />

STID[2:0] RTR IDE EXID[17:15]<br />

STID[2:0] RTR IDE EXID[17:15]<br />

Once a message has been received in the FIFO it is available to the application. Typically,<br />

application data is copied into SRAM locations. To copy the data to the right location the<br />

application has to identify the data by means of the identifier. To avoid this, and to ease the<br />

access to the SRAM locations, the CAN controller provides a Filter Match Index.<br />

This index is stored in the mailbox together with the message according to the filter priority<br />

rules. Thus each received message has its associated filter match index.<br />

The Filter Match index can be used in two ways:<br />

● Compare the Filter Match index with a list of expected values.<br />

● Use the Filter Match Index as an index on an array to access the data destination<br />

location.<br />

For nonmasked filters, the software no longer has to compare the identifier.<br />

If the filter is masked the software reduces the comparison to the masked bits only.<br />

The index value of the filter number does not take into account the activation state of the<br />

filter banks. In addition, two independent numbering schemes are used, one for each FIFO.<br />

Refer to Figure 232 for an example.<br />

671/1416 Doc ID 018909 Rev 3<br />

CAN_FxR1[23:16] CAN_FxR1[15:8] CAN_FxR1[7:0]<br />

CAN_FxR2[23:16] CAN_FxR2[15:8] CAN_FxR2[7:0]<br />

CAN_FxR2[7:0]<br />

CAN_FxR2[23:16]<br />

CAN_FxR1[7:0]<br />

CAN_FxR1[23:16]<br />

CAN_FxR2[7:0]<br />

CAN_FxR2[23:16]<br />

EXID[4:0] IDE RTR 0<br />

Filter<br />

Num.<br />

n<br />

n+1<br />

n<br />

n+1<br />

n+2<br />

n+3<br />

x = filter bank number<br />

ID=Identifier<br />

1 These bits are located in the CAN_FS1R register<br />

2<br />

These bits are located in the CAN_FM1R register<br />

n<br />

n<br />

n+1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!