MC68302 Applications
D-20
MC68302 USER’S MANUAL
MOTOROLA
* 00700608 1000 0000 0003 0003 (wrap bit set)
BAR
GIMR
IPR
IMR
ISR
PACNT
SIMODE
SCON3
SCM3
SCCE3
SCCM3
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
EQU
$0F2
$700812
$700814
$700816
$700818
$70081e
$7008b4
$7008a2
$700&4
$7008a8
$7008aa
*SCC3 Initialization Code
ORG
MOVE.W #$700.BAR
* Base Address - S700000, so ALL MC68302 on-chip peripherals begin at
* address S700xxx.
$30300
;BAR = 0700
MOVE.W #$00A0, GIMR
MOVE.W #$FFFF,IPR
MOVE.L #$30500,$2a0
MOVE.W #$0300,PACNT
* Causes the SCC3 TXD3 and RXD3 pins to be enabled. TCLK3 and RCLK3
* pins are left as parallel l/O pins.
MOVE.W #50,SIMODE
* SCC3 is set up for NMSI (i.e. modem) operation. No multiplexed
* modes are used on the other SCCs.
MOVE.W #$00d8,SCON3
* Baud Rate generator is used for transmit and receive. Rate is 9556bps.
MOVE.W #$171,SCM3
* No parity. Normal UART operation. 8-bit characters. 2 Stop bits.
* The CD and CTS lines not used to enable reception and transmission,
* but do cause a status change in the SCC3 Event register.
MOVE.L #$50000000,S700640 ;Set up Tx BD 0 Status and Count
MOVE.L #$30000,$700644
MOVE.L #$70000000,$700648
MOVE.L #$30001,$70064c
* Set up 2 Tx BDs
MOVE.L #$d0000000,$700600 ;Set up Rx BD 0 Status and Count
MOVE.L #$30002,$700604
MOVE.L #$f0000000,$700608
MOVE.L #$30003,$70060c
* Set up 2 Rx BDs
MOVE.W #$0,$700680
* Must be initialized to a value other than 7, or won't work with chip selects
MOVE.W #$1,$700682
;GIMR = 00a0
;clear IPR
;SCC3 vector initialization
;PACNT = 0300
;SIMODE = 0000 (its reset value)
;SCON3=00d8 for ~9600 baud at 16.67 MHz
;SCM3 = 0171
;Set up Tx BD 0 Buffer Address
;Set up Tx BD 1 Status and Count
;Set up Tx BD 1 Buffer Address
;Set up Rx BD 0 Buffer Address
;Set up Rx BD 1 Status and Count
;Set up Rx BD 1 Buffer Address
;clear RFCR/TFCR (Function code setup)
;MRBLR = 0001 (one-byte receive
buffers)
* This combined with the “l(fā)” bit set in the Rx BD, gives interrupts on each
* character received.
MOVE.W #$4,$70069c
* Normally set to a small value, it closes a receive buffer if a certain number
;MAX_IDL don't care since MRBLR =1.