4- 48
MC68341 USER’S MANUAL
MOTOROLA
4.5.3 SIM41 Example Configuration Code
The following code is an example configuration sequence for the SIM41 module.
***************************************************************************
* MC68341 basic SIM41 register initialization example code:
* This code is used to initialize the MC68341's internal SIM41 registers,
* providing basic functions for operation.
* It includes chip select programming for external devices.
* This code would be programmed beginning at offset $0 into ROM which is
* relocated to address $60000 by the initialization code.
* The SSP_VEC and RST_VEC vectors used to initialize the system stack
* pointer and initial PC, respectively, are located at offset $0 after
* reset.
***************************************************************************
* equates
***************************************************************************
SSP_INIT EQU
$10000
Stack pointer initial value - top of RAM
MBAR
EQU
$0003FF00
Address of Module Base Address Reg.
MODBASE
EQU
$FFFFF000
Default Module Base address value
****************************************
* SIM41 register offsets from MBAR base address
MCR
EQU
$00
SYNCR
EQU
$04
SYPCR
EQU
$21
CSAM0
EQU
$40
***************************************************************************
* Reset vectors
* These two vectors should be located at offset $0 in the boot ROM.
***************************************************************************
ORG
$60000
SSP_VEC
DC.L
SSP_INIT
Supervisor stack pointer - initial value
RST_VEC
DC.L
INIT340
Reset vector pointing to init code
***************************************************************************
* Initialization code
***************************************************************************
INIT340
MOVE.W
#$2700,SR
Init SR - interrupts masked
***************************************************************************
* Set up default module base address value
MOVEQ.L
#7,D0
MBAR is in CPU space
MOVEC.L
D0,DFC
Load DFC to indicate CPU space
MOVE.L
#MODBASE+$1BB,D0
Allow DMA, supervisor/user data accesses
MOVES.L
D0,MBAR
Write to MBAR
***************************************************************************
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
..
.