From 8061822f0cba9caa9d957b85a8284ab3120aaf3e Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Tue, 26 Apr 2022 13:09:30 +0300 Subject: Fix large blacklevel step. Lower 25% of shades are now accessible. There is a large step in brightness from level zero to level one. After experimenting with various ST7789 options, I found that decreasing VDV to 0x10 (-0.4V) fixes this issue. The gamma change reduced the average error in brightness, but with the underlying issue fixed, the gamma change has been reverted. --- src/drivers/St7789.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/drivers/St7789.cpp') diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp index d520199e..3ed1beb4 100644 --- a/src/drivers/St7789.cpp +++ b/src/drivers/St7789.cpp @@ -23,7 +23,7 @@ void St7789::Init() { RowAddressSet(); DisplayInversionOn(); NormalModeOn(); - SetGamma(); + SetVdv(); DisplayOn(); } @@ -115,9 +115,11 @@ void St7789::WriteToRam() { WriteCommand(static_cast(Commands::WriteToRam)); } -void St7789::SetGamma() { - WriteCommand(static_cast(Commands::GammaSet)); - WriteData(0x04); +void St7789::SetVdv() { + // By default there is a large step from pixel brightness zero to one. + // After experimenting with VCOMS, VRH and VDV, this was found to produce good results. + WriteCommand(static_cast(Commands::VdvSet)); + WriteData(0x10); } void St7789::DisplayOff() { -- cgit v1.2.3