DM9000A
APPLICATION NOTES
Preliminary 30
Version: DM9000A-AN-V121
November 27, 2007
5.6 How to Receive Packets
The received and filtered packet's data save in the RX FIFO, which is the internal SRAM
address 0x0C00 ~ 0x3FFF (13K Byte size) in the DM9000A MAC. There are four bytes for the
MAC header of each packet saving in the RX FIFO SRAM, and using the two registers of
MRCMDX REG. F0H and MRCMD REG. F2H to get the information of the packet incoming.
The first byte is used to check whether a packet is received and filtered in the RX SRAM. If
this byte is "01", it means there is a packet received. If this byte is "00", it means there is no
packet received in the RX SRAM. Before reading the other bytes, make sure the first byte of
the MAC header is "01" or LSB Bit [0] = 1. But, if Bit [1:0] is neither "01"b nor "00"b, the
DM9000A MAC/ PHY must do a software-reset in order to recover from the un-stable states
between the system bus and the DM9000A LAN chip. The second byte saves the "status"
information of the received packet. The format of the status "high byte" is the same as RSR
(REG. 06). Please refer to the datasheet ch.6.7. According to this format, the received packet
can be verified as either a correct packet or an error packet. The third and fourth bytes are the
"length" of the received packet. The others bytes are the received packet's data, or named the
RX payload. The following diagram is shown the format of the received package frame:
Figure 5.2 Block Diagram of the Received Packets.
5.6.1 Receive Interrupt Service Routine
The following program segment can be inserted to the interrupt handler if the driver is
designed as the interrupt driven or the polling method for waiting packets received ready:
u8 INT_status = ior ( 0xFE );
/* got DM9000A interrupt status in ISR */
if ( INT_status & 0x01 ) { /* doing ch.5.6.2 */ /* check if PRS Bit [0]=1, RX ok */
iow ( 0xFE, 0x01 ); }
/* clear PRS latched in ISR Bit [0] (see ch.5.5.2) */
01
status
Length
low byte
Length
high byte
Data
Data
4 byte packet status & length
Packet data
01
status
Length
low byte
Length
high byte
Data
Data
4 byte packet status & length
Packet data
00
No packet
Specify packet data length