English
Language : 

AN1950 Datasheet, PDF (14/24 Pages) Freescale Semiconductor, Inc – Water Level Monitoring
dsplINf: lda #'i'
jsr lcdchro
lda #'n'
reusef: jsr lcdchro
lda #'/'
jsr lcdchro
lda #'s'
jsr lcdchro
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
gfxupdt: lda #$40
;======== Graphics Update: tough stuff ===========
jsr lcdcmdo ;prepare to write 8 bytes into CGRAM starting at @ $40
ldhx#ramfree;point to 40 pressure readings (this reuses wrflash RAM)
mov #$08,DA ;DA will count those 8 CGRAM addresses
cg8: lda 0,x
sta NC
lda 1,x
sta NB
lda 2,x
sta NA
lda 3,x
sta DC
lda 4,x
staDB;readings 0-4 go into NC,NB,NA,DC,DB and will form 1 LCD special
character
mov #$08,RA ;RA will count the 8 bits
fill:clrRB;start with RB=0, this will eventually contain the data for CGRAM
rol NC
rolRB
rol NB
rolRB
rol NA
rolRB
rol DC
rolRB
rol DB
rolRB;rotate left those 5 values and use carry bits to form RB (tough part)
lda RB
jsrlcdchro;and put it into CGRAM
dec RA
;do this 8 times to cover all 8 bits
bne fill
incx
incx
incx
incx
incx ;now point to next 5 values for next CGRAM address (5 values per
character)
dec DA
;do this for all 8 CGRAM characters
bne cg8
ldaweath;get weather variable and decide which message to display
cmp #$04
bne try3210
ldhx #msg02e ;if $04
bra showit
try3210: cmp #$03
bne try210
ldhx #msg02d ;if $03
bra showit
try210: cmp #$02
AN1950
14
Sensors
Freescale Semiconductor