podman99
Posts: 9
Joined: Mon Jan 13, 2014 9:14 am

LCD Garbled ness :(

Thu Jan 30, 2014 10:13 am

Hi All,

On occasion when starting my Pi with my LCD connected via breadboard the LCD (which is not really an LCD its an OLED, but connects the same way) displays garbled rubbish on the display.

By garbled I mean random pixels to Full character spaces being filled to some legible characters. Not a blank screen which is what I would expect until LCDProc starts.

Once I have disconnected power to the display through P1-2 and reconnected 9 times out of 10 I can get the screen to display.

/etc/init.d/LCDd stop
Disconnect Power to P1-2
Reconnect Power to P1-2
/etc/init.d/LCDd start

Its worth noting that to improve my success rate from 2 times out of 5 times I added a 22pF ceramic capacitor between 5v0 and GND (P1-2 and P1-6) I understand that polarity does not matter for this type of cap.

This cap may be of completely insufficient power to manage such a task of stabling power on boot up of the Pi, however its what I had, and as I say made a significant improvement to my success rate.

Does anyone else have any advice or success in stabilizing such an issue?
Keith Jasper
1stDNS Limited
Software Developement
http://www.1stdomains.co.uk
http://www.domains2register.co.uk
http://www.keithjasper.co.uk

podman99
Posts: 9
Joined: Mon Jan 13, 2014 9:14 am

Re: LCD Garbled ness :(

Thu Jan 30, 2014 10:55 am

Very Similar to http://www.raspberrypi.org/phpBB3/viewt ... 63&t=68055 however different coding, and I have wired up more pins.
Keith Jasper
1stDNS Limited
Software Developement
http://www.1stdomains.co.uk
http://www.domains2register.co.uk
http://www.keithjasper.co.uk

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12211
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: LCD Garbled ness :(

Thu Jan 30, 2014 11:45 am

Did you look at the minimal voltage the display logic sees as a high?
Often this is 3.5V, and because the signal goes no higher than 3.3V there is trouble to be expected.
One way to solve the problem is by slightly lowering the displays voltage using a simple diode like a 1N4148 in series with the supply.

podman99
Posts: 9
Joined: Mon Jan 13, 2014 9:14 am

Re: LCD Garbled ness :(

Thu Jan 30, 2014 12:03 pm

Thanks mahjongg,

So by slightly simple diode like a 1N4148 in the 5v0 power line should reduce the displays voltage usage, and therefore expect lower power on the 3v3 high commands?

Would a small resistor not do the same thing?

Thanks
Keith Jasper
1stDNS Limited
Software Developement
http://www.1stdomains.co.uk
http://www.domains2register.co.uk
http://www.keithjasper.co.uk

User avatar
mahjongg
Forum Moderator
Forum Moderator
Posts: 12211
Joined: Sun Mar 11, 2012 12:19 am
Location: South Holland, The Netherlands

Re: LCD Garbled ness :(

Fri Jan 31, 2014 6:24 pm

Yes, but the voltage drop would depend on the current consumption, thus be unpredictable.

The diode will always drop about 0.6V, and thus bring the VCC for the LCD down to about 4.4V.
And as ViH is probably 70% of VCC it will drop to 0.7 x 4.4= 3.08V.
Well within acceptable limits.

foobar77
Posts: 11
Joined: Thu May 10, 2012 2:49 pm

Re: LCD Garbled ness :(

Tue Feb 11, 2014 4:56 pm

To be honest, im on the brink of binning the whole lot.

I went back to a proper LCD and things are fine, right until I add my python program to an init script. Then I get sod all from the display despite the fact that I can see my python application running.

Frustrating.... Yes, Time consuming.. Yes Blowing out my project deadline Yes


Im going back to a duino, these LCDs work just fine there.

foobar77
Posts: 11
Joined: Thu May 10, 2012 2:49 pm

Re: LCD Garbled ness :(

Tue Feb 11, 2014 8:43 pm

foobar77 wrote:To be honest, im on the brink of binning the whole lot.

I went back to a proper LCD and things are fine, right until I add my python program to an init script. Then I get sod all from the display despite the fact that I can see my python application running.

Frustrating.... Yes, Time consuming.. Yes Blowing out my project deadline Yes


Im going back to a duino, these LCDs work just fine there.
Well, after a coffee break calm down I now feel like a bit of a muppet, after I changed my init function to tell the LCD to start in 8bit mode first, then drop to 4bit everything works like a dream, this also fixed the OLED which is now working perfectly.

podman99
Posts: 9
Joined: Mon Jan 13, 2014 9:14 am

Re: LCD Garbled ness :(

Tue Feb 11, 2014 8:56 pm

Any chance you can share your init script please?

So your saying with wiring on OLED as 4bit.

Init script set to 8bit then modify down to 4bit and it works ?

I imagine it's something in the HD44780 chip which doesn't reset usually but does on an 8bit/4bit switch... As long as I understand your solution correctly?
Keith Jasper
1stDNS Limited
Software Developement
http://www.1stdomains.co.uk
http://www.domains2register.co.uk
http://www.keithjasper.co.uk

foobar77
Posts: 11
Joined: Thu May 10, 2012 2:49 pm

Re: LCD Garbled ness :(

Tue Feb 11, 2014 9:29 pm

podman99 wrote:Any chance you can share your init script please?

So your saying with wiring on OLED as 4bit.

Init script set to 8bit then modify down to 4bit and it works ?

I imagine it's something in the HD44780 chip which doesn't reset usually but does on an 8bit/4bit switch... As long as I understand your solution correctly?
If you issue the following initialization sequence (I added a 37 microsecond pause between each to be safe)

Code: Select all

0x08
0x33
0x32
0x28
0x0C
0x06
Clear your display and you should be good to go.

I think I may have caused confusion with init scripts and init functions :) This afternoon I had my python code starting from an init script, it was really random as to whether or not I would get anything on the display, when I logged in and ran manually it worked fine. Im guessing the display was randomly starting in 4bit mode, seemingly if you fire enough 4bit commands at the display it will sort itself out but the above code has sorted my problems. I have been through several boot ups now (from both a reboot command and a complete power cycle) with my code starting from an init script ,both LCD and OLED start displaying what they should when booted without any manual intervention. YMMV, let me know if that sorts you out :)

podman99
Posts: 9
Joined: Mon Jan 13, 2014 9:14 am

Re: LCD Garbled ness :(

Tue Feb 11, 2014 10:42 pm

I shall have a test of this tomorrow and let you know. :) thanks
Keith Jasper
1stDNS Limited
Software Developement
http://www.1stdomains.co.uk
http://www.domains2register.co.uk
http://www.keithjasper.co.uk

foobar77
Posts: 11
Joined: Thu May 10, 2012 2:49 pm

Re: LCD Garbled ness :(

Tue Feb 11, 2014 11:41 pm

podman99 wrote:I shall have a test of this tomorrow and let you know. :) thanks
np. it's still looking good here and I've bounced the pi loads, sent heaps of data to the screen and it is ticking away nicely. I shall leave it running overnight and see what it's looking like in the morning.

foobar77
Posts: 11
Joined: Thu May 10, 2012 2:49 pm

Re: LCD Garbled ness :(

Wed Feb 12, 2014 9:14 am

Been running all night and no garbled mess from the oled any more, it's all good :)

Return to “General discussion”