This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LP3944: Cannot make the LEDs dim using DIM0 or DIM1 settings

Part Number: LP3944
Other Parts Discussed in Thread: LP5569

am trying to follow this example

Programming Example:
Dim LEDs 0 to 7 at 1 Hz at 25% duty cycle
1. Set PSC0 to achieve DIM0 of 1s
2. Set PWM0 duty cycle to 25%
3. Set PSC1 to achieve DIM1 of 0.2s
4. Set LEDs 0 to 7 to point to DIM0
In the spec sheet.
Below this programming example is a table with the values of the registers. Running my code I get
Duty cycle 0x3f PWM0
Period 0x9f PSC0
Period 0x1f PSC1
Duty cycle 0x3f PWM1
which agrees with the expected values given in the table.
I do not set all the LEDs but only LED1. However, all this LED does is blink. There is no dimming. Also, it is not clear what the role of DIM1 is even though I set it.
Is the example wrong? Is there missing information given that DIM1 is set in the example but it is not used.
Otherwise I can set two independent blink rates for each of the LEDs. That works. But I cannot get any LED to DIM. Please help and complete what is missing in the example.
I can make the LEDs dim by continuously changing the duty cycle in a for-loop every couple hundredths of a second. But that defeats the reason for having the LP3944 as it obviously puts a big load on the I2C bus and the processor.
Please point me to more examples
Here is my python code (on Raspberry PI) to set DIM0 and DIM1 via the prescaler and pwm registers:
def lp3944_dim_set_period(self, dim0_or_dim1: boolean, period: int) ->int:
        
        psc_reg = LP3944_REG_PSC0 if dim0_or_dim1 else LP3944_REG_PSC1

        # Convert period to Prescaler value */
        if (period > LP3944_PERIOD_MAX):
            return -1

        psc_value = (period * 255) // LP3944_PERIOD_MAX
        psc_dim = "PSC0" if dim0_or_dim1 else "PSC1"
        print("Period " + str(hex(psc_value)) + " " + psc_dim)

        err = self.lp3944_reg_write(psc_reg, psc_value)

        return err;
    
    def lp3944_dim_set_dutycycle(self, dim0_or_dim1: boolean, duty_cycle: int) ->int:
        
        pwm_reg = LP3944_REG_PWM0 if dim0_or_dim1 else LP3944_REG_PWM1

        # Convert duty cycle to PWM value */
        if (duty_cycle > LP3944_DUTY_CYCLE_MAX):
            return -1

        pwm_value = (duty_cycle * 255) // LP3944_DUTY_CYCLE_MAX
        pwm_dim = "PWM0" if dim0_or_dim1 else "PWM1"
        print("Duty cycle " + str(hex(pwm_value)) + " " + pwm_dim)

        return self.lp3944_reg_write(pwm_reg, pwm_value)
Its the pre-scaler register that is not behaving as I expect. I can do a simple loop and continuously set the pwm register and make it dim/brighten in that manner. So the pwm register IS behaving as I expect.
  • Our experts for this issue are currently celebrating the Chinese national holiday, and they will respond next week.

  • Hi Brian,

    Please point me to more examples

    The only programming example available is what you utilized for LED blinking. 

    But that defeats the reason for having the LP3944 as it obviously puts a big load on the I2C bus and the processor.

    It is correct that the breathing effect requires a continuous increase/decrease on duty cycle in a loop function. That's why I will recommend LP5569 as a better solution in this case to improve the dimming flexibility instead of mapping LEDs to DIM0/1 and alleviate load on I2C bus by engine-control feature.

    Best Regards,

    Aaron

  • Aaron,

    So this text in the LP3944 RGB/White/Blue 8-LED Fun Light Driver specification sheet is incorrect:

    The
    LP3944 contains the ability to dim LEDs in
    applications where it is required to cut down on bus traffic.
    Traditionally, to dim LEDs using a serial shift register such as 74LS594/5 would require a large amount of
    traffic to be on the serial bus. LP3944 instead
    requires only the setup of the frequency and duty
    cycle for each output pin. From then on, only a single
    command from the host is required to turn each
    individual open drain output ON, OFF, or to cycle a
    programmed frequency and duty cycle.

  • Hi Brian,

    The statement on the datasheet is correct depending on how you understand the dim feature in here. It is a broad concept for LED animation; based on my understanding, what you are looking for is the LED breathing effect. Therefore, I recommend newer LP5569 which better meets your design requirement.

    Best Regards,

    Aaron

  • Aaron, thanks for the information. Which chip to use is not my decision but I feel there must have been a misunderstanding amongst those making the decision as to what the capabilities of the LP3944 are. Now that I have programmed the LP3944 I have a pretty good idea of what it can and cannot do. I have to admit that when I read the data sheet for the first time I thought I would be able to set this 'breathing effect' independently on each LED. I thought there was a DIM0 and DIM1 pair for each LED. IN any case, it is what it is. If those making decisions on the hardware are expecting hardware dimming, well, they will need to change hardware!

    I should also mention that the market term 'dimmable LEDs' in household lighting is used ubiquitously to express the ability of the LED (or any other light bulb) to be set at any intensity between off and maximum brightness, usually by a slider or a dial. So it is easy to see the misinterpretation of the term.

  • Hi Brian,

    If you have any questions on part selection, feel free to post on e2e forum so that we can help at advance to find the most suitable candidate.

    Best Regards,

    Aaron

  • Aaron,

    I will defer those decisions who are designing the hardware. I am not sure exactly what they are expecting.