Motorola ColdFire MCF5281 User Manual

Page 448

Advertising
background image

UART Modules

23-28

Freescale Semiconductor

To configure the UART for DMA requests:

1. Initialize the DMAREQC in the SCM to map the desired UART DMA requests to the desired DMA

channels. For example, setting DMAREQC[7:4] to 1000 maps UART0 receive DMA requests to
DMA channel 1, setting DMAREQC[11:8] to 1101 maps UART1 transmit DMA requests to DMA
channel 2, and so on. It is possible to independently map transmit-based and receive-based UART
DMA requests in the DMAREQC.

2. Disable interrupts using the UIMR register. The appropriate UIMR bits must be cleared so that

interrupt requests are disabled for those conditions for which a DMA request is desired. For
example, to generate transmit DMA requests from UART1, UIMR1[TXRDY] should be cleared.
This prevents TXRDY from generating an interrupt request while a transmit DMA request is
generated.

3. Enable DMA access to the UARTn registers by setting the corresponding PACR register in the

SCM for read/write in supervisor and user modes.

4. Enable DMA access to SRAM by setting the SPV bit in the core RAMBAR, and the BDE bit in

the SCM RAMBAR

5. Initialize the DMA channel. The DMA should be configured for cycle steal mode and a source and

destination size of one byte. This causes a single byte to be transferred for each UART DMA
request. Set the disable request bit (DCRn[D_REQ] to disable external requests when the BCR
reaches zero.

6. For a transmit process:

— Set the DMA SAR register to the address of the source data

— Set DCRn[SINC] to increment the source pointer

— Set DAR to the address if the UART transmit buffer (UTB)

— Clear DCRn[DINC]

— Set BCR to the number of bytes to transmit.

7. For a receive process:

— Set the DMA SAR register to the address of the UART receive buffer (URB)

— Clear DCRn[SINC]

— Set DAR to the address of the source data

— Set DCRn[DINC] to increment the destination pointer

— Set BCR to the number of bytes to transmit.

8. Start the data transfer by setting DCRn[EEXT], which enables the UART channel to issue DMA

requests.

Table 23-14

shows the DMA requests.

Table 23-14. UART DMA Requests

Register

Bit

DMA Request

UISRn

1

Receive DMA request

UISRn

0

Transmit DMA request

MCF5282 and MCF5216 ColdFire Microcontroller User’s Manual, Rev. 3

Advertising
This manual is related to the following products: