Motorola MC68302 User Manual page 365

Integrated multiprotocol processor
Hide thumbs Also See for MC68302:
Table of Contents

Advertisement

BLT
DBRA
***Now ready to go ***
***Set IMR and Enable SCC1 ***
MOVE.W
MOVE.W
ORI.W
JMP
******************************Main Routine ******************************
* Set up BD pointers
MAIN
LEA.L
LEA.L
LEA.L
* The following is an infinite loop that prepares data to be sent
* when a Tx BD is available to be used.
CLR.L
*
TxReady
BTST.B
BNE.B
Confirm
CMPI.W
BNE.B
*
*Set TXBD if it is to be changed, e.g.,
*
ORI.W
* Mask off interrupt for the following operations
MOVE.W
MOVE.W
BSET.B
ADDO.L
BTST.B
BNE.B
ADDQ.W
BRA.B
Wrapit
LEA.L
Umask
MOVE.W
JMP
********************SCC1 interrupt handler ********************
ORG
* Check events:
CLR.L
MOVE.B
MOVE.L
ANDI.W
CMPI.W
BNE.B
CK_TX
MOVE.L
ANDI.W
MOTOROLA
NxtBT
D1,NxtBF
#$2000,1MR
#$2000,SR
#EN_SCC,SCM1
MAIN
TXBD_01,A1
TXBD_01,A2
RXBD_01,A3
D3
#READY,(A2)
TxReady
#$0,LN_BD(A2)
Confirm
#$5C00,ST_BD(A2)
#$2700,SR
#N_DATA,LN_BD(A2) ;Set data length to 6
#READY,ST_BD(A2)
#1,D3
#WRAP,ST_BD(A2)
Wrapit
#SZ_BD,A2
Unmask
TXBD _ 01,A2
#$2000,SR
TxReady
INT_VEC
Handle RX then TX then Errors
D1
SCCE1,D1
D1,D2
#9,D2
#0,D2
RX_INT
D1,D2
#$12,D2
MC68302 USER'S MANUAL
;Next Byte
;Next Buffer
;Allow SCC1 interrupt only
;Unmask interrupts
;ENT = ENR = 1
;Go to Main routine for Tx and Rx
;A1 = CTD pointer
;A2 = NTD pointer
;A3= PRD pointer
;D3 is used to count Tx frames
transmitted in the loop
;Test Ready Bit
;If Ready = 0, the BD has been sent
;test NTD ->data length
;If
length = 0, the BD has been
confirmed
;Set Ready bit
;Inc Tx frame count
;Test Wrap bit
;If Wrap . 1, wrap a
;Move NTD to next BD
;Wrap back to the first TX BD
;Unmask interrupt
;Interrupt Vector for SCC1
;Clear D1
;SCCE1
, D1
;SCCE1
, D2
;Are RXF or RXB set?
;If they are set
;Handle receiver's interrupt
;SCCE1
, D2
;Are TXF or TXB set?
MC68302 Applications
D-15

Advertisement

Table of Contents
loading

Table of Contents