Motorola Espresso Maker MC68340 Benutzerhandbuch

Seite von 441
7- 48
MC68340 USER’S MANUAL
MOTOROLA
* Serial register offsets from serial base address
MR1A
EQU
$10
Mode register 1 A
MR2A
EQU
$20
Mode register 2 A
SRA
EQU
$11
Status register A
CSRA
EQU
$11
Clock select reg A
CRA
EQU
$12
Command reg A
ACR
EQU
$14
Auxiliary control reg
OPCR
EQU
$1D
Output port control reg
OP_BS
EQU
$1E
Output port bit set (write 1 to set)
OP_BR
EQU
$1F
Output port bit reset (write 1 to clear)
***************************************************************************
***************************************************************************
* Initialize Serial channel A
***************************************************************************
LEA
MODBASE+SERIAL,A0
Pointer to serial channel A
* Module configuration register:
* Enable serial module for normal operation, ignore FREEZE, select the
* crystal clock. Supervisor/user serial registers unrestricted.
* Interrupt arbitration at priority $02.
MOVE.B
#$00,MCRH(A0)
MOVE.B
#$02,MCRL(A0)
* WAIT FOR TRANSMITTER EMPTY (OR TIMEOUT)
MOVE.W
#$2000,D0
init loop counter
XBMTWAIT EQU
*
BTST
#3,SRA(A0)
TX empty in status reg?
NOP
DBNE
D0,XBMTWAIT
loop until set or timeout
* NEGATE 
RTSA
 SIGNAL OUTPUT
MOVE.B
#0,OPCR(A0)
make OP0-7 general purpose
MOVE.B
#$01,OP_BR(A0)
clear 
RTSA
/OP0 output
* RESET RECEIVER/TRANSMITTER
MOVE.B
#$20,CRA(A0)
Issue reset receiver command
MOVE.B
#$30,CRA(A0)
Issue reset transmitter command
* SET BAUD RATE SET 2
MOVE.B
#$80,ACR(A0)
* MODE REGISTER 1
MOVE.B
#$93,MR1A(A0)
8 bits, no parity, auto RTS control
 
   
  
F
re
e
sc
a
le
 S
e
m
ic
o
n
d
u
c
to
r,
 I
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 
Freescale Semiconductor, Inc.
For More Information On This Product,
   Go to: www.freescale.com
n
c
.
..