Datasheet
2011 Microchip Technology Inc. DS39762F-page 253
PIC18F97J60 FAMILY
TABLE 19-5: RECEIVE STATUS VECTORS
19.5.3.2 Reading Received Packets
To process the packet, an application will normally start
reading from the beginning of the Next Packet Pointer.
The application will save the Next Packet Pointer, any
necessary bytes from the receive status vector, and
then proceed to read the actual packet contents. If the
AUTOINC bit is set, it will be able to sequentially read
the entire packet without ever modifying the ERDPT
registers. The Read Pointer would automatically wrap
at the end of the circular receive buffer to the beginning.
In the event that the application needed to randomly
access the packet, it would be necessary to manually
calculate the proper ERDPT registers, taking care to
not exceed the end of the receive buffer if the packet
spans the ERXND to ERXST buffer boundary. In other
words, given the packet start address and a desired
offset, the application should follow the logic shown in
Equation 19-1.
EQUATION 19-1: RANDOM ACCESS ADDRESS CALCULATION
Bit Field Description
31 Zero ‘0’
30 Receive VLAN Type Detected Current frame was recognized as a VLAN tagged frame.
29 Receive Unknown Opcode Current frame was recognized as a control frame, but it contained an
unknown opcode.
28 Receive Pause Control Frame Current frame was recognized as a control frame containing a valid pause
frame opcode and a valid destination address.
27 Receive Control Frame Current frame was recognized as a control frame for having a valid
type/length designating it as a control frame.
26 Dribble Nibble Indicates that after the end of this packet, an additional 1 to 7 bits were
received. The extra bits were thrown away.
25 Receive Broadcast Packet Indicates packet received had a valid Broadcast address.
24 Receive Multicast Packet Indicates packet received had a valid Multicast address.
23 Received OK Indicates that the packet had a valid CRC and no symbol errors.
22 Length Out of Range Indicates that frame type/length field was larger than 1500 bytes
(type field).
21 Length Check Error Indicates that frame length field value in the packet does not match the
actual data byte length.
20 CRC Error Indicates that the frame CRC field value does not match the CRC
calculated by the MAC.
19 Reserved
18 Carrier Event Previously Seen Indicates that at some time since the last receive, a carrier event was
detected. The carrier event is not associated with this packet. A carrier
event is activity on the receive channel that does not result in a packet
receive attempt being made.
17 Reserved
16 Long Event/Drop Event Indicates a packet over 50,000 bit times occurred or that a packet was
dropped since the last receive.
15-0 Received Byte Count Indicates length of the received frame. This includes the destination
address, source address, type/length, data, padding and CRC fields. This
field is stored in little-endian format.
If Packet Start Address + Offset > ERXND, then
ERDPT = Packet Start Address + Offset – (ERXND – ERXST + 1)
else:
ERDPT = Packet Start Address + Offset