Freescale Semiconductor, Inc.
* Serial register offsets from serial base address
MR1A
MR2A
SRA
CSRA
CRA
EQU
EQU
EQU
EQU
EQU
$10
$20
$11
$11
$12
Mode register 1 A
Mode register 2 A
Status register A
Clock select reg A
Command reg A
ACR
EQU
EQU
EQU
EQU
$14
$1D
$1E
$1F
Auxiliary control reg
Output port control reg
Output port bit set (write 1 to set)
Output port bit reset (write 1 to clear)
OPCR
OP_BS
OP_BR
***************************************************************************
***************************************************************************
* 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
MOVE.B
#$00,MCRH(A0)
#$02,MCRL(A0)
* WAIT FOR TRANSMITTER EMPTY (OR TIMEOUT)
MOVE.W
XBMTWAIT EQU
BTST
#$2000,D0
*
#3,SRA(A0)
init loop counter
TX empty in status reg?
loop until set or timeout
NOP
DBNE
D0,XBMTWAIT
* NEGATE RTSA SIGNAL OUTPUT
MOVE.B
MOVE.B
#0,OPCR(A0)
#$01,OP_BR(A0)
make OP0-7 general purpose
clear RTSA/OP0 output
* RESET RECEIVER/TRANSMITTER
MOVE.B
MOVE.B
#$20,CRA(A0)
#$30,CRA(A0)
Issue reset receiver command
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
7- 48
MC68340 USER’S MANUAL
MOTOROLA
For More Information On This Product,
Go to: www.freescale.com