This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

PWM hardware used to blink/fan 16 leds with driver

Hello

i have made a program to smoothly blink/fan/vary the intensity of 16 LEDs together using 4 PWM with 4 output pins, the program seems to work well with around 4 leds, but when i attach more LEDs like 8, the other leds start to blink in a abnormal manner. Just wanted to know why it is happening like this? is it somewhat related to optimal output power of the nrf52, or maybe some mistake in code. Also the leds have led drivers attached and external power source. i just have to give 16 pwm signals to them.

i have used the pwm hardware as is recommended for smoother variation.

link to zip-

drive.google.com/.../view

Parents
  • Hi

    If the problem happens when you physically attach more LED's, and not when you add more PWM channels in the software, I would have to assume it is related to the amount of current sourced to each pin.

    Have you measured how much current is sourced to each LED?

    The nominal source/sink current for each GPIO is only 0.5mA, and if you exceed this then the behavior might be unpredictable.

    You can set up to three pins in high drive mode, where you can source/sink up to 5mA, but this doesn't really help if you are trying to use more than 3 pins.

    Do you have a schematic or diagram showing how each LED is connected?

    Best regards
    Torbjørn

  • drive.google.com/open

    Please find attached a basic schema.

    Basically, i have 16 LED- 4 each of R G B W. each led has its own driver, and each driver takes pwm input from 16 gpio outputs of nrf52 as mentioned in the program. As the driver is driven by pwm outputs, when i measure current, my multimeter doesn't shows any current upto 0.000A. Therefore, I assume its much less than 5mA. So that shouldn't be an issue logically. When i run the program and attach all leds to respective pwm, some leds work at full brightness whereas the others at random brightness. I am not able to figure out the issue.

    Also one more thing i wanted to know. in the program, I use 4 timers to drive 4 PWM of 4 channels each, thus an output of 16 channels, with each 4 having the same duty cycle. Is it possible to set the duty cycle of each 16 channels separately , and is it possible for seperate playback for each channel on nrf52?

    Many thanks in advance

Reply
  • drive.google.com/open

    Please find attached a basic schema.

    Basically, i have 16 LED- 4 each of R G B W. each led has its own driver, and each driver takes pwm input from 16 gpio outputs of nrf52 as mentioned in the program. As the driver is driven by pwm outputs, when i measure current, my multimeter doesn't shows any current upto 0.000A. Therefore, I assume its much less than 5mA. So that shouldn't be an issue logically. When i run the program and attach all leds to respective pwm, some leds work at full brightness whereas the others at random brightness. I am not able to figure out the issue.

    Also one more thing i wanted to know. in the program, I use 4 timers to drive 4 PWM of 4 channels each, thus an output of 16 channels, with each 4 having the same duty cycle. Is it possible to set the duty cycle of each 16 channels separately , and is it possible for seperate playback for each channel on nrf52?

    Many thanks in advance

Children
No Data
Related