Datasheet

2010 Microchip Technology Inc. DS39935C-page 35
ENC424J600/624J600
For example, to read data from address 5402h of the
buffer:
1. Write 5402h to EGPRDPT.
2. Read from EGPDATA.
Following the read, the EGPRDPT value normally
increments by 1 (to 5403h in this example). If the host
subsequently wants to read from address 5403h, it can
simply perform a second read from the EGPDATA
Window register. The Write Pointer, EGPWRPT, is not
affected by the read operation.
Similarly, to write A3h to address 0007h of the buffer:
1. Write 0007h to EGPWRPT.
2. Write A3h to EGPDATA.
Following the write, the EGPWRPT value normally
increments by 1 (to 0008h in this example). The Read
Pointer, EGPRDPT, is not affected by the write
operation.
Each of the three pointer sets (general purpose,
receive and user-defined area) can be used to access
any address within the SRAM buffer. They differ from
each other based on their address wrapping behavior.
Applications may choose to use all three pointer
interfaces to access the RAM. This may offer maximum
application performance as it will require minimal con-
text switching overhead when, for example, switching
from reading a received packet to reading from general
purpose RAM. However, for simplicity, some
applications may prefer to use only one or two of the
three E*DATA interfaces.
3.5.5.1 Circular Wrapping with EGPDATA
Normally, operations involving EGPDATA cause the
EGPRDPT or EGPWRPT Pointer to automatically
increment by one byte address. However, if the end of
the general purpose buffer area (ERXST – 1) is
reached, or the end of the implemented SRAM (5FFFh)
is reached, the pointer will increment to address 0000h
instead, causing subsequent accesses to wrap around
to the beginning of the SRAM buffer (Figure 3-6). The
increment behavior logic is explained in Equation 3-1.
FIGURE 3-6: CIRCULAR BUFFER
WRAPPING USING THE
EGPDATA WINDOW
EQUATION 3-1: POINTER INCREMENT LOGIC FOR EGPRDPT AND EGPWRPT
General Purpose
Buffer
0000h
5FFFh
Circular RX FIFO
Buffer
ERXST
ERXST – 1
Unimplemented
if EGPRDPT/EGPWRPT = ERXST – 1, then
EGPRDPT/EGPWRPT = 0000h
else if EGPRDPT/EGPWRPT = 5FFFh, then
EGPRDPT/EGPWRPT = 0000h
else
EGPRDPT/EGPWRPT = EGPRDPT/EGPWRPT + 1