Ethernet MAC Controller
LH79524/LH79525 User’s Guide
6-16
Version 1.0
6.2.1.2 Transmit Buffer List
Transmit data is read from buffers assigned to system memory. These buffers are
described in the Transmit Buffer Queue, which is a sequence of Transmit Buffer Descriptor
entries as defined in Table 6-2.
To create this list of buffers:
1.
Allocate a number (n) of buffers of between 1 and 2,047 bytes of data to be transmit-
ted in system memory. Up to 128 buffers per frame are allowed.
2.
Allocate an area 2
×
(n) words for the Transmit Buffer Descriptor List in system mem-
ory and create (m) entries in this list. Mark all entries in this list as owned by EMAC,
by programming bit 31 of word 1 to 0.
3.
If fewer than 1,024 buffers are defined, the last descriptor must be marked with the
Wrap bit; program bit 30 in word 1 to 1.
4.
Write the address of Transmit Buffer Descriptor List to the TXBQP register.
5.
The Transmit circuits can then be enabled by programming NETCTL:TXEN to 1.
6.2.1.3 Transmitting Frames
To set up a frame for transmission:
1.
Program NETCTL:TXEN to 0.
2.
Allocate an area of system memory for transmit data. This does not have to be con-
tiguous; varying lengths can be used as long as they conclude on byte borders.
3.
Set up the transmit buffer list.
4.
Program NETCTL:TXEN to 1 and enable interrupts by programming the appropriate
bits in the ENABLE register.
5.
Write data for transmission into the buffers.
6.
Write the address to TXBQP pointer.
7.
Write control and length to Word one of the Transmit Buffer Descriptor entry.
8.
Program NETCTL:STARTTX to 1 to start transmission.
6.2.1.4 Local Loop Back Mode
To change Loop Back mode (either to, or from Loop Back):
1.
Program NETCTL:TXEN and NETCTL:RXEN to 0 to disable transmit and receive
circuits.
2.
Program NETCTL:LOOPLOCAL to its opposite value to change Loop Back mode.
3.
Program NETCTL:TXEN and NETCTL:RXEN to 1 to enable transmit and receive circuits.
NOTE: These writes to the Network Control Register must be programmed in separate steps, and cannot be
combined in any way.