1.2.5.3.1 Abstraction Model

The ENC28J60 Driver library has several different layers to it, as illustrated in the following figure. The interface layer has two main sections that are used the most often: The Tasks function, and the TCP/IP Send and Receive functions.

The Tasks function manages the internal state machine which detects, resets, and then configures the ENC28J60 External MAC. It also handles the monitoring of the hardware status, sending and receiving packets.

The TCP/IP Send and Receive functions interact with the RAM-based queue of packets that are queued to send and packets that have been queued waiting for pick-up by the stack.

The main state machine does not interface directly to the SPI bus, but instead, interfaces to a virtual bus abstraction layer that allows for the replacement of the specific underlying bus implementation.

Configuring the SPI Driver

The ENC2J60 hardware requires a specific configuration of the SPI driver to work correctly. Inside the MHC SPI Driver configuration be sure to select:
  • Run the SPI at frequencies of at least 8 MHz

  • Clock mode of DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL

  • Input phase of SPI_INPUT_SAMPLING_PHASE_AT_END