HOLT HI-3110 User Manual page 23

Hide thumbs Also See for HI-3110:
Table of Contents

Advertisement

Filtering on ID
If two boards are used one can be setup to transmit and the other to receive. If the receive board has
the OPT2 switch open it will filter the frame data based on the Filter and Mask values stored in the Filter
and Masks arrays in the 3110Driver.c module. When the OPT2 switch is open the FILTON bit-4 in the
CTRL1 register for CAN ID filtering is set in the Init3110() function.
// CAN Bus acceptance filters
unsigned const char Filters[8][7] ={
{W_FILTER0, 0x47,0x00, 0x00, 0x00, 0x00,0x00},
{W_FILTER1, 0x47,0x00, 0x00, 0x00, 0x00,0x00},
{W_FILTER2, 0x47,0x00, 0x00, 0x00, 0x00,0x00},
{W_FILTER3, 0x47,0x00, 0x00, 0x00, 0x00,0x00},
{W_FILTER4, 0x47,0x00, 0x00, 0x00, 0x00,0x00},
{W_FILTER5, 0x47,0x00, 0x00, 0x00, 0x00,0x00},
{W_FILTER6, 0x47,0x00, 0x00, 0x00, 0x00,0x00},
{W_FILTER7, 0x47,0x00, 0x00, 0x00, 0x00,0x00},
};
// CAN Bus acceptance masks
unsigned const char Masks[8][7] ={
{W_MASK0, 0xFF,0x00, 0x00, 0x00, 0x00,0x00},
{W_MASK1, 0xFF,0x00, 0x00, 0x00, 0x00,0x00},
{W_MASK2, 0xFF,0x00, 0x00, 0x00, 0x00,0x00},
{W_MASK3, 0x00,0x00, 0x00, 0x00, 0x00,0x00},
filter 3
{W_MASK4, 0xFF,0x00, 0x00, 0x00, 0x00,0x00},
{W_MASK5, 0xFF,0x00, 0x00, 0x00, 0x00,0x00},
{W_MASK6, 0xFF,0x00, 0x00, 0x00, 0x00,0x00},
{W_MASK7, 0xFF,0x00, 0x00, 0x00, 0x00,0x00},
};
This example code is setup to filter on ID28-ID20 = 0x47. The transmitter already transmits this value so
by default the messages will be received. All other messages other than 0x47 will be except by filter-3.
Refer to the datasheet page 38 and example code for the bit assignments of the other 5 bytes in these
arrays.
23
AN-175
// Accept everything with
// Filter data
// Filter 0
// Filter 7
// Mask data
// Mask 0
// Mask 7
Holt Integrated Circuits

Advertisement

Table of Contents
loading

Table of Contents