UM10360 All information provided in this document is subject to legal disclaimers. © NXP B.V. 2013. All rights reserved.
User manual Rev. 3 — 19 December 2013  188 of 841
NXP Semiconductors
UM10360
Chapter 10: LPC176x/5x Ethernet
boundary. Since the number of descriptors matches the number of statuses the status 
array consists of four elements; the array is 4x1x4 bytes and aligned on a 4 byte address 
boundary. The device driver writes the base address of the descriptor array 
(0x2008 10EC) to the TxDescriptor register and the base address of the status array 
(0x2008 11F8) to the TxStatus register. The device driver writes the number of descriptors 
and statuses minus 1(3) to the TxDescriptorNumber register. The descriptors and 
statuses in the arrays need not be initialized, yet.
At this point, the transmit data path may be enabled by setting the TxEnable bit in the 
Command register. If the transmit data path is enabled while there are no further frames to 
send the TxFinishedInt interrupt flag will be set. To reduce the processor interrupt load 
only the desired interrupts can be enabled by setting the relevant bits in the IntEnable 
register.
Now suppose application software wants to transmit a frame of 12 bytes using a TCP/IP 
protocol (in real applications frames will be larger than 12 bytes). The TCP/IP stack will 
add a header to the frame. The frame header need not be immediately in front of the 
payload data in memory. The device driver can program the Tx DMA to collect header and 
payload data. To do so, the device driver will program the first descriptor to point at the 
frame header; the Last flag in the descriptor will be set to false/0 to indicate a 
multi-fragment transmission. The device driver will program the next descriptor to point at 
the actual payload data. The maximum size of a payload buffer is 2 kB so a single 
descriptor suffices to describe the payload buffer. For the sake of the example though the 
payload is distributed across two descriptors. After the first descriptor in the array 
describing the header, the second descriptor in the array describes the initial 8 bytes of 
the payload; the third descriptor in the array describes the remaining 4 bytes of the frame. 
In the third descriptor the Last bit in the Control word is set to true/1 to indicate it is the last 
descriptor in the frame. In this example the Interrupt bit in the descriptor Control field is set 
in the last fragment of the frame in order to trigger an interrupt after the transmission 
completed. The Size field in the descriptor’s Control word is set to the number of bytes in 
the fragment buffer, -1 encoded.
Note that in real device drivers, the payload will typically only be split across multiple 
descriptors if it is more than 2 kB. Also note that transmission payload data is forwarded to 
the hardware without the device driver copying it (zero copy device driver).
After setting up the descriptors for the transaction the device driver increments the 
TxProduceIndex register by 3 since three descriptors have been programmed. If the 
transmit data path was not enabled during initialization the device driver needs to enable 
the data path now.
If the transmit data path is enabled the Ethernet block will start transmitting the frame as 
soon as it detects the TxProduceIndex is not equal to TxConsumeIndex - both were zero 
after reset. The Tx DMA will start reading the descriptors from memory. The memory 
system will return the descriptors and the Ethernet block will accept them one by one 
while reading the transmit data fragments.
As soon as transmission read data is returned from memory, the Ethernet block will try to 
start transmission on the Ethernet connection via the RMII interface.