![](http://datasheet.mmic.net.cn/120000/MC68349FT16_datasheet_3559370/MC68349FT16_154.png)
4- 42
MC68349 USER'S MANUAL
MOTOROLA
4.4.3 SIM49 Example Configuration Code
The following code is an example configuration sequence for the SIM49 module.
********************************************************************************
* MC68349 basic SIM49 register initialization example code:
* This code is used to initialize the MC68349's internal SIM49 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
****************************************
* SIM49 register offsets from MBAR base address
MCR
EQU
$00
SYNCR
EQU
$04
SYPCR
EQU
$21
CSAM0
EQU
$40
CSBAR0
EQU
$44
CSAM1
EQU
$48
CSBAR1
EQU
$4c
CSAM2
EQU
$50
CSBAR2
EQU
$54
CSAM3
EQU
$58
CSBAR3
EQU
$5c
********************************************************************************
* Reset vectors
* These two vectors should be located at addresses $0 and $4 after a processor
* hardware reset.
********************************************************************************
ORG
$60000
SSP_VEC
DC.L
SSP_INIT
Supervisor stack pointer - initial value
RST_VEC
DC.L
INIT340
Reset vector pointing to initialization code
********************************************************************************
* Initialization code
********************************************************************************
* Start Chip Select Initialization:
INIT340
MOVE.W
#$2700,SR
Init SR - interrupts masked
* AS7 is set to prevent module blocked (mapped at $FFFFFxxx) from responding to
* an interrupt acknowledge access ($FFFFFFFx)—these accesses ate handled by
* dedicated IACK logic in the SIM49