Mugel
- 22nd October 2006, 21:23
Hi You all!
had a VERY small program using "count" and "LCDout" . Problem occurs at the display:
Every time the value displayed on the LCD goes down from two digits to one or from three to two it keeps the first number which isnīt cleared.
Going up works fine because it overwrites every digit, but going down keeps some old ones.
So I put in the "Clear Display" command into the loop but that makes the whole display flashing...otherwise the frequency counter works fine for me.
How can I clear the numbers of my value on the display without flashing the whole thing?
'
' DEFINITIONS
'
Cnt VAR Word ' Cnt is a word variable
'
' START OF MAIN PROGRAM
'
CMCON = 7 ' RA0-RA3 are digital I/O
TRISA = 0 ' PORT A is output
TRISB = 1 ' PORT B0 is input others output
PAUSE 500 ' Wait 0.5 second to initialize LCD
Cnt = 0 ' Clear Cnt to zero
LCDOUT $FE,1 ' Clear LCD
LCDOUT $FE,2
RPT:
cnt = 0
LCDOUT $FE,1 ' here is my problem!! makes everything flashing!'
LCDOUT $FE,2
Count PORTB.0,1000,CNT
LCDOUT "Freq.= ",$FE,$C0,DEC Cnt ' Display count
PAUSE 1000
Goto RPT
END
had a VERY small program using "count" and "LCDout" . Problem occurs at the display:
Every time the value displayed on the LCD goes down from two digits to one or from three to two it keeps the first number which isnīt cleared.
Going up works fine because it overwrites every digit, but going down keeps some old ones.
So I put in the "Clear Display" command into the loop but that makes the whole display flashing...otherwise the frequency counter works fine for me.
How can I clear the numbers of my value on the display without flashing the whole thing?
'
' DEFINITIONS
'
Cnt VAR Word ' Cnt is a word variable
'
' START OF MAIN PROGRAM
'
CMCON = 7 ' RA0-RA3 are digital I/O
TRISA = 0 ' PORT A is output
TRISB = 1 ' PORT B0 is input others output
PAUSE 500 ' Wait 0.5 second to initialize LCD
Cnt = 0 ' Clear Cnt to zero
LCDOUT $FE,1 ' Clear LCD
LCDOUT $FE,2
RPT:
cnt = 0
LCDOUT $FE,1 ' here is my problem!! makes everything flashing!'
LCDOUT $FE,2
Count PORTB.0,1000,CNT
LCDOUT "Freq.= ",$FE,$C0,DEC Cnt ' Display count
PAUSE 1000
Goto RPT
END