barn53 / CoinThing

a coin ticker display
MIT License
32 stars 8 forks source link

Backlight control via Anode vs BLK #20

Closed holyape closed 1 year ago

holyape commented 1 year ago

Hi! Thanks for the fast response and resolving on pervious issue!

I got a noname Chinese devboard, which controls ST7789 backlight by using Anode (connected via transistor to GPIO5) instead of BLK (BLK is connected to GND).

image

I have tried to just change TFT_BL PIN to D1 in Display.h file - backlight is still off.

Any suggestions on how to make it work?

barn53 commented 1 year ago

too little detail.

holyape commented 1 year ago

I'm sorry, could you tell which additional detail I should provide from my side?

barn53 commented 1 year ago

A schematic of the dev board, as it is important to know how exactly the backlight is driven.

holyape commented 1 year ago

Sure, sorry in advace for low resolution - this is the only source I have found:

Screenshot 2023-03-02 at 03 32 51 Screenshot 2023-03-02 at 03 34 28
barn53 commented 1 year ago

Ok, the back light is not driven through a transistor, but directly through pin GPIO5. In this case it should be enough to write in method Display::begin()

instead of :

analogWriteRange(std::numeric_limits::max()); pinMode(TFT_BL, OUTPUT); analogWrite(TFT_BL, std::numeric_limits::max());

this:

pinMode(PIN_D1, OUTPUT); digitalWrite(PIN_D1, HIGH);

But what you wrote on your first message, should have worked, too. So I don't have a clue what's wrong. Can you measure the voltage on GPIO5?

holyape commented 1 year ago

Unfortunately, doesn't work for me - I have tried to replace the piece of code you suggested and backlight is still off.

I'm not sure now if the schematic above is directly for my board - since there are no transistor as you noticed, but it is on board itself.

Yes, the voltage on GPIO5 is 3.13-3.14V

IMG_2003