03.01.2015 Views

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

80C186EC/80C188EC Microprocessor User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DIRECT MEMORY ACCESS UNIT<br />

10.2.1.8 Setting the Relative Priority of a Channel<br />

The priority of a channel within a module is controlled by the Priority bit in the DMA Control<br />

Register (Figure 10-13 on page 10-20). A channel may be assigned either high or low priority. If<br />

both channels are programmed to the same priority (i.e., both high or both low), the channels rotate<br />

priority.<br />

10.2.2 Setting the Inter-Module Priority<br />

The inter-module priority for the DMA Unit is controlled by the DMAPA and DMAPB bits in<br />

the DMA Module Priority Register (Figure 10-14 on page 10-24). A module may be assigned either<br />

high or low priority. When both modules are assigned the same priority, the modules rotate<br />

priority.<br />

10.2.3 Using the DMA Unit with the Serial Ports<br />

The following setup is used for DMA-serviced serial port reception.<br />

• The source pointer points at the receive buffer (SxRBUF) in the serial port.<br />

• The destination pointer points to the area in memory where the message will be saved.<br />

• The DMA channel is programmed for serial channel requests.<br />

• The transfer count register holds the length of the memory buffer.<br />

The serial port DMA request pulses high after each byte is received. The DMA unit then fetches<br />

the received byte from the receive buffer (SxRBUF) register and deposits it in memory. Typically,<br />

the channel is programmed to interrupt the CPU when the memory buffer is full (i.e., when<br />

the transfer count reaches zero).<br />

The following setup is used for DMA-serviced serial port transmission.<br />

• The source pointer points to the area of memory where the message resides.<br />

• The destination pointer points to the transmit buffer (SxTBUF) for the serial channel.<br />

• The DMA channel is programmed for serial channel requests.<br />

• The transfer count register holds the length of the memory buffer.<br />

The serial port DMA request pulses high after each byte is transmitted. The DMA unit then fetches<br />

the next byte of the message from memory and deposits it in the transmit buffer (initiating another<br />

transfer). Typically, the channel is programmed to interrupt the CPU when the memory<br />

buffer is empty (i.e., when the transfer count reaches zero).<br />

DMA-driven transmissions must be “primed” by sending the first byte manually, thus generating<br />

the first transmit interrupt.<br />

10-26

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!