CNT
Lgfx
ds
ds
1
1
weath ds
UnitType ds
UnitDiv ds
UnitEmpt ds
UnitFull ds
1
1
1
1
1
1
1
ram0
NC
ds
ds
NB
NA
DC
DB
ds
ds
ds
ds
ds
ds
ds
ds
ds
ds
ds
ds
ds
ds
1
1
1
1
1
1
1
1
1
1
1
DA
MB
MA
OB
OA
RB
RA
P0C
P0B
P0A
NPTR
1
1
1
ds
1
ramfree ds 80
;used both for running RAM version of wrflash & storing 40 readings
;__________________________________________________________
;__________________________________________________________
;__________________________________________________________
org rom
cold: rsp
jsr ALLINIT
jsr WARMUP
;reset SP if any issues (all interrupt vectors point here)
;general initialization
;give LCD extra time to initialize
brset 1,porta,nocalib
brset 2,porta,nocalib
jmp CALIB
;only do calibration if SEL & ENT at reset
nocalib: ldhx #msg01
;otherwise skip and show welcome messages
;"Reference Design" msg
;wait 1s
jsr lcdstro
jsr del1s
ldhx #msg01a
jsr lcdstro
;"Water Level" msg
jsr del1s
;wait 1s
initCM: ldhx #$A014
sthx UnitType
;initialize default units to cm ($A0=cm, $3F=in)
;UnitType set to $A0; UnitDiv set to $14
ldhx #$039E
sthx UnitEmpt
;UnitEmpt set to $03; UnitFull set to $9E
MENU: ldhx #msg01b
jsr lcdstro
clr RA
lda #$0D
jsr lcdcmdo
;Menu msg
;menu choice=0 to begin with
;blink cursor on menu choice
;get current menu choice
luke: ldx RA
clrh
lda menupos,x
jsr lcdcmdo
;and look up corresponding LCD address
;reposition cursor
AN1950
Sensors
8
Freescale Semiconductor