Dear Alberet,
here is the source text:
'$PROG &HFF,&HF7,&HDF,&HFF' generated. Take care that the chip supports all fuse bytes.
$lib "mcs.lbx"
$regfile = "m168def.dat" ' specify the used micro
$crystal = 6000000 ' used crystal frequency
$baud = 19200 ' use baud rate
$hwstack = 90 ' default use 32 for the hardware stack
$swstack = 60 ' default use 10 for the SW stack
$framesize = 40
Config Lcd = 16*2
Config LCDBUS = 4
Config Lcdpin = Pin , Db4 = Portd.6 , Db5 = Portd.4 , Db6 = Portd.7 , Db7 = Portb.0 , E = Portd.3 , Rs = Portd.2
initlcd
Dim i as integer
dim Line_1 as string*16
dim Line_2 as string*16
dim dummystring as string*3
i=0
line_1 = "thisisline#"
cls
lcd line_1
line_2 ="QWERTZYXASDY"
wait 1
lowerline
lcd line_2
waitms 1000
Cursor Off Noblink
do
dummystring =str(i)
dummystring = " " + dummystring
locate 1, 12 'position to line 1 Pos 12
waitms 50 'give time for executing command
lcd dummystring 'write short string to line 1
'waitms 1000 '<-- no information visible
locate 2,12 'position to line 2 Pos 12
waitms 50 'give time for executing command
lcd dummystring ' write short string to defined position
locate 1, 12 '<---- if removed then no information visible on LCD
waitms 1000 '<------ this works if locate command is prior
i=i+1
'wait 1
if i=100 then i=0
loop
The wait commands following the lcd commands ( e.g. lines 30. 35, 51) cause the display to show nothing.
If e.g. the command locate occurs after a lcd command but before a wait command ( see lines 49 .. 53) everything runs well.
best regards
Christian
↧