Hello all
I am trying to have one word blinking on one line of a 2x16 LCD using GCB. The rest of the sreen should not change and I want to avoid an infinite loop to do that.
The structure of the program would be something like:
dim msg as string
msg="world"
cls
locate 0,0
print "First line to remain unchanged"
locate 1,0
print "Hello "
locate 1,8
print msg
I would like to have msg blinking :-)
Thanks to all the GCB LCD specialists for their suggestions !
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Use a Timer1 interrupt. Choose a prescale value and preloaded Timer1 register value to the desired time on/off. Then toggle the word value in the Call function using a counter value and a "If..Else..Endif". That should use the least amount of overhead.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
More information needed then, device?, how critical is the a-d timing?, a whole host of questions.
Otherwise, the counter could be used inside the a-d interrupt, if it is a time dependent trigger? Shorten/lengthen the timeout to make it work? Or just use a counter/interrupt off of TMR0 overflows, and just poll/reset the counter in main.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are right I think I have to rethink about the way my program is designed. I was hopping that some kind of control code sequence was available to activate blinking of a character on the HD44780 as it is the case for the cursor through the LCDCmd command. But apparently HD44780 does no support that.
Thanks for your input !
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello all
I am trying to have one word blinking on one line of a 2x16 LCD using GCB. The rest of the sreen should not change and I want to avoid an infinite loop to do that.
The structure of the program would be something like:
dim msg as string
msg="world"
cls
locate 0,0
print "First line to remain unchanged"
locate 1,0
print "Hello "
locate 1,8
print msg
I would like to have msg blinking :-)
Thanks to all the GCB LCD specialists for their suggestions !
Hello,
you can write :
cls
print "line 1 unchanged" 'only 16 caracters
locate 1,0
print "Hello "
do
locate 1,8
print "world"
wait 1 s
locate 1,8
LCDspace 6
wait 1 s
loop
Thanks
Yes I was aware of that kind of approach but I am trying to avoid the do ... loop structure
Any other suggestion ?
Use a Timer1 interrupt. Choose a prescale value and preloaded Timer1 register value to the desired time on/off. Then toggle the word value in the Call function using a counter value and a "If..Else..Endif". That should use the least amount of overhead.
That cannot work in my project the timer1 interrupt being already used to synchronize an adread sampling :-( hence my attempt to find another route
More information needed then, device?, how critical is the a-d timing?, a whole host of questions.
Otherwise, the counter could be used inside the a-d interrupt, if it is a time dependent trigger? Shorten/lengthen the timeout to make it work? Or just use a counter/interrupt off of TMR0 overflows, and just poll/reset the counter in main.
You are right I think I have to rethink about the way my program is designed. I was hopping that some kind of control code sequence was available to activate blinking of a character on the HD44780 as it is the case for the cursor through the LCDCmd command. But apparently HD44780 does no support that.
Thanks for your input !