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 <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-10-12 10:38:30 -04:00
parent 2d6b44152a
commit 65a49d17dd
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ class HD44780:
curtime = self.printer.get_reactor().monotonic() curtime = self.printer.get_reactor().monotonic()
print_time = self.mcu.estimated_print_time(curtime) print_time = self.mcu.estimated_print_time(curtime)
# Program 4bit / 2-line mode and then issue 0x02 "Home" command # 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) # Reset (set positive direction ; enable display and hide cursor)
init.append([0x06, 0x0c]) init.append([0x06, 0x0c])
for i, cmds in enumerate(init): for i, cmds in enumerate(init):