MOTOROLA
MC68341 USER'S MANUAL
6- 41
Example 2: Internal Request Generation, Memory to Memory Transfers.
***************************************************************************
* MC68341 basic DMA channel register initialization example code.
* This code is used to initialize the 68341's internal DMA channel
* registers, providing basic functions for operation.
* The code sets up channel 1 for internal request generation
* memory to memory transfers.
***************************************************************************
* Equates
***************************************************************************
SARADD
EQU
$6000
source address
DARADD
EQU
$8000
destination address
NUMBYTE EQU
$E
number of bytes to transfer
***************************************************************************
* Initialize DMA Channel 1
***************************************************************************
LEA
MODBASE+DMACH1,A0
Pointer to channel 1
* Initialize DMA channel 1 MCR
* Normal Operation, ignore FREEZE, dual-address mode. ISM field at 3. CPU32
* SR I2-I0 bits must be less than or equal to ISM bits for channel startup.
* Supervisor/user reg. unrestricted, MAID field at 3. IARB priority at 4.
MOVE.W
#$0334,(A0)
* Clear channel control reg.
* Clear STR (start) bit to prevent the channel from starting a transfer early.
CLR.W
DMACCR1(A0)
* Initialize interrupt reg.
* Interrupt priority at 7, interrupt vector at $42.
MOVE.W
#$0742,DMAINT1(A0)
* Initialize channel status reg.
* Clear the DONE, BES, BED, CONF and BRKP bits to allow channel to startup.
MOVE.B
#$7C,DMACSR1(A0)
* Initialize function code reg.
* DMA space, supervisor data space for source and destination.
MOVE.B
#$DD,DMAFCR1(A0)
* Initialize source operand address
* Source address is equal to $6000.
MOVE.L
SARADD,DMASAR1(A0)
* Initialize destination operand address
* Destination address is equal to $8000.
F
re
e
sc
a
le
S
e
m
ic
o
n
d
u
c
to
r,
I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
c
..
.