// Do bank 1 stuff, packet filter:
// For broadcast packets we allow only ARP packtets
// All other packets shocould be unicast only for our Mac (maadr)
//
// The pattern to match on is therefore
// Type eth. dst
// ARP Broadcast
// 06 08 -- FF-> IP checksum for theses bytes = f7f9
// 0x0806: Address Resolution Protocol (ARP: Address Resolution Protocol)
// [06 08 FF] TCP/IP checksum = f9f7
// In binary these poitions are: 11 0000 0011 1111
// This is hex 303f-> epmm0 = 0x3f, epmm1 = 0x30
Enc28j60write (erxfcon, erxfcon_ucen | erxfcon_crcen | erxfcon_pmen );
Enc28j60write (epmm0, 0x3f); // format match: Target MAC address (the last six bytes) + source MAC address (the first two bytes)
Enc28j60write (epmm1, 0x30); // format match: source MAC address (the last four bytes) + ARP format (the first two bytes) + reserved (the other two bytes)
Enc28j60write (epmcsl, 0xf9 );
Enc28j60write (epmcsh, 0xf7 );
Enc28j60write (macon1, macon1_marxen | macon1_txpaus | macon1_rxpaus );
// Bring Mac out of Reset
Enc28j60write (macon2, 0x00 );
An understanding of enc28j60 format Filtering