3 hdlc transmit, 4 hdlc receive, 3 hdlc transmit -11 14.4.4 hdlc receive -11 – Cirrus Logic EP93xx User Manual

Page 533

Advertising
background image

DS785UM1

14-11

Copyright 2007 Cirrus Logic

UART1 With HDLC and Modem Control Signals

EP93xx User’s Guide

1

4

1

4

14

14.4.3 HDLC Transmit

In normal operation, the HDLC transmitter either continuously sends flags or holds the
transmit pin in a marking state, depending on the setting of the UART1HDLCCtrl.IDLE bit.
When data appears in the transmit FIFO, it begins sending a packet. If in the marking state, it
sends from 1 to 16 opening flags, as specified by the UART1HDLCCtrl.FLAG field. If already
sending flags, it ensures that at least the specified number have been sent. It then begins
sending the bytes in the FIFO, inserting and modifying the data depending on the HDLC
mode.

In asynchronous HDLC, the transmitter enforces control-octet transparency. Whenever a flag
byte (01111110b) or an escape byte (01111101b) appears in the data, the transmitter inverts
the fifth bit and precedes it with an escape byte.

In synchronous HDLC, the transmitter performs bit-stuffing (except for flags). Whenever five
consecutive “1” bits appear in the transmitted bit stream, a “0” bit is inserted, preventing six
ones from appearing consecutively.

When the transmit FIFO under-runs, the HDLC transmitter does one of two things (depending
on the setting of the UART1HDLCCtrl.TUS bit). If the TUS bit is zero, the transmitter first
sends the CRC (if CRC is enabled) and then sends from 1 to 16 closing flags, as specified in
the UART1HDLCCtrl.FLAG field, terminating the packet.

If TUS is one, the transmitter aborts the packet. In synchronous HDLC, it sends a byte of all
ones (since seven consecutive ones signifies an abort), following by at least one closing flag.
In asynchronous HDLC, it sends an escape and then at least one closing flag. The number of
closing flags is from 1 to 16, as specified in the UART1HDLCCtrl.FLAG field.

When a packet ends, the UART1HDLCSts.TFC bit is set, and if UART1HDLCCtrl.TFCEN is
set, an interrupt is generated. When a packet is aborted, the UART1HDLCCtrl.TAB bit is set,
also generating an interrupt if UART1HDLCCtrl.TABEN is set.

14.4.4 HDLC Receive

The HDLC receiver continuously reads bytes from the UART receiver until it finds a flag
followed by a byte other than a flag. Then, if in asynchronous mode, it processes the
incoming bytes (including the first after the flag), reversing control-octet transparency, or, if in
synchronous mode, it reverses bit-stuffing. Processed bytes are placed in the receive FIFO.
When programmed to receive a Manchester encoded bit stream, UART1HDLCSts.PLLCS
indicates whether the DPLL in the receiver has locked on to the carrier.

1

1

-

-

1

1

Internal clock

Manchester

-

1

1

-

-

1

External clock

External clock

1

1

1

-

-

1

Internal clock

Internal clock

Table 14-2. Legal HDLC Mode Configurations (Continued)

UART1HDLCCtrl Bits Set

Transmit Mode

Receive Mode

CMAS TXCM RXCM TXENC RXENC SYNC

Advertising