
Monitor Initialization Code
C-41
M68VZ328ADS USER’S MANUAL
MOTOROLA
RTCHMSR
.equ
(M$B00); Hrs Mins Secs Reg
RTCALM0R
.equ(M$B04); Alarm Register 0
RTCDAY
.equ
(M$B08); RTC date reg
RTCWD
.equ
(M$B0A); RTC watch dog timer reg
RTCCTL
.equ
(M$B0C); Control Reg
RTCISR
.equ
(M$B0E); Interrupt Status Reg
RTCIENR
.equ
(M$B10); Interrupt Enable Reg
RSTPWCH
.equ(M$B12) ; Stopwatch Minutes
; ICEM registers
ICEMACR
.equ (M$D00)
ICEMAMR
.equ (M$D04)
ICEMCCR
.equ (M$D08)
ICEMCMR
.equ (M$D0A)
ICEMCR
.equ (M$D0C)
ICEMSR
.equ (M$D0E)
****************************************************************************
*
RESET OPTIONS
****************************************************************************
.section .reset
rom_base:
;--
SECTIONrom_reset - SP, start addr & space for Exception Vectors
.DC.LMON_STACKTOP
; stack pointer
.DC.LMON_BOOT
; program counter
.skip(62*4)
; space for Motorola defined Exception Vectors
.skip(192*4)
; space for the 192 User defined Exception Vectors
.global ___reset
___reset:
;************************************************
;* System initialization
*
;************************************************
move.b
#$18,SCR
; Disable Double Map
;************************************************
;* Primary boot image is at start of flash.
;* Secondary boot image is at start+0x10000.
;* If this is the primary image and PD2 is low,
;* boot alternate image.
;************************************************
lea.l0(PC), A0
; get PC
move.lA0, D0
and.l#$10000, D0
; is this secondary image?
bne.sJMPSKIP
; if so, skip check switch and init,
bra
boot_trk
JMPSKIP
jmp
skip_all
;
ori.b
#$0F,PDSEL
;
move.b
#$03,PDDIR
;
move.b
#$FF,PDPUEN
;
move.b
PDDATA,D0
;
andi.b
#$04,D0
;
bne.sboot_trk
; if PD2 high, boot this image
;
move.l$01010000, SP; otherwise boot alternate image
;
move.l$01010004, A0
;
jmp
(A0)
;************************************************
; Booting MetroTRK
;************************************************
boot_trk:
move.b
#$9,PGSEL
; config PG0/DTACK to GPI/O,input
move.w
#$2480,PLLCR
; ??MHz Sysclk, enable clko
move.l
#MON_STACKTOP,A7
; Install stack pointer
move.w
#$2700,sr
; mask off all interrupts
move.w
#$00,RTCWD
; disable watch dog
move.w
#$08,ICEMCR
; disable ICEM vector hardmap
move.w
#$07,ICEMSR
; clear level 7 interrupt
;******************************
;* Port Initialization
*
;******************************
move.b
#$03,PFSEL
; select A23-A20, CLKO, CSA1
move.b
#$00,PBSEL
; Config port B for chip select A,B,C and D
move.b
#$00,PESEL
; select *DWE
move.b
#$F1,PKSEL
Freescale Semiconductor, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc.
..