MC68302 Applications
D-12
MC68302 USER’S MANUAL
MOTOROLA
IMR
ISR
SIMODE
SCON1
SCM1
SCCE1
SCCM 1
EN_SCC
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
BASE + $816
BASE + $818
BASE + $8B4
BASE + $882
BASE + $884
BASE + $888
BASE + $88A
$0C
;Interrupt Mask Register
;In-Service Register
;Serial Interface Mode Register
;SCC1 Configuration Register
;SCC1 Mode Register
;SCC1 Event Register
;SCC1 Mask Register
;ENR and ENT bits in SCM
***SCC1 Parameter Table ***
ST_BD
EQU
SS_BD
EQU
LN_BD
EQU
PT_BD
EQU
SZ_BD
EQU
FCR_1
EQU
MRBLR_1
EQU
RXBD_01
EQU
TXBD_01
EQU
READY
EQU
EMPTY
EQU
WRAP
EQU
* The following values are application dependent for this example
RXBF_01
EQU
$030000
TXBF_01
EQU
$030080
BD_CNT
EQU
$08
SZ_BF
EQU
$10
N_DATA
EQU
6
* SCC1 HDLC Parameters
CMSKL_1
EQU
BASE+$04A0
CMSKH_1
EQU
BASE+$04A2
DISFC_1
EQU
BASE+$04A8
CRCEC_1
EQU
BASE+$04AA
ABTSC_1
EQU
BASE+$04AC
NMARC _ 1 EQU
BASE+$04AE
RETRC_1
EQU
BASE+$04B0
MFLR_1
EQU
BASE+$04B2
HMASK 1
EQU
BASE+$04B6
0
1
2
4
$08
BASE+$0480
BASE+$0482
BASE+$0400
BASE+$0440
$07
$07
$05
;Status and Control in BD
;Status in BD
;Data Length in BD
;Buffer pointer in BD
;Size of BD = 8 bytes
;RFCR and TFCR for SCC1
;Max Rx Buffer Length
;RX BD 0 in SCC1
;TX BD 0 in SCC1
;Ready bit in the 1st byte of TX BD
;Empty bit in the 1st byte of RX BD
;Wrap bit in the 1st byte of BD
;Address of the first RX buffer
;Address of the first TX buffer
;Number of BDs used
;Size of buffer =16 bytes
;Number of data to be sent in a buffer
;CRC Mask Low
;CRC Mask High
;Discard Frame Counter
;CRC Error Counter
;Abort Sequence Counter
;Nonmatching Address Receive Counter
;Frame Retransmission Counter
;Max Frame Length Register
;User-Defined Frame Address Mask
********************** Typical M68302 Initialization Code********************
* Register Initialized values in ADS board before execution
* USP = 00080000 ISP = 000040000 (Stack pointer not used)
ORG
INIT
MOVE.W
#$2700,SR
* Set Base Address = $700000
* Now all 68302 on-chip peripherals begin at address $700xxx
MOVE.W
#$0700,BAR
* Set System Control Register
MOVE.L
#0,SCR
***Setups for interrupt ***
MOVE.W
#$0A0,GIMR
MOVE.W
#0,IMR
MOVE.W
#$FFFF,IPR
;PC = 00030300
;SR = 2700, mask off interrupts
;BAR = 0700
;Nothing special for this example
;Normal mode, v7–v5 = 5
;Mask off all for now
;Clear IPR
*** Set up Serial Interface Connection ***