cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 with PT4115 Dimming

SEng.1
Associate II

I create a custom board to use PT4115 to control LED.

This PT4115 can be control with PWM or external DC on DIM pin.

0693W00000JNL6MQAX.jpg 

According to spec, the DIM range is 0.3-2.5V.

I tested the board by I short the DIM pin to GND and the LED turn off.

So it show the board should be working.

When i use STM32G030 pin as output and set it to Low,

the LED does not turn off but only slightly dim.

Am i missing something?

The spec say the DIM is pull up internally to 5V,

and i measure the DIM pin is right on 5V.

So, can i directly connect this to MCU pin?

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

This is definitely not a noob question, but a real problem.

If you have already switched the STM32G030 to open drain and switched off pulls as proposed by @Community member​ , obviously a current flows from DIM into the GPIO, which raises the voltage at the GPIO. Actually, this shouldn't be the case since DIM is connected to 5V via a 200kOhm (typ).

However, it is often misunderstood that the 5V tolerance is only given when VDD is active, i.e. between 2.0-3.6V for the STM32G030 (see also AN4899, section 5.2.2). At powering up of the system, it can happen that VDD is applied later than the voltage of PT4115, which violates this condition and possibly brings the STM32 into a latch-up.

Section 5.3.3 of AN4899 suggests a zener for this case, which is of course an additional device.

What also works: replacing the direct connection to the PT4115 using an additional transistor, e.g. a small npn with base series resistor or a logic level n-channel FET for clean open-collector or open-drain controlling.

Good luck!

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

6 REPLIES 6
SofLit
ST Employee

Hello @SEng.1​ ,

Use GPIO in open-drain configuration instead of push-pull.

SofLit

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hi,

i change as per you say.

0693W00000JNLp7QAH.jpgbut it still not working.

i measure the DIM pin when toggle the high and low.

high = 5V, low = 3.5V

Here is my pcb layout.

0693W00000JNLtiQAH.jpgSorry for all the noob question.

Peter BENSCH
ST Employee

This is definitely not a noob question, but a real problem.

If you have already switched the STM32G030 to open drain and switched off pulls as proposed by @Community member​ , obviously a current flows from DIM into the GPIO, which raises the voltage at the GPIO. Actually, this shouldn't be the case since DIM is connected to 5V via a 200kOhm (typ).

However, it is often misunderstood that the 5V tolerance is only given when VDD is active, i.e. between 2.0-3.6V for the STM32G030 (see also AN4899, section 5.2.2). At powering up of the system, it can happen that VDD is applied later than the voltage of PT4115, which violates this condition and possibly brings the STM32 into a latch-up.

Section 5.3.3 of AN4899 suggests a zener for this case, which is of course an additional device.

What also works: replacing the direct connection to the PT4115 using an additional transistor, e.g. a small npn with base series resistor or a logic level n-channel FET for clean open-collector or open-drain controlling.

Good luck!

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thanks peter for your detail explanation. Now I start to know where is the possible problem.

I had few more question to clear up:

1) Refer to the AN4899 Zener method, is that mean i will need another LDO/regulator to get 5V?

0693W00000JNTGtQAP.jpg2) Your explanation show that the PT4115 5V is earlier than STM32G030 VDD and causing the GPIO latch-up. Could i just using Zener to clamp the PT4115 DIM to 3.3V? like over voltage protection?

3) Will PWM work with the Zener method? or should i just used a Mosfet to control it instead. like you had suggested or like it show on AN4899 5.3.1.

0693W00000JNTGAQA5.jpgNPN or Nmos open drain circuit like this can work? Mosfet is preferred when using pwm(10kHz), am i right?

0693W00000JNTg8QAH.jpg 

Peter BENSCH
ST Employee

Clamping the PT4115 DIM to 3.3 V would have to be tried, but would definitely only be a stopgap solution. Technically better is the use of a transistor. A npn BJT needs beside the base resistor a few microwatts more energy than a n-channel MOSFET. With this low switching frequency of 10kHz it doesn't matter what you use. So it's purely a matter of taste whether you use an npn or a logic-level MOSFET.

But if you select an npn, then the base resistor is too small by the factor 1000: with VDD=3.3V you get a base current of about (3.3V-0.7V)/220ohms=11.82mA, which could switch a collector current of 100...500mA (SS8050 has a DC current gain of ~50).

But you only want to switch the internal pull-up, i.e. 200kohms at 5V, where only max 25µA can occur, so that 2...3µA base current is well sufficient, resulting in a base resistance of about 870...1300kohms. For simplicity you can choose any resistor between 100...820kohms.

Good luck!

If the problem is resolved, please mark this topic as answered by selecting Select as best. This will help other users find that answer faster.

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
SEng.1
Associate II

Thanks @Peter BENSCH​ for your advice.

Definitely will test out all the option when i got time.