From 65a49d17ddf8c89680087e783f493f3f92fa26b5 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 12 Oct 2020 10:38:30 -0400 Subject: [PATCH] hd44780: Make the 4-bit init sequence more robust The previous init sequence relied on the display ignoring commands if they are sent faster than 40us. Some displays may not have this limit. Rework the init to make it more robust to command transmission times. The new init should still transition the display into 4-bit mode even if the display processes commands faster than 40us. Signed-off-by: Kevin O'Connor --- klippy/extras/display/hd44780.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/klippy/extras/display/hd44780.py b/klippy/extras/display/hd44780.py index 3b56eb6e..5601b567 100644 --- a/klippy/extras/display/hd44780.py +++ b/klippy/extras/display/hd44780.py @@ -89,7 +89,7 @@ class HD44780: curtime = self.printer.get_reactor().monotonic() print_time = self.mcu.estimated_print_time(curtime) # Program 4bit / 2-line mode and then issue 0x02 "Home" command - init = [[0x33], [0x33], [0x33, 0x22, 0x28, 0x02]] + init = [[0x33], [0x33], [0x32], [0x28, 0x28, 0x02]] # Reset (set positive direction ; enable display and hide cursor) init.append([0x06, 0x0c]) for i, cmds in enumerate(init):