Datasheet

2006-2012 Microchip Technology Inc. . DS39662E-page 39
ENC28J60
7.0 TRANSMITTING AND
RECEIVING PACKETS
7.1 Transmitting Packets
The MAC inside the ENC28J60 will automatically gener-
ate the preamble and Start-of-Frame delimiter fields
when transmitting. Additionally, the MAC can generate
any padding (if needed) and the CRC if configured to do
so. The host controller must generate and write all other
frame fields into the buffer memory for transmission.
Additionally, the ENC28J60 requires a single per packet
control byte to precede the packet for transmission. The
per packet control byte is organized as shown in
Figure 7-1. Before transmitting packets, the MAC
registers which alter the transmission characteristics
should be initialized as documented in Section 6.0
“Initialization”.
For an example of how the entire transmit packet and
results will look in memory, see Figure 7-2.
FIGURE 7-1: FORMAT FOR PER PACKET CONTROL BYTES
PHUGEEN PPADEN PCRCEN POVERRIDE
bit 7 bit 0
bit 7-4 Unused
bit 3 PHUGEEN: Per Packet Huge Frame Enable bit
When POVERRIDE =
1:
1 = The packet will be transmitted in whole
0 = The MAC will transmit up to the number of bytes specified by MAMXFL; if the packet is larger
than MAMXFL, it will be aborted after MAMXFL is reached
When POVERRIDE =
0:
This bit is ignored.
bit 2 PPADEN: Per Packet Padding Enable bit
When POVERRIDE = 1:
1 = The packet will be zero-padded to 60 bytes if it is less than 60 bytes
0 = The packet will be transmitted without adding any padding bytes
When POVERRIDE =
0:
This bit is ignored.
bit 1 PCRCEN: Per Packet CRC Enable bit
When POVERRIDE =
1:
1 = A valid CRC will be calculated and attached to the frame
0 = No CRC will be appended; the last 4 bytes of the frame will be checked for validity as a CRC.
When POVERRIDE =
0:
This bit is ignored.
bit 0 POVERRIDE: Per Packet Override bit
1 = The values of PCRCEN, PPADEN and PHUGEEN will override the configuration defined by
MACON3
0 = The values in MACON3 will be used to determine how the packet will be transmitted