diff --git a/config/example-extras.cfg b/config/example-extras.cfg index 81231f75..1398f992 100644 --- a/config/example-extras.cfg +++ b/config/example-extras.cfg @@ -539,6 +539,10 @@ #sid_pin: # The pins connected to an st7920 type lcd. These parameters must be # provided when using an st7920 display. +#chip_delay: +# This parameter specifies the internal command delay (in seconds) +# on st7920 displays. It may be necessary to increase this if the +# display shows garbled data. The default is 0.000020. # Custom thermistors (one may define any number of sections with a diff --git a/klippy/extras/display.py b/klippy/extras/display.py index 0f15fd78..e68c3db7 100644 --- a/klippy/extras/display.py +++ b/klippy/extras/display.py @@ -182,6 +182,7 @@ class ST7920: self.mcu = mcu self.oid = self.mcu.create_oid() self.mcu.add_config_object(self) + self.chip_delay = config.getfloat('chip_delay', ST7920_DELAY, minval=0.) self.send_data_cmd = self.send_cmds_cmd = None self.is_extended = False # framebuffers @@ -196,7 +197,7 @@ class ST7920: "config_st7920 oid=%u cs_pin=%s sclk_pin=%s sid_pin=%s" " delay_ticks=%d" % ( self.oid, self.pins[0], self.pins[1], self.pins[2], - self.mcu.seconds_to_clock(ST7920_DELAY))) + self.mcu.seconds_to_clock(self.chip_delay))) cmd_queue = self.mcu.alloc_command_queue() self.send_cmds_cmd = self.mcu.lookup_command( "st7920_send_cmds oid=%c cmds=%*s", cq=cmd_queue)