Hi
I use 4 lines LCD, and sometimes the whole display is full of scrambled characters and it will not return to normal until I will reset the power for the controller.
I have only one thought of what can couse this but I'm not sure,
I use one INT pin that get a signal every one second, is it possible that maybe the INT is sometimes running in the middle of LCD routine and causes the problem?
do you have any other idea that can couse this?
Thanks
character LCD gets scrambled
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: character LCD gets scrambled
Hi hazic,
The way interrupt is set up or delays/components within interrupt is most likely cause.
Would you be able to post the flowchart in question assuming its not commercially sensitive?
Martin
The way interrupt is set up or delays/components within interrupt is most likely cause.
Would you be able to post the flowchart in question assuming its not commercially sensitive?
Martin
Martin
Re: character LCD gets scrambled
if that is the case (that interrupt is happenning in the middle of LCD routine) than how can I prevent it?
should I always disable INT before importent procedures and enable it again after the procedure is done?
the interupt only sets a flag
should I always disable INT before importent procedures and enable it again after the procedure is done?
the interupt only sets a flag
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: character LCD gets scrambled
Hello Hazic,
One thing you could do in your program is replace any calls to the LCD Clear component macro with a call to the LCD Start component macro. This will effectively do the same thing but also re-synchronise the display in case it has gone out of sync.
As Medelec said would you be able to attach your program to the forums, its always much easier to troubleshoot software when its in front of you.
If the interrupt is not calling any LCD functions then you should not have any problems. Could it be that something else is causing the I/O connected to the LCD to be controlled separately from the LCD functions.the interupt only sets a flag
One thing you could do in your program is replace any calls to the LCD Clear component macro with a call to the LCD Start component macro. This will effectively do the same thing but also re-synchronise the display in case it has gone out of sync.
As Medelec said would you be able to attach your program to the forums, its always much easier to troubleshoot software when its in front of you.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: character LCD gets scrambled
Thank you for your help
Ive changed the clear LCD to start LCD and for now it seems like its ok. if the problem will appear again I will post the code here.
I have another problem, I have LCD 2x8 connected to Atmega8
while its working it looks like the LCD is flickering and not working smooth.
I thought it was something in my code so I removed all the code and only left LCD start and LCD print number and the problem remains nut now it is less visible.
I will appreciate any help
Ive changed the clear LCD to start LCD and for now it seems like its ok. if the problem will appear again I will post the code here.
I have another problem, I have LCD 2x8 connected to Atmega8
while its working it looks like the LCD is flickering and not working smooth.
I thought it was something in my code so I removed all the code and only left LCD start and LCD print number and the problem remains nut now it is less visible.
I will appreciate any help
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: character LCD gets scrambled
Hello,
It is normally best to let the LCD work like this.
Clear
Write data
Delay
The delay is required to allow the data on the LCD to be readable and not flicker.
If you must have no delay or need to run through a loop pretty fast then how about only updating the LCD say every ten times around the loop? To do this simply increment a counter inside the loop, is the counter equal to 10? If yes then clear and update display and reset counter.
An alternative to this is to avoid the usage of the clear function and simply to overwrite the values using the cursor function.
It is normally best to let the LCD work like this.
Clear
Write data
Delay
The delay is required to allow the data on the LCD to be readable and not flicker.
If you must have no delay or need to run through a loop pretty fast then how about only updating the LCD say every ten times around the loop? To do this simply increment a counter inside the loop, is the counter equal to 10? If yes then clear and update display and reset counter.
An alternative to this is to avoid the usage of the clear function and simply to overwrite the values using the cursor function.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: character LCD gets scrambled
Do i have to change something for working with lcd 8*2?
If i select 16*2 or 20*2 in the componnent properties the lcd acts differently.
If i select 16*2 or 20*2 in the componnent properties the lcd acts differently.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: character LCD gets scrambled
Hello,
Yes the LCD component can work with the 8 x 2 display but the coordinates you pass to the cursor function may no longer be correct.
You may have to pass coordinates like this.
0, 1
as
20, 0
Though i'm not 100% sure about this. Have a play and see if you can find out how to address the cursor correctly. Everything else should work as expected.
Yes the LCD component can work with the 8 x 2 display but the coordinates you pass to the cursor function may no longer be correct.
You may have to pass coordinates like this.
0, 1
as
20, 0
Though i'm not 100% sure about this. Have a play and see if you can find out how to address the cursor correctly. Everything else should work as expected.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel