DMA Controller
Am186™CC/CH/CU Microcontrollers User’s Manual
8-25
Receive Multitasking
In a single-tasking system, received characters are held in the circular buffer until higher-
level code is ready for them. In a multitasking system, it may be desirable for receipt of
characters to cause an interrupt to signal that a task switch should take place. When DMA
is used with one of the UARTs on the Am186CC/CH/CU microcontrollers, the hardware is
typically programmed to cause interrupts under these two conditions:
■
After a programmed number of characters have been received.
To do this, the programmed transfer count is usually the lesser of this desired number
and the number required to implement proper flow control.
■
When no characters have been received for a certain period of time (signifying that the
other end has probably finished transmitting a message).
This is accomplished by interrupting on the UART IDLED bit in the (H)SPSTAT register,
which causes an interrupt when 40 bit times have gone by without detecting a start bit.
Receive Error Processing
Several kinds of errors and exceptional conditions can occur when receiving asynchronous
character data. Breaks, parity errors, and framing errors indicate an exceptional external
condition. Overrun errors indicate that data has been lost due to system latency. A character
match interrupt (High-Speed UART only) can indicate that an XON or XOFF has been
received.
The Am186CC/CH/CU microcontrollers offer great flexibility in dealing with these
exceptions. If the EXDRD bit in the UART’s Control 1 register is set, and the DMA is set up
to transfer a word for every character, exceptions can be stored in the circular buffer along
with the character that caused them. If the EXDRD bit is reset, exceptions that cause
interrupts cause DMA activity to stop until an interrupt task services the exception.
The decision of whether to set or clear the EXDRD bit depends on the intended usage. If
the target baud rate is high relative to system loading, setting the EXDRD bit can prevent
the loss of data due to interrupt latency. This is especially true when using the UART, or
when using the High-Speed UART without the FIFO. If break or address bit information is
to be stored with the character for later retrieval, setting the EXDRD bit is appropriate.
Setting this bit can complicate system software, especially if XON/XOFF flow control is
used, because the flow control characters are stored in the circular buffer. The system
software must find the character and perform the correct action immediately, and then ignore
the character when reading data out of the buffer later.
When using the FIFO on the High-Speed UART, these exceptions (break, parity error,
framing error, address bit, overrun error, and character match) are placed in the FIFO and
move with the associated data so that the software can match the exception with the correct
character. This means that a system programming error that keeps data from being pulled
out of the FIFO (e.g., misprogramming of the DMA) may keep interrupts from ever occurring.
For this reason, the High-Speed UART has an additional Overrun Error-Immediate (OERIM)
interrupt bit that is not placed in the FIFO. Software can monitor or interrupt on OERIM to
detect and correct this sort of system programming error.
Small or Misaligned Circular Buffers
If a circular buffer is smaller than 1K, is not aligned on a multiple of its size, or the size is
not a power of 2, the address wrap features of the DMA are not available. The DMA can
still be used to implement a circular buffer, but it requires more programming effort, and the
required interrupt could introduce unacceptable latency into the system. System software
must always use interrupts, set the TC bit, and carefully program the Transfer Count register
Содержание 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...