dsplINf: lda #'i'
jsr lcdchro
lda #'n'
reusef: jsr lcdchro
lda #'/'
jsr lcdchro
lda #'s'
jsr lcdchro
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
gfxupdt: lda #$40
jsr lcdcmdo
;======== Graphics Update: tough stuff ===========
;prepare to write 8 bytes into CGRAM starting at @ $40
ldhx#ramfree;point to 40 pressure readings (this reuses wrflash RAM)
mov #$08,DA
lda 0,x
;DA will count those 8 CGRAM addresses
cg8:
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
bne fill
;do this 8 times to cover all 8 bits
incx
incx
incx
incx
incx ;now point to next 5 values for next CGRAM address (5 values per
character)
dec DA
bne cg8
;do this for all 8 CGRAM characters
ldaweath;get weather variable and decide which message to display
cmp #$04
bne try3210
ldhx #msg02e
bra showit
try3210: cmp #$03
bne try210
;if $04
;if $03
ldhx #msg02d
bra showit
try210: cmp #$02
AN1950
14
Sensors
Freescale Semiconductor