RobTillaart / PCA9635

Arduino library for PCA9635 I2C 8 bit PWM LED driver - 16 channel.
MIT License
15 stars 5 forks source link

ESP32 + PCA9635 Flash at boot #20

Closed jonascant closed 1 year ago

jonascant commented 1 year ago

Hi, is it possible to avoid the brief flash at Boot? Perhaps utilizing the OE Pin? Thanks!

RobTillaart commented 1 year ago

Can you explain a bit more?

jonascant commented 1 year ago

Sorry, Whenever i connect power to the SOC, all channels on the PCA9635 seem to be at the maximum output value, causing a flash on the connected LEDs. When my arduino sketch has loaded, everything is like it should be. Just this brief flash at boot time causes me trouble.

I experienced this with the ESP32 (lolin d32 pro) and ESP8266 (wemos d1 mini).

RobTillaart commented 1 year ago

I have to look into this, might take a few days. has been quite some time that I worked actually with the library.

jonascant commented 1 year ago

Thank you. This is one of the circuits i am using: 2023-01-23-172434_649x567_scrot

jonascant commented 1 year ago

R2 and R3 are not connected. This is to be able to use two transistors without the PCA chip if needed.

RobTillaart commented 1 year ago

From datasheet

image

So it will cost an IO pin + pull up resistor 1 - 10 K or so to be sure OE is HIGH at startup.

RobTillaart commented 1 year ago

I'm thinking of this interface

  1. there should be a function to define the OE pin setOutputEnablePin(uint8_t pin)
  2. there should be a function to set OE pin HIGH setOutputEnable(uint8_t value) LOW HIGH
  3. there should be a function to set OE pin LOW. setOutputEnable(uint8_t value) LOW HIGH

The latter could also be 2 functions, but as it is expected not being used often, a single one saves some RAM.

Does this meet your needs?

I will prepare a develop branch for it as I think it is a nice feature.

RobTillaart commented 1 year ago

Created a develop branch https://github.com/RobTillaart/PCA9635/tree/develop

Three functions

Give it a try

RobTillaart commented 1 year ago

@jonascant Did you have time to try the develop branch?

jonascant commented 1 year ago

Thank you! I didn't get around to it yet, but I will until tomorrow night!

RobTillaart commented 1 year ago

@jonascant Any progress?

RobTillaart commented 1 year ago

@jonascant Any progress?

jonascant commented 1 year ago

Truly sorry, my life got a little crazy. I will test it. Thanks so much! Jonas

Am 20. Februar 2023 17:32:34 MEZ schrieb Rob Tillaart @.***>:

@jonascant Any progress?

-- Reply to this email directly or view it on GitHub: https://github.com/RobTillaart/PCA9635/issues/20#issuecomment-1437286847 You are receiving this because you were mentioned.

Message ID: @.***>

RobTillaart commented 1 year ago

Don't feel pushed, it was silent for quite some time so I was wondering.

RobTillaart commented 1 year ago

@jonascant Any progress?

RobTillaart commented 1 year ago

@jonascant I decided to merge the PR

If you have test results later I am happy to hear your experiences.

jonascant commented 1 year ago

Thank you, I will let you know! Thanks again!

Am 7. März 2023 16:16:19 MEZ schrieb Rob Tillaart @.***>:

@jonascant I decided to merge the PR

  • code is pretty straightforward
  • I did not find problems
  • the issue is open for more than a month

If you have test results later I am happy to hear your experiences.

-- Reply to this email directly or view it on GitHub: https://github.com/RobTillaart/PCA9635/issues/20#issuecomment-1458348378 You are receiving this because you were mentioned.

Message ID: @.***>