Avatar for Marc

Marc

Member since Apr 2016 • Last active Jan 2020
  • 2 conversations
  • 9 comments

Most recent activity

  • in General
    Avatar for Marc

    Hey Gordon,

    I finally did all the coding for my 16 channel PWM, now there are a few hiccups left so solve.
    To understand what I'm doing: I control 16 LED stripes from my espruino pico, that fade in one by one and after a little wait they fade out again.
    13 pins are hardware PWM and 3 are software only.
    I use setInterval with an interval of 15 to trigger the fading function, which increases the pwm value of the current channel and then analogWrites that value to the pin.
    If the pin is software then I do
    analogWrite(pin, value, { freq: 600, soft:true, forceSoft:true });
    I tried different frequencies, but 600 seems like a good compromise, with lower values the fading flickers and with higher values all lighted soft-PWM pins flicker when changing the value of one soft-PWM pin.
    But even with a value of 600 sometimes when fading in another soft-PWM pin, the others flicker and once in a while one of the other soft-PWM pins turns off completely for a short amount of time and then turns on again (without any software sending a new value to that pin).

    Any idea how this may be solved? Or is a freqency of 600 on 3 pins too much for the CPU to handle?

    Thanks in advance,
    Marc

  • in General
    Avatar for Marc

    It's exactly the same as dwallersv reported in #7.
    If I press the button with a screwdriver it works as expected, when pressing with my finger the event is called often when just touching the button without pressing it.

    Best wishes,
    Marc

  • in General
    Avatar for Marc

    Yes, it's a pico.
    The firmware is 1v85.
    The demo code sends analogwrite to the pins B8,A2,A3,B10,B1,A7,A6,A5,A10,B9,A8,B7,B6­,B5,B4,B3. Nothing else in that function.
    I will try again with rising, but I think I also tried that before.

  • in General
    Avatar for Marc

    Ah, I thought pins like B1 can be either TIM1_CH3N or TIM3_CH4.
    Thanks again :)

  • in General
    Avatar for Marc

    Hey Gordon,

    I have a strange phenomenon with setWatch. The Code:

    clearWatch();
    setWatch(demo, BTN1, {repeat:true, edge:'falling', debounce:50 });
    The demo() function just does some LED blinking.

    When pressing the button the watchfunction runs once most times, but sometimes twice and in rare cases it even loops forever without stopping.
    Sometimes i only have to move my finger on the button without pressing it and the demo function runs.
    I tried all kinds of parameter combinations, but did not find one that works once every time the button is pressed.
    Any idea?

    Thanks in advance,
    Marc

  • in General
    Avatar for Marc

    Hey Gordon,

    thanks, this really works great, I now run 3 pins as software pwm (had to force it).
    Would be nice to replace those negated PWMs with real PWM channels on the pins that can do both. No idea, what those negated channels may be good for.

    Best regards,
    Marc

  • in General
    Avatar for Marc

    And what about pins like B1, that list 2 different PWM channels?

  • in General
    Avatar for Marc

    Thanks for your quick answer. The PWM is just for LED dimming, so it doesn't be very acurate.
    What do you mean with "tricky"? Can B15 and A10 both be used by using software PWM?

Actions