EEVblog Electronics Community Forum
Electronics => Beginners => Topic started by: Tantalum on August 04, 2019, 09:09:01 am
-
Hello
I wanted to dim the led drove by a PT4115 controller. The chip has a DIM input for that purpose.
https://people.xiph.org/~xiphmont/thinkpad/PT4115E.pdf
According to the datasheet it could be done by using a PWM signal or a DC voltage (0-2.5V).
dedicated DIM input accepts either a DC voltage or a
wide range of pulsed dimming. Applying a voltage of
0.3V or lower to the DIM pin turns the output off
The pin is internally pulled-up:
The DIM pin is pulled up to the internal regulator (5V)
by a 200KΩ resistor. It can be floated at normal
working.
(https://reho.st/self/ef350408795da11c086fcff2c5209298a5c479a0.png)
(https://reho.st/self/80f320b2f3e9da6a660ca64b195148c70dec69bf.png)(https://reho.st/self/c3addbcb915cf63d9141342d578f17118f7ab478.png)
(https://reho.st/self/3441c58a47b105526d7624d404e0ede1ff102f05.png)
(https://reho.st/self/01522e0c44c8b2a53fb9ccef54f4643999bd9515.png)
(https://reho.st/self/b38de08859670000e5bd3700ebcc46f7b0059dac.png)
Using a PWM (OC) is ok.
Question:
How can a DC voltage/signal regulate the brightness of the led, when the DIM pin is internally pulled-up to 5V???
-
It is pulled up through a 200kohm resistor. That means it is only lightly pulled up. You can overcome that and pull it down in a variety of ways.
If you try connecting various resistors between dim and gnd, you'll see. Resistors between 0 ohm and 200 kohm should work.
-
Driving it directly with a microcontroller PWM pin works fine too. 200k is not going to require much current at all, it's just pulled up so you can leave it floating if you don't need dimming.
-
Yes ok I know, but want to UNDERSTAND how it works in DC mode although it has an internal pull-up restistor to 5V.
-
Yes ok I know, but want to UNDERSTAND how it works in DC mode although it has an internal pull-up restistor to 5V.
If you put 2.5V on that pin your circuit will sink a tiny bit of current to hold the pin down at 2.5V. The other 2.5V will drop across the pull up resistor.
-
Use Ohms law to calculate it out, 200k is enough resistance that the voltage involved will result in practically zero current being drawn. The pullup resistor is like a thin rubber band, it will stay in place on its own but can easily be stretched with the slightest pull.
-
When an MCU pin is an output, it is pulled to +V when high, and to GND when low, using a transistor-based circuit.
When an MCU output pin is connected to an input with a pullup resistor, the input will be pulled to GND if the output pin can sink enough current to overcome the pullup.
When the MCU output pin is high, the current flows from +V at the MCU output pin, to the other input, and from there to ground. No current flows through the pullup resistor.
When the MCU output pin is low, the current flows from +V through the pullup resistor, and to the MCU output pin and ground.
You can also model the situation roughly with a resistor divider, by assuming that there is a resistor in series with the MCU output pin. Then, that resistor and the pullup resistor form a voltage divider. Let's say the pullup resistor is R1, and the MCU output pin has resistance R2.
When the MCU output pin is high, the two resistors are in parallel to +V, and the input is at +V.
When the MCU output pin is low, the two resistors form a resistor divider, and the voltage at the input is V×R2/(R2+R1).
For example, if R1 is 10 kOhm, and R2 is 500 Ohm, then the voltage in the input is V×500/10500 ≃ V × 0.047.
This means that the pullup resistor must be weak (high resistance), so that the MCU output pin can overcome it (low resistance), or the voltage in the input will remain too high to ever become low.