Specifications

SLAA137A
12 MSP430 Internet Connectivity
Table 4. Functions of the Ethernet Module
Name, Parameters Description
void Init8900(void) Initializes important MCU port pins, does a software reset of the LAN
controller, and sets up the LAN controller MAC interface.
void Write8900(unsigned char
Address, unsigned int Data)
Writes the 16-bit value Data to one of the eight possible registers of the
CS8900A (Address). Data is written in little-endian byte order to the LAN
controller memory.
void WriteFrame8900(unsigned int
Data)
Writes the 16-bit value Data to the I/O address TX_FRAME_PORT of
the CS8900A. Used to transfer a word into the transmit buffer
unsigned int Read8900(unsigned int
Address)
Reads a 16-bit value from a given I/O address of the LAN controller.
Byte order is little-endian.
unsigned int ReadFrame8900(void) Reads a 16-bit value from LAN controller’s RX_FRAME_PORT address.
Used to transfer data to MCU memory. Byte order is little-endian.
unsigned int
ReadHB1ST8900(unsigned char
Address)
Reads a 16-bit value from a given address, but the byte on the upper
address is read out first. This function must be used to access special
registers of CS8900A. Byte order is little-endian.
unsigned int ReadFrameBE8900(void) Reads a 16-bit value from LAN controller’s RX_FRAME_PORT address.
Used to transfer data to MCU memory. Byte order is big-endian. Use
this function to avoid byte swapping when reading data of higher layered
communication protocols.
void CopyToFrame8900(void *Source,
unsigned int Size)
Copies Size bytes, starting with address Source from MCU memory to
the CS8900A TX_FRAME_PORT. Used to send out a whole prepared
frame.
void CopyFromFrame8900(void *Dest,
unsigned int Size)
Reads out Size bytes from the LAN controller frame port and transfers it
to MCU memory
void
DummyReadFrame8900(unsigned int
Size)
Reads and discards Size bytes from the CS8900A RX_FRAME_PORT.
Used to skip a received frame. Size must be an even number.
void RequestSend(unsigned int
FrameSize)
Requests FrameSize bytes in the LAN controller transmit buffer. This
function must have been called before writing data to
TX_FRAME_PORT.
unsigned int Rdy4Tx(void) Checks whether previously requested buffer space in the LAN controller
is available (return value is not equal to zero), and therefore the frame
can be copied to the TX buffer.
At first, the ethernet controller must be configured. This is done by calling the function Init8900().
The ethernet controller is reset and the configuration sequence stored in the C-constant
InitSequ[ ] is transferred. Every entity in this constant consists of an address and a data value.
The meaning of the registers accessed and the symbols used is described in detail in the
CS8900A data sheet [8]. After this preparation, data transfer can take place.