Datasheet

2011 Microchip Technology Inc. DS39762F-page 259
PIC18F97J60 FAMILY
19.8 Receive Filters
To minimize microcontroller processing overhead, the
Ethernet module incorporates a range of different
receive filters which can automatically reject packets
which are not needed. Six different types of packet
filters are implemented:
Unicast
Multicast
Broadcast
Pattern Match
•Magic Packet
Hash Table
The individual filters are all configured by the ERXFCON
register (Register 19-20). More than one filter can be
active at any given time. Additionally, the filters can be
configured by the ANDOR bit to either logically AND or
logically OR the tests of several filters. In other words,
the filters may be set so that only packets accepted by
all active filters are accepted, or a packet accepted by
any one filter is accepted. The flowcharts in Figure 19-13
and Figure 19-14 show the effect that each of the filters
will have, depending on the setting of ANDOR.
The device can enter Promiscuous mode and receive
all legal packets by setting the ERXFCON register to
20h (enabling only the CRC filter for valid packets). The
proper setting of the register will depend on the
application requirements.
19.8.1 UNICAST FILTER
The Unicast receive filter checks the destination
address of all incoming packets. If the destination
address exactly matches the contents of the MAADR
registers, the packet meets the Unicast filter criteria.
19.8.2 MULTICAST FILTER
The Multicast receive filter checks the destination
address of all incoming packets. If the Least Significant
bit of the first byte of the destination address is set, the
packet meets the Multicast filter criteria.
19.8.3 BROADCAST FILTER
The Broadcast receive filter checks the destination
address of all incoming packets. If the destination
address is FF-FF-FF-FF-FF-FF, the packet meets the
Broadcast filter criteria.
19.8.4 HASH TABLE FILTER
The Hash Table receive filter is typically used to receive
traffic sent to a specific Multicast group address.
Because it checks the specific destination address of
packets, it is capable of filtering out more unwanted
packets than the Multicast filter.
The filter performs a 32-bit CRC over the six destination
address bytes in the packet, using the polynomial,
4C11DB7h. From the resulting 32-bit binary number, a
6-bit value is derived from bits<28:23>. This value, in
turn, points to a location in a table formed by the Ether-
net Hash Table registers, ETH0 through ETH7. If the bit
in that location is set, the packet meets the Hash Table
filter criteria and is accepted. The specific pointer values
for each bit location in the table are shown in Table 19-9.
An example of the Hash Table operation is shown in
Example 19-1. In this case, the destination address,
01-00-00-00-01-2C, produces a Table Pointer value of
34h, which points to bit 4 of ETH6. If this bit is ‘1’, the
packet will be accepted.
By extension, clearing every bit in the Hash Table
registers means that the filter criteria will never be met.
Similarly, if every bit in the Hash Table is set, the filter
criteria will always be met.
TABLE 19-9: BIT ASSIGNMENTS IN HASH
TABLE REGISTERS
EXAMPLE 19-1: DERIVING A HASH TABLE
LOCATION
Register
Bit Number in Hash Table
7 6 5 4 3 2 1 0
EHT0 07 06 05 04 03 02 01 00
EHT1 0F 0E 0D 0C 0B 0A 09 08
EHT2 17 16 15 14 13 12 11 10
EHT3 1F 1E 1D 1C 1B 1A 19 18
EHT4 27 26 25 24 23 22 21 20
EHT5 2F 2E 2D 2C 2B 2A 29 28
EHT6 37 36 35 34 33 32 31 30
EHT7 3F 3E 3D 3C 3B 3A 39 38
Packet Destination Address:
01-00-00-00-01-2C (hex)
Result of CRC-32 with 4C11DB7h:
1101 1010 0000 1011 0100 0101 0111 0101
(binary)
Pointer Derived from bits<28:23> of CRC Result:
110100 (binary) or 34 (hex)
Corresponding Hash Table Location:
ETH6<4>