Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
БЭМЗ полищук доки / Склад / Datasheet_LM3S6965.pdf
Скачиваний:
10
Добавлен:
21.12.2020
Размер:
6.13 Mб
Скачать

LM3S6965 Microcontroller

Figure 16-1. Ethernet Controller

 

 

 

 

 

 

 

 

 

 

 

 

 

Media

Physical

 

 

 

 

 

 

 

Access

Layer Entity

 

 

 

 

ARM Cortex M3

 

 

Controller

 

 

 

Magnetics

 

RJ45

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MAC

PHY

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(Layer 2)

(Layer 1)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 16-2 on page 429 shows more detail of the internal structure of the Ethernet Controller and how the register set relates to various functions.

Figure 16-2. Ethernet Controller Block Diagram

Interrupt

Interrupt

Receive

 

Transmit

 

Pulse

 

TXOP

Control

Control

Transmit

 

 

 

 

MACRIS

MACRCTL

Encoding

 

Shaping

 

TXON

 

FIFO

 

 

 

 

 

 

MACIACK

MACNP

 

 

 

 

 

 

 

 

 

 

 

 

 

MACIM

 

 

 

 

 

 

 

 

 

Data

 

Collision

 

Carrier

MDIX

 

 

 

Access

 

Detect

 

Sense

 

 

 

 

MACDDATA

 

 

 

 

 

 

 

 

 

 

Receive

 

Clock

 

RXIP

 

 

Transmit

Receive

 

 

 

 

 

Control

Decoding

 

Recovery

 

RXIN

 

 

MACTCTL

FIFO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MACTHR

 

 

 

 

 

 

 

 

MACTR

 

 

 

 

 

 

 

 

MII

 

Media Independent Interface

Auto

 

 

 

Control

 

Management Register Set

Negotiation

 

 

Individual

MACMCTL

 

MR0

MR4

MR18

 

 

 

MACMDV

 

MR1

MR5

MR19

 

XTALPPHY

 

Address

MACMTXD

 

MR2

MR6

MR23

Clock

 

 

MACIA0

MACMRXD

 

MR3

MR16

MR24

XTALNPHY

 

 

Reference

 

MACIA1

 

 

 

MR17

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

LED0

 

 

 

 

 

 

 

 

LED1

16.2Functional Description

Note: A 12.4-kΩ resistor should be connected between the ERBIAS and ground. The 12.4-kΩ resistorshouldhavea1%toleranceandshouldbelocatedincloseproximitytothe ERBIAS pin. Powerdissipationintheresistorislow,soachipresistorofanygeometrymaybeused.

The functional description of the Ethernet Controller is discussed in the following sections.

16.2.1MAC Operation

16.2.1.1 Ethernet Frame Format

Ethernet data is carried by Ethernet frames. The basic frame format is shown in Figure 16-3 on page 430.

November 16, 2008

429

Preliminary

Ethernet Controller

Figure 16-3. Ethernet Frame

Preamble

SFD

Destination Address

Source Address

Length/

Data

FCS

Type

 

 

 

 

 

 

 

 

 

 

 

 

 

7

1

6

6

2

46 - 1500

4

Bytes

Byte

Bytes

Bytes

Bytes

Bytes

Bytes

The seven fields of the frame are transmitted from left to right. The bits within the frame are transmitted from least to most significant bit.

Preamble

The Preamble field is used to synchronize with the received frame’s timing. The preamble is 7 octets long.

Start Frame Delimiter (SFD)

The SFD field follows the preamble pattern and indicates the start of the frame. Its value is 1010.1011.

Destination Address (DA)

This field specifies destination addresses for which the frame is intended. The LSB (bit 16 of DA oct 1 in the frame, see Table 16-1 on page 431) of the DA determines whether the address is an individual (0), or group/multicast (1) address.

Source Address (SA)

The source address field identifies the station from which the frame was initiated.

Length/Type Field

The meaning of this field depends on its numeric value. This field can be interpreted as length ortypecode. Themaximumlengthofthedatafieldis1500octets. IfthevalueoftheLength/Type field is less than or equal to 1500 decimal, it indicates the number of MAC client data octets. If the value of this field is greater than or equal to 1536 decimal, then it is type interpretation. The meaningoftheLength/Typefieldwhenthevalueisbetween1500and1536decimalisunspecified by the IEEE 802.3 standard. However, the Ethernet Controller assumes type interpretation if the value of the Length/Type field is greater than 1500 decimal. The definition of the Type field is specified in the IEEE 802.3 standard. The first of the two octets in this field is most significant.

Data

The data field is a sequence of octets that is at least 46 in length, up to 1500 in length. Full data transparency is provided so any values can appear in this field. A minimum frame size of 46 octetsisrequiredtomeettheIEEEstandard. Iftheframesizeistoosmall,theEthernetController automatically appends extra bits (a pad), thus the pad can have a size of 0 to 46 octets. Data padding can be disabled by clearing the PADEN bit in the Ethernet MAC Transmit Control (MACTCTL) register.

For the Ethernet Controller, data sent/received can be larger than 1500 bytes without causing a Frame Too Long error. Instead, a FIFO overrun error is reported using the FOV bit in the Ethernet MAC Raw Interrupt Status(MACRIS) register when the frame received is too large to fit into the Ethernet Controller’s 2K RAM.

Frame Check Sequence (FCS)

430

November 16, 2008

Preliminary

LM3S6965 Microcontroller

The frame check sequence carries the cyclic redundancy check (CRC) value. The CRC is computed over the destination address, source address, length/type, and data (including pad) fields using the CRC-32 algorithm. The Ethernet Controller computes the FCS value one nibble at a time. For transmitted frames, this field is automatically inserted by the MAC layer, unless disabled by clearing the CRC bit in the MACTCTL register. For received frames, this field is automatically checked. If the FCS does not pass, the frame is not placed in the RX FIFO, unless the FCS check is disabled by clearing the BADCRC bit in the MACRCTL register.

16.2.1.2 MAC Layer FIFOs

The Ethernet Controller is capable of simultaneous transmission and reception. This feature is enabled by setting the DUPLEX bit in the MACTCTL register.

ForEthernetframetransmission,a2KBtransmitFIFOisprovidedthatcanbeusedtostoreasingle frame. While the IEEE 802.3 specification limits the size of an Ethernet frame's payload section to 1500 Bytes, the Ethernet Controller places no such limit. The full buffer can be used, for a payload of up to 2032 bytes (as the first 16 bytes in the FIFO are reserved for destination address, source address and length/type information).

For Ethernet frame reception, a 2-KB receive FIFO is provided that can be used to store multiple frames, up to a maximum of 31 frames. If a frame is received, and there is insufficient space in the RX FIFO, an overflow error is indicated using the FOV bit in the MACRIS register.

For details regarding the TX and RX FIFO layout, refer to Table 16-1 on page 431. Please note the following difference between TX and RX FIFO layout. For the TX FIFO, the Data Length field in the first FIFO word refers to the Ethernet frame data payload, as shown in the 5th to nth FIFO positions. For the RX FIFO, the Frame Length field is the total length of the received Ethernet frame, including the Length/Type bytes and the FCS bits.

If FCS generation is disabled by clearing the CRC bit in the MACTCTL register, the last word in the TX FIFO must contain the FCS bytes for the frame that has been written to the FIFO.

Also note that if the length of the data payload section is not a multiple of 4, the FCS field is not be aligned on a word boundary in the FIFO. However, for the RX FIFO the beginning of the next frame is always on a word boundary.

Table 16-1. TX & RX FIFO Organization

FIFO Word Read/Write

Word Bit Fields

TX FIFO (Write)

RX FIFO (Read)

Sequence

 

 

 

1st

7:0

Data Length Least Significant Frame Length Least

 

 

Byte

Significant Byte

 

15:8

Data Length Most Significant

FrameLengthMostSignificant

 

 

Byte

Byte

 

23:16

DA oct 1

 

31:24

DA oct 2

2nd

7:0

DA oct 3

 

15:8

DA oct 4

 

23:16

DA oct 5

 

31:24

DA oct 6

3rd

7:0

SA oct 1

 

15:8

SA oct 2

 

23:16

SA oct 3

 

31:24

SA oct 4

November 16, 2008

431

Preliminary

Ethernet Controller

FIFO Word Read/Write

Word Bit Fields

TX FIFO (Write)

RX FIFO (Read)

Sequence

 

 

 

4th

7:0

 

SA oct 5

 

15:8

 

SA oct 6

 

23:16

Len/Type Most Significant Byte

 

31:24

Len/Type Least Significant Byte

5th to nth

7:0

 

data oct n

 

15:8

 

data oct n+1

 

23:16

 

data oct n+2

 

31:24

 

data oct n+3

last

7:0

 

FCS 1

 

15:8

 

FCS 2

 

23:16

 

FCS 3

 

31:24

 

FCS 4

Note: If the CRC bit in the MACTCTL register is clear, the FCS bytes must be written with the correctCRC. Ifthe CRC bitisset,theEthernetControllerautomaticallywritestheFCSbytes.

16.2.1.3 Ethernet Transmission Options

At the MAC layer, the transmitter can be configured for both full-duplex and half-duplex operation by using the DUPLEX bit in the MACTCTL register.

The Ethernet Controller automatically generates and inserts the Frame Check Sequence (FCS) at the end of the transmit frame when the CRC bit in the MACTCTL register is set. However, for test purposes, this feature can be disabled in order to generate a frame with an invalid CRC by clearing the CRC bit.

The IEEE 802.3 specification requires that the Ethernet frame payload section be a minimum of 46 bytes. TheEthernetControllerautomaticallypadsthedatasectionifthepayloaddatasectionloaded into the FIFO is less than the minimum 46 bytes when the PADEN bit in the MACTCTL register is set. This feature can be disabled by clearing the PADEN bit.

The transmitter must be enabled by setting the TXEN bit in the TCTL register.

16.2.1.4 Ethernet Reception Options

TheEthernetControllerRXFIFOshouldbeclearedduringsoftwareinitialization. Thereceivershould first be disabled by clearing the RXEN bit in the Ethernet MAC Receive Control (MACRCTL) register, then the FIFO can be cleared by setting the RSTFIFO bit in the MACRCTL register.

ThereceiverautomaticallyrejectsframesthatcontainbadCRCvaluesintheFCSfield. Inthiscase, a Receive Error interrupt is generated and the receive data is lost. To accept all frames, clear the BADCRC bit in the MACRCTL register.

In normal operating mode, the receiver accepts only those frames that have a destination address that matches the address programmed into the Ethernet MAC Individual Address 0 (MACIA0) and Ethernet MAC Individual Address 1 (MACIA1) registers. However, the Ethernet receiver can also be configured for Promiscuous and Multicast modes by setting the PRMS and AMUL bits in the MACRCTL register.

432

November 16, 2008

Preliminary

Соседние файлы в папке Склад