Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 16:56 11 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : LCD Screen Corruption

     Page 1 of 2    
Author Message
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 02:30am 19 Jun 2018
Copy link to clipboard 
Print this post

Hi All,

Every so often I'm getting a corrupted LCD display on my heat controller.
The code in the MM is still running fine if I check at the console & a reboot or Ctrl-C & run again fixes it, but it's obviously annoying...

Any suggestions at a hardware or software level for a quick solution.

Cables coming from the board got to a string of DS18B20's on the left plug & the other two (3) got to 2x 4 gang relay boards up in the roof.

Any suggestions?

Thanks

Phil.

Edit,

The thought in software as a temporary fix would be to reset the LCD periodically;
Not sure how to do that....












Edited by Phil23 2018-06-20
 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 02:45am 19 Jun 2018
Copy link to clipboard 
Print this post

I see you have a couple of electro caps on the board. Being Veroboard the actual signal/voltage at the component pin may fluctuate from what you would expect.

If you have an oscilloscope you can check the noise on the 5v directly at the LCD while it is running. Possible some ripple or HF noise effecting it. It would pay while you are doing that to also check the control and data signals at the LCD to make sure they are also nice and clean.

You should try and monitor the signals during worst case conditions, when relays are switched and when the wireless unit is transmitting/receiving.
Edited by Azure 2018-06-20
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1427
Posted: 03:44am 19 Jun 2018
Copy link to clipboard 
Print this post

Try an LCD INIT command frequently. Perhaps every time you clear the display.


Micromites and Maximites! - Beginning Maximite
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 05:56am 19 Jun 2018
Copy link to clipboard 
Print this post

  CircuitGizmos said   Try an LCD INIT command frequently. Perhaps every time you clear the display.


That thought did come to mind, but when I tried it, it returns

[Code] LCD INIT 23, 24, 25, 26, 15, 16
Error: Already open
>[/code]

I suppose I could do a temp cludge like this periodically.

[Code] LCD Close
LCD INIT 23, 24, 25, 26, 15, 16
[/code]

But also wonder if I can send a reset command with one of these statement.




  Azure said   I see you have a couple of electro caps on the board. Being Veroboard the actual signal/voltage at the component pin may fluctuate from what you would expect.[/quote]

Yeah, I'm sure it's at the board, I have a few LCD's.
I also suspect it happens sometimes without relay activity.

Didn't know whether or not I should have used a few 0.1uF's on data lines etc.
That sort of stuff is not in my expertise..

Phil.

Edited by Phil23 2018-06-20
 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 06:19am 19 Jun 2018
Copy link to clipboard 
Print this post

Are you able to check things with a scope or is that not possible? A multimeter will not really show what you need to see.

My suspicions would be firstly around power quality at LCD from noise or excessive ripple or dips during certain operations on power lines at LCD. If you can't check it and just want to try things a 100uF/220uF electro and a 0.1uf ceramic wired close to the LCD power pins may help clean up and stabilise the power at the LCD.

The WiFi board is probably the biggest power consumer during transmission after the relay board.

The Control and Data lines really need a scope on them to see if they are clean. On your board it looks like they are wired in fairly directly so they should be ok.
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1106
Posted: 06:33am 19 Jun 2018
Copy link to clipboard 
Print this post

You'll probably need to keep the data lines to the display as short as possible.

I did a PICAXE project a while ago with a 16x2 display connected by a ribbon cable. Played up a lot. Tried all sorts of shielding arrangements including a wrap around ferrite type shield covering most of the cable. Reduced the problem quite a bit. Unfortunately, it did not occur to me at the time to arrange for an LCD reset rather than restarting the whole lot.

I've also got an LCD on a Maximite & one on a uMite which occasionally go funny. Both of these have a switch to signal the software do an LCD CLEAR & then an LCD INIT as suggested in previous posts. I did at one stage have periodic CLOSE & INIT coded into the software.

Good luck
ChopperP
 
ajkw
Senior Member

Joined: 29/06/2011
Location: Australia
Posts: 290
Posted: 09:52am 19 Jun 2018
Copy link to clipboard 
Print this post

How often do you write to the LCD? Do you write only when something has changed or every time in a loop? I have found you can bother them if you write continuously.

I have also had a 12V boat bilge pump that was other side of a opto-coupled relay make enough noise back through the power system to cause simular garbage on the LCD, a electro-cap on the wires to the pump helped. Project link - https://www.thebackshed.com/forum/forum_posts.asp?TID=7557&KW=ajkw
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 10:21am 19 Jun 2018
Copy link to clipboard 
Print this post

  Azure said   Are you able to check things with a scope or is that not possible? A multimeter will not really show what you need to see.


Have a DSO138 LCD thingy; only audio range, but still useful.
That & a 20Meg Hantek USB; just need to load S/W on this laptop & reach 2 foot sideways.

Phil.
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 10:37am 19 Jun 2018
Copy link to clipboard 
Print this post

  ajkw said   How often do you write to the LCD?


I have a Timer variable that updates the display every 1 second.

[code]TimerLCD=Timer
..
..
..
IF Timer>TimerLCD+1000 Then Go & update the LCD & reset TimerLDD to Timer again...
..
..
[/code]
 
ajkw
Senior Member

Joined: 29/06/2011
Location: Australia
Posts: 290
Posted: 12:03pm 19 Jun 2018
Copy link to clipboard 
Print this post

Once a second should be fine. As I said noise was a problem on the power supply from the pump in my project.

Somewhere I should have a couple of spare boards from my project that I had made, I designed it as a 'backpack' for a 16x2 and will also cope with a 20x4 LCD. It does use the 'default' LCD pin out while you appear to use other pins, anyway, if you are interested I'll post a pic.

Anthony.
 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 12:20pm 19 Jun 2018
Copy link to clipboard 
Print this post

  Quote  Have a DSO138 LCD thingy; only audio range, but still useful.
That & a 20Meg Hantek USB; just need to load S/W on this laptop & reach 2 foot sideways.

Phil.


Have a try using the DSO138, it is only 5V and hopefully it will show you if the LCD Vcc and Gnd lines are clean or have ripple/noise on them. It should also show you if the data and control lines are clean since they are fairly low speed signals.

I still suspect something like when it is transmitting it's causing noise or a dip in either or both the LCD power and data/control signals.

 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2971
Posted: 12:23pm 19 Jun 2018
Copy link to clipboard 
Print this post

Hi Anthony,

Try fitting 10k pull-ups on the data and control lines..

Also try updates every 5sec. As a test to see if it is amount of updates..

Mik

Edited by bigmik 2018-06-20
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2971
Posted: 12:28pm 19 Jun 2018
Copy link to clipboard 
Print this post

Hi Anthony,

You could also be getting interference from your wireless radio transmitter card.. try removing it and see if that is the cause,

Mik

EDIT ***

Is the display a 5v unit or 3v3 unit? What voltage is it running off?

If a 5v unit running off 3v3 that might be your issue.

MikEdited by bigmik 2018-06-20
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
ajkw
Senior Member

Joined: 29/06/2011
Location: Australia
Posts: 290
Posted: 12:54pm 19 Jun 2018
Copy link to clipboard 
Print this post

Hey Mick, Phil is OP.

Anthony.
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 08:37pm 19 Jun 2018
Copy link to clipboard 
Print this post

  bigmik said   Hi Anthony,


Lol Mik,

You are as bad with names as I am....

Phil.

PS, Can you supply a small BOM of part for a few of your boards I haven't finished yet?

Just a few SMD bits.
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2971
Posted: 08:38pm 19 Jun 2018
Copy link to clipboard 
Print this post

  ajkw said   Hey Mick, Phil is OP.

Anthony.


Sorry Anthony,

I must be getting old...

3 months and 1 day from now I will be retiring (or at worst a few weeks more). Looking forward to playing more with my mites again.

Mik
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 09:19pm 19 Jun 2018
Copy link to clipboard 
Print this post

Agree with all that a hardware issue exists, and will try all the suggestions above.

In the short term though, just the software reset will remove the annoyance.

This project is far from finished from a code point of view & at this point in winter, after it boots, I manually change a few options to pump warm air to my office.

If the display corrupts, it still runs & I still have a perfectly operational VT display & interface available on any PC via Wifi.

It's just annoying looking at the corrupted screen as I walk past.

If I hit the reset & get the display back, I loose any manual overrides I made on the dampers & fans, so would need to go to a PC & set them again....

Current uptime is 15 hours & there was no corruption last time I looked, but see 2 recalcitrant characters just now.

So till I get to the board, probably the best (bad) idea is an interrupt sub that tidies it up ever 2 or 3 minutes, regardless of whether its corrupted or not.

It's just a matter which is the best bit of code to do it?
LCD CMD or LCD DATA & what to send.


Phil.
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1427
Posted: 09:30pm 19 Jun 2018
Copy link to clipboard 
Print this post

Info here:

http://web.alfredstate.edu/faculty/weimandn/lcd/lcd_initialization/lcd_initialization_index.html

Here:

http://www.microcontrollerboard.com/lcd.html

From rusty memory, I sent 30h several times to the display, followed by 01h. Your 4 line will be slightly different.


Micromites and Maximites! - Beginning Maximite
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1667
Posted: 10:26pm 19 Jun 2018
Copy link to clipboard 
Print this post

Just tried breaking to a prompt when I had just two characters of corruption,

sent in LCD CMD &h30 & it cleared the 2nd & 4th line & put more gobbly gook in lines 1 & 3.

Tried LCD 1,1,"hello" after that with no response.

Should have tried "hello" in a few places first, to see if it was still operational, as I'm assuming it's not, cause if it was each re-write should get rid of the corruption.

Need to find a list of the valid commands...

 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1427
Posted: 10:33pm 19 Jun 2018
Copy link to clipboard 
Print this post

I'm really sorry if I gave you the impression that there is one byte to send to reset the display. Display init is a sequence of bytes, like the two linked pages show.

Micromites and Maximites! - Beginning Maximite
 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025