![HOLT HI-3110 User Manual Download Page 23](http://html1.mh-extra.com/html/holt/hi-3110/hi-3110_user-manual_2146804023.webp)
AN-175
23
Holt Integrated Circuits
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] ={ // Filter data
{W_FILTER0, 0x47,0x00, 0x00, 0x00, 0x00,0x00}, // Filter 0
{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}, // Filter 7
};
// CAN Bus acceptance masks
unsigned const char Masks[8][7] ={
// Mask data
{W_MASK0, 0xFF,0x00, 0x00, 0x00, 0x00,0x00}, // Mask 0
{W_MASK1, 0xFF,0x00, 0x00, 0x00, 0x00,0x00},
{W_MASK2, 0xFF,0x00, 0x00, 0x00, 0x00,0x00},
{W_MASK3, 0x00,0x00, 0x00, 0x00, 0x00,0x00}, // Accept everything with
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}, // Mask 7
};
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.
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from