8 dma, 9 writing configuration registers, 5 uart1 package dependency – Cirrus Logic EP93xx User Manual

Page 536: 5 uart1 package dependency -14

Advertising
background image

14-14

DS785UM1

Copyright 2007 Cirrus Logic

UART1 With HDLC and Modem Control Signals
EP93xx User’s Guide

1

4

1

4

14

14.4.8 DMA

The DMA engine may be used with the UART when transmitting and receiving HDLC
packets. The transmit and receive channels may operate completely independently.

When receiving data in HDLC mode, the DMA channel reads the packet data byte by byte
from the RX FIFO. When it reads the final byte, the HDLC RFC interrupt will occur if enabled.
However, the DMA channel, which buffers the data, may not write all of the data to memory.
To insure that the DMA channel dumps the data, the interrupt handling routine must do the
following:

1. Note the values in the MAXCNTx and REMAIN registers for the DMA channel. The

difference is the number of bytes read from the UART, which is the size of the HDLC
packet. Call this difference N. Note that the BC field of the UART1HDLCRXInfoBuf
register should also be N.

2. Temporarily disable the UART DMA RX interface by clearing the RXDMAE bit in the

UART1DMACtrl register.

3. Wait until the difference between the CURRENTx and BASEx registers in the DMA

channel is equal to N + 1.

An extra byte will be read from the UART by the DMA channel. It should be ignored.

Note that if the DMAERR bit in the UART1DMACtrl register is set and the HDLC receiver is in
asynchronous mode, if the receiver sees a break, parity, or framing error, it will indicate an
error condition via RxEnd on the DMA channel.

14.4.9 Writing Configuration Registers

It is assumed that various configuration registers for the UART/HDLC are not written more
than once in quick succession, in order to insure proper synchronization of configuration
information across the implementation. Such registers include UART1Ctrl and
UART1LinCtrlHigh as well as UART1HDLCCtrl, UART1HDLCAddMtchVal,
UART1HDLCAddMask. These registers should not change often in typical use.

The simplest way to fulfill this requirement with respect to writing the UART1Ctrl and
UART1HDLCCtrl registers is to insure that the HDLC transmitter is enabled before the UART
transmit logic. This will ensure that the UART does not transmit incorrect characters or
unexpectedly transmit characters with UART framing,

First the UART1HDLCCtrl register should be written, setting the TXE bit. Then the UART1Ctrl
register should be written, setting the UARTE bit. In between the two writes, at least two
UARTCLK periods must occur. Under worst case conditions, at least 55 HCLK periods must
separate the two writes. The simplest way to due this is separate the two writes by 55 NOPs.

14.5 UART1 Package Dependency

UART1 uses package pins RXD0, TXD0, CTSn, DSRn, DTRn, RTSn, EGPIO[3], and
EGPIO[0], which are described in

Table 14-4

.

Advertising