
MC68302 Applications
D-14
MC68302 USER’S MANUAL
MOTOROLA
Set RXBD
MOVE.B
SUBQ.B
MOVE.W
MOVE.W
MOVE.L
ADDQ.L
ADDA.L
DBRA
#BD_CNT,D3
#2,D3
D1,ST_BD(A0)
#0,LN_BD(A0)
A1,PT BD(A0)
#SZ_BD,A0
#SZ_BF,A1
D3,SetRXBD
;# of BD used = 8
;Set Control and Status Bits
;Length = 0
;Set buffer pointer
;Next BD
;Next BF
* Set the last BD
MOVE.W
MOVE.W
MOVE.L
D2,ST_BD(A0)
#0,LN_BD(A0)
A1,PT_BD(A0)
;Wrap = 1
;Length = 0
;Buffer Pointer
*SCC1 Tx Buffer Descriptors Initialization values before execution
*00700440 5C00 0000 0003 0080 5C00 0000 0003 0090
*00700450 5C00 0000 0003 00A0 5C00 0000 0003 00B0
*00700460 5C00 0000 0003 00C0 5C00 0000 0003 00D0
*00700470 5C00 0000 0003 00E0 7C00 0000 0003 00F0
*
*
SetTXBD
LEA.L
LEA.L
MOVE.W
TXBD_01,A0
TXBF_01,A1
#$5C00, D1
;A0 points to the first TXBD of SCC1
;A1 points to the first buffer
;D1 is used for setting the status of BD
;Ready = 0, External = 1, Interrupt = 1,
;Last = 1, TxCRC = 1
;D2 is for the last BD, Wrap = 1
;# of BD used = 8
;Count from 6 to 0
;Set Control and Status Bits
;Length = 0
;Set buffer pointer
;Next BD
;Next BF
MOVE.W
MOVE.L
SUBQ.B
MOVE.W
MOVE.W
MOVE.L
ADDQ.L
ADDA.L
DBRA
#$7C00,D2
#BD_CNT,D3
#$2,D3
D1,ST_BD(A0)
#0,LN_BD(A0)
A1,PT_BD(A0)
#SZ_BD,A0
#SZ_BF,A1
D3,SetTXBD
*Set the last BD
MOVE.W
MOVE.W
MOVE.L
D2,ST_BD(A0) ;Wrap = 1
#0,LN_BD(A0) ;Length = 0
A1,PT_BD(A0) ;Buffer Pointer
***Prepare Tx Buffers: In this example each frame fits into one buffer ***
*00030080 0001 0203 0405 0607 0809 0A0B 0C0D 0E0F
*00030090 0001 0203 0405 0607 0809 0A0B 0C0D 0E0F
* . . .
*000300F0 0001 0203 0405 0607 0809 0A0B 0C0D 0E0F
LEA.L
TXBF_01,A0
MOVE.L
#SZ_BD,D1
SUBO.B
#1,D1
NxtBF CLR.L
D2
NxtBT MOVE.B
D2,(A0)+
ADDQ.B
#$1,D2
CMPI.B
#SZ_BF,D2
;A1 points to the first buffer
;D1 is used to count the BD
;D2 is used as content and counter of BF
;Number of data in a buffer is 16