akortekaas
Posts: 2
Joined: Mon Feb 17, 2020 7:11 pm

hd44780 16x2 lcd random characters added to front of line replacing text every few of hours.

Mon Feb 17, 2020 7:18 pm

I got a problem with my hd44780 lcd, when i boot up the pi everything works fine but after a while some random characters start showing up on the left and it pushes the proper text to the right.
Eventually when it happens enough times the proper text will just disappear to the right altogether.
this takes somewhere between 12 and 24 hours.
The characters are not always the same.

I've been googling for days but i just don't know enough of this stuff to be able to figure it out on my own.

Maybe someone can point me in the right direction ?

System details: Raspberry pi 4 with Hifiberry Dac+, Volumio 2 image, Pydpiper (https://github.com/dhrone/pydPiper) for lcd drivers and stuff.

Picture of the screen:
https://drive.google.com/open?id=1AYLiq ... 4mnTNVSgdU

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: hd44780 16x2 lcd random characters added to front of line replacing text every few of hours.

Mon Feb 17, 2020 9:12 pm

akortekaas wrote:
Mon Feb 17, 2020 7:18 pm
Maybe someone can point me in the right direction ?
Open an issue at https://github.com/dhrone/pydPiper/issues?

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: hd44780 16x2 lcd random characters added to front of line replacing text every few of hours.

Mon Feb 17, 2020 9:57 pm

The right direction is to run the LCD startup sequence or simply send a LCD clear command.

That stuff is in the LCD driver at: https://github.com/dhrone/pydPiper/blob ... hd44780.py

Code: Select all

		self.write4bits(0x33,False)
		self.write4bits(0x32,False)
		# Initialize display control, function, and mode registers.
		displaycontrol = self.LCD_DISPLAYON | self.LCD_CURSOROFF | self.LCD_BLINKOFF
		displayfunction = self.LCD_4BITMODE | self.LCD_1LINE | self.LCD_2LINE | self.LCD_5x8DOTS
		displaymode = self.LCD_ENTRYLEFT | self.LCD_ENTRYSHIFTDECREMENT
		# Write registers.
		self.delayMicroseconds(1000)
		self.write4bits(self.LCD_DISPLAYCONTROL | displaycontrol, False)
		self.delayMicroseconds(2000)
		self.write4bits(self.LCD_FUNCTIONSET | displayfunction, False)
		self.write4bits(self.LCD_ENTRYMODESET | displaymode, False)  # set the entry mode
		self.clear()

Code: Select all

		# Set cursor back to 0,0
		self.setCursor(0,0)
		self.curposition = (0,0)

		self.curimage = Image.new("1",(self.cols,self.rows))

		# And then clear the screen
		self.write4bits(self.LCD_CLEARDISPLAY) # command to clear display
		self.delayMicroseconds(2000) # 2000 microsecond sleep, clearing the display takes a long time
You just need the pydPiper application program to call the initialise() or clear() functions.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

akortekaas
Posts: 2
Joined: Mon Feb 17, 2020 7:11 pm

Re: hd44780 16x2 lcd random characters added to front of line replacing text every few of hours.

Tue Feb 18, 2020 12:00 pm

Discovered that when i do a shutdown command the screen looks normal again so i am guessing it is indeed a problem with clearing lcd as far as i know.

I dug around in the code a bit with my very limited knowledge and found that the software does indeed clear the screen every time it finiished scrolling i think.
I just have no idea whether that is 1 scroll loop or if it just keeps going on the one line of code if i never change the song which i don't because i listen to webradio.

The clear command is set to take 2000 microsec, i increased it to 3500.
And ill add a normal song to the queue to see if just switching to a different type of source will clear it up it the delay doesn't work.

Return to “Troubleshooting”