MC68302 Applications
MOTOROLA
MC68302 USER’S MANUAL
D-21
* of idles are received without a new * character. Note that 0 is the maximum
* value. In this case the buffer will always be closed after 1 character, so
* MAX_IDL is a don't care.
MOVE.W #$1,$7006A0
* STOP TRANSMIT command executed. The STOP TRANSMIT command is not used in
* this code.
MOVE.W #$0,$7006A2
MOVE.W #$0,$7006A4
MOVE.W #$0,$7006A6
MOVE.W #$0,S7006A8
* Initialize counters to zero
MOVE.W #$0,$7006aa
MOVE.W #$0,$7006ac
* UART Address characters not used in normal operation.
MOVE.W #$8000,$7006B0
* Initialize CHARACTER8
MOVE.W #$0000,$7006BE
* No control characters are initialized to cause special interrupts.
* The flow-control facility (XON-XOFF) is not used.
MOVE.B
#$FF,SCCE3
MOVE.B
#$15,SCCM3
*Interrupts in SCCM3 are allowed only for BRK (break character
*received), BSY (no receive buffer available), and RX (buffer
* received). Note that buffers are 1 character in this application.
MOVE.W
#$0100,1MR
MOVE.W
#$17d,SCM3
* Set ENR and ENT bib in SCM3.
CLR.L
D0
CLR.L
D1
CLR.L
D3
CLR.L
D4
CLR.L
D5
CLR.L
D6
MOVEA.L
#$700600,A0
MOVEA.L
#$30002,A1
MOVEA.L
#$700640,A2
MOVE.W
#$2000,SR
***************************************************************************
* Transmit Code
* OUTERLOOP
OUTLOOP
CMPI.B
#$0,D6
BEQ.B
OUTLOOP
SUBQ.B
#$1,D6
* INNERLOOP:
INLOOP
BTST.B
#$07,(A2)
BNE.B
INLOOP
* The following sets up and sends out the transmit buffer
ADDO.W
#$1,D4
MOVEA.L A2,A3
ADDQ.W
#$4,A3
MOVEA.L (A3),A3
MOVE.B
(A1),(A3)
ADDQ.W
#2,A2
MOVE.W
#$1,(A2)
SUBO.W
#2,A2
;BRKCR = 1. Only one break char. sent if
;PAREC = 0000
;FRMEC = 0000
;NOSEC = 0000
;BRKEC = 0000
;UADDR1 = 0000
;UADDR2 = 0000
;CHARACTER1 = 8000
;CHARACTER8 = 0000
;clear SCCE3
;SCCM3 = 15
;IMR=0100. Allow SCC3 interrupts only.
;SCM3 = 017d
;clear all used data registers
;Load A0 as current Rx BD pointer
;Load A1 as current “next Tx Byte” ptr
;Load A2 as current Tx BD pointer
;Enable interrupts. Stay in spvr mode.
; Something to send (is D6> =1)
; Stay in outerloop if 0
; Decrement send status by 1 (0 = empty)
; Test Ready bit of Tx BD
; Fall thru if 0, else wait in innerloop
; Increment number of chars transmitted
; A3 will be used to find Tx data buffer
; Inc A3 to point to Tx data pointer
; A3 now points to Tx Data buffer
; Move char from Rx Buffer to Tx Buffer
; Increment A2 to point to byte count
; Set TxBD Byte count to 1
; A2 now points to beginning of Tx BD