TLC5947 - How to properly use the OE pin

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Georg2014
 
Posts: 5
Joined: Sat Sep 06, 2014 6:57 am

TLC5947 - How to properly use the OE pin

Post by Georg2014 »

Hello,

I recently bought this product: https://www.adafruit.com/products/1429
As I need this for a project where I need more PWM Ports to control some LED´s

Now I encountered a problem. The LED Driver is always on. So the few second until arduino is powered and booted up, it can power up or flash random LED´s in the meantime. Which is bad.

So I found a solution to use a "Pull up" circuit, where the OE Pin is connected to the powersupply via a resistor.
A transistor (ctbc337) should "wait" for a HIGH signal from arduino on "D2" Pin. Which is defined in the Code.

After receiving the HIGH on Base it will open and Pull the OE Pin down to GND, which will enable the LED Driver and allow the arduino to take over.

Now I need help in building the schematics for this especially which resistors to use.

Thanks

User avatar
Franklin97355
 
Posts: 23911
Joined: Mon Apr 21, 2008 2:33 pm

Re: TLC5947 - How to properly use the OE pin

Post by Franklin97355 »

The /oe line is pulled to ground (activated) with a 10K resistor. You might remove it and then control the line in software or pull the line high through a resistor to make the board default to off.
Attachments
2014-09-06_08h43_13.png
2014-09-06_08h43_13.png (1.06 MiB) Viewed 649 times

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: TLC5947 - How to properly use the OE pin

Post by adafruit_support_mike »

You can build a pull-up circuit using a transistor, but it will be a little easier if you use a PNP instead of an NPN.

Any digital circuit can be broken down into a pull-up network and a pull-down network. In this case the TLC5947 breakout already has a pull-down resistor on the /OE pin, so you want to add the pull-up:
pull-up.jpg
pull-up.jpg (19.31 KiB) Viewed 640 times
The PNP transistor and 10k pull-down on the TLC5947 breakout form pull-up and pull-down networks connected to the chip's /OE pin.

If we ignore the connection to the Arduino for a moment, the two 10k resistors will pull the PNP's base LOW, causing it to open and create a low-resistance path to VCC. The TLC5947's /OE pin will see that as a HIGH signal and disable output.

An Arduino boots with its pins configured as high-resistance INPUTs, so the pin won't be strong enough to overpower the two 10k resistors until you configure it as an OUTPUT.

Once you do, setting the pin HIGH will force the PNP's base HIGH, shutting it off. That will allow the onboard 10k pull-down to pull the TLC5947's /OE pin LOW, enabling output. If you want to disable output at any time while the Arduino is running, you can send the pin LOW or turn it back into an INPUT again. Either one will turn the PNP on again.

User avatar
Georg2014
 
Posts: 5
Joined: Sat Sep 06, 2014 6:57 am

Re: TLC5947 - How to properly use the OE pin

Post by Georg2014 »

Thanks for the suggestions.

I have already completed this with the parts I had lying around.
oepin.PNG
oepin.PNG (3.85 KiB) Viewed 627 times
I hope the values are correct. I had to put 5kOhm to the Oe Pin instead of 10kOhm, for some reason. Because it was not enough to pull the OE pin up with 10kOhm.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: TLC5947 - How to properly use the OE pin

Post by adafruit_support_mike »

You were getting caught by the TLC5947's voltage thresholds.

The chip considers any value above 0.7*Vcc to be HIGH and any value below 0.3*Vcc to be LOW. For a 12v supply, those would be 8.4v HIGH and 3.6v LOW. Voltages between 3.6v and 8.4v are considered "undefined input" and could do anything.

Using a 10k pull-up resistor would put the pull-up voltage at 50%, or 6v. That's right in the middle of the undefined range.

Using a 5k pull-up puts the pull-up voltage at 8v, which is just below the 8.4v HIGH threshold. It's close enough that the chip probably accepts it as HIGH, but you still might see occasional glitches.

To reach the true 0.7*Vcc HIGH threshold you'd have to take the pull-up resistance down to 4.3k. You'd be better off using a 3.9k or 3.3k though, as those would put the pull-up voltage well within the HIGH range.

The downside of using a pull-up resistor is that you have to send current through it in order to keep the /OE pin LOW. For the values given here, the cost is about about 3-4mA.

User avatar
Georg2014
 
Posts: 5
Joined: Sat Sep 06, 2014 6:57 am

Re: TLC5947 - How to properly use the OE pin

Post by Georg2014 »

I see no other posibility.

As your solution allow only to control the OE pin when the arduino is booted up.

I need a "standalone" - "watchdog" where the OE Pin is "HIGH" until arduino is powered up and able to pull it "LOW"

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: TLC5947 - How to properly use the OE pin

Post by adafruit_support_mike »

The design above holds the PNP transistor open as soon as power is applied, pulling the /OE pin HIGH.

The Arduino has to send the center of the voltage divider HIGH to shut off the PNP, allowing the /OE pin to fall LOW.

If you want to use an NPN, you can do this:
follower.jpg
follower.jpg (12.39 KiB) Viewed 599 times
The voltage at the emitter of the NPN will be about 0.65v below Vcc until the Arduino pulls the resistor LOW. You can use a 10k pull-up on the NPN's base, reducing the current load to about 1.2mA.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”