High-Level Data Link Control (HDLC)
15-18
Am186™CC/CH/CU Microcontrollers User’s Manual
multiplexed bus is allocated to a single TSA/HDLC channel. To enable Transparent mode,
set the TRANSM bit of the HxCON register to 1.
Figure 15-8 shows the assertion and deassertion of RTR with back-to-back flags. A real
frame would contain additional data between the two flags.
Figure 15-8
RTR Timing
15.5.6
HDLC and SmartDMA
All SmartDMA channels support HDLC (the general-purpose DMA channels cannot be
used with HDLC). For information about using the SmartDMA interface, see Chapter 8,
“DMA Controller.” This section discusses some of the issues with using an HDLC channel
as the transmitter and receiver.
15.5.6.1
HDLC Transmitter
The only complication with a normal HDLC transmit using SmartDMA transfer is that, if the
packet to be transmitted is composed of more than one buffer and the buffer descriptors
are stored from a task that is interruptible, the HDLC transmitter could start up and underflow
if the task is interrupted before the last buffer descriptor is updated. To avoid this problem,
delay setting the OWN bit in the first buffer descriptor until all the other descriptors have
been completely set up, and set up the other descriptors in reverse order, that is, from last
to first.
If an error (such as a loss of CTS or a FIFO underflow) occurs during transmission of a
packet, the transmitter stops until software clears the error condition in the HDLC controller.
Software can either poll for these error conditions or, preferably, set the hardware up to
generate an interrupt when they occur. When such an error occurs, the software should
take the following steps:
1. Clear the SmartDMA control register TXST bit to stop the DMA. This stops the DMA
without clearing the OWN bit on the current buffer descriptor or going to the next buffer
descriptor.
2. Clear the HDLC error bit (CTSLST or TUFLO) in the HxISTAT0 register. This
automatically flushes and restarts the FIFO and re-arms the interrupt.
3. To resend the same packet that contains more than one buffer, software must:
a. Read the CTBD register to determine the current descriptor.
b. Back up to the start of the packet in the descriptor ring (find the descriptor with the
STP bit set), setting the OWN bit in each buffer before the current buffer back to and
including the buffer with the STP bit set.
c. Store the number of the descriptor, with the STP bit set, into the CTBD register.
Note that this technique does not work if buffers are reclaimed by the software as soon
as their OWN bits are reset by the hardware. For this technique to work properly,
buffers must not be reclaimed until an entire packet has been sent.
RCLK
RXD
RTR
Содержание Am186 CC
Страница 1: ...Am186 CC CH CU Microcontrollers User s Manual Order 21914B...
Страница 4: ...iv Am186 CC CH CU Microcontrollers User s Manual...
Страница 18: ...Table of Contents xviii Am186 CC CH CU Microcontrollers User s Manual...
Страница 24: ...Introduction xxiv Am186 CC CH CU Microcontrollers User s Manual...
Страница 39: ...Architectural Overview Am186 CC CH CU Microcontrollers User s Manual 1 15 Figure 1 6 32 Channel Linecard CH CC...
Страница 40: ...Architectural Overview 1 16 Am186 CC CH CU Microcontrollers User s Manual...
Страница 86: ...System Overview 3 36 Am186 CC CH CU Microcontrollers User s Manual...
Страница 92: ...Emulator Support 4 6 Am186 CC CH CU Microcontrollers User s Manual...
Страница 112: ...DRAM Controller 6 8 Am186 CC CH CU Microcontrollers User s Manual...
Страница 134: ...Interrupts 7 22 Am186 CC CH CU Microcontrollers User s Manual...
Страница 186: ...Programmable I O Signals 9 8 Am186 CC CH CU Microcontrollers User s Manual...
Страница 200: ...Watchdog Timer 11 6 Am186 CC CH CU Microcontrollers User s Manual...
Страница 232: ...Asynchronous Serial Ports UARTs 13 24 Am186 CC CH CU Microcontrollers User s Manual...
Страница 242: ...Synchronous Serial Port SSI 14 10 Am186 CC CH CU Microcontrollers User s Manual...
Страница 264: ...High Level Data Link Control HDLC 15 22 Am186 CC CH CU Microcontrollers User s Manual...
Страница 332: ...Universal Serial Bus USB 18 34 Am186 CC CH CU Microcontrollers User s Manual...
Страница 348: ...Register Summary A 16 Am186 CC CH CU Microcontrollers User s Manual...
Страница 376: ...Index Index 18 Am186 CC CH CU Microcontrollers User s Manual...