Skip to main content

Timeline for PWM issues with pigpio and RPi.GPIO

Current License: CC BY-SA 4.0

16 events
when toggle format what by license comment
Jul 8, 2020 at 16:02 comment added joan Add a script which shows the problem as a NEW question and I'll have a look.
Jul 8, 2020 at 15:56 comment added Bassline Soup Is there any reason that get_pwm_dutycycle after changing the duty cycle consistently gives three of the old value, a zero and then finally the new value?
Jul 8, 2020 at 15:47 comment added Bassline Soup I just don't quite understand how the higher frequency avoids this :/
Jul 8, 2020 at 15:24 comment added joan I think the trigger is less than a millisecond high then more than 160µs low.
Jul 8, 2020 at 15:22 comment added Bassline Soup OK, great, now it works. I don't really understand how. Even if I set to 0% for a few seconds and then back to another level, it works. But surely 0% is effectively Low and Easyscale should then trigger. Anyway, thanks
Jul 8, 2020 at 15:14 comment added joan I think so. You may be able to set it to 0% (0) and 100% (1000000) as they shouldn't trigger the 160µs timeout either. You will have to experiment.
Jul 8, 2020 at 15:07 comment added Bassline Soup OK, thanks, I'll give it a go. Just to clarify: Do you mean that with the frequency at 10000, I would keep the duty cycle just above zero so you didn't see it but the chip would still not trigger EasyScale? Or is there something else I am missing?
Jul 8, 2020 at 14:56 comment added joan Interesting chip. I'm sure you could use pigpio to program the one wire interface but I haven't the time to spare at the moment. I suggest you use hardware PWM with pigpio at a higher frequency as you are using GPIO 18. Try the Python hardware_PWM() method. Choose a frequency of say 10000 to prevent the chip entering one wire mode.
Jul 8, 2020 at 14:27 comment added Bassline Soup So, I am using the TI driver [here] (ti.com/lit/ds/symlink/…). Am I right in thinking that by dimming to zero (or strangely 1) I am activating EasyScale? If so, can you give me an idea on the complexity of writing a script to send the EasyScale commands? I had a quick try using wave_add_serial etc. but no dice. Looking at the pigpio examples, it looks quite in depth to just send a couple of nibbles, is that correct?
Jul 8, 2020 at 12:11 comment added Bassline Soup I have done used piscine now and can also see that the pin is doing what it should so it could be an issue with the LED driver. Thanks
Jul 8, 2020 at 11:12 comment added Bassline Soup Yes, I agree, it should work but it doesn't so don't know where to dig deeper to find the issue. It must be a driver issue somewhere...
Jul 8, 2020 at 10:53 comment added joan I have run that code and it works fine. I have also tried range(0,200) and range(200,0,-1) and they work fine as well. The PWM continues to cycle correctly as can be seen using piscope.
Jul 8, 2020 at 10:43 comment added Bassline Soup I don't think either the code or the wiring is wrong but I have updated my question to include the code. It seems to me to be a pigpio bug or some lower level problem
Jul 8, 2020 at 10:36 comment added joan I would need to see the code you are using as what you describe is not what happens, so either the code is wrong or your wiring is wrong or the backlight does not work as you think.
Jul 8, 2020 at 10:31 comment added Bassline Soup Thanks Joan. The problem with pigpio is as I have stated in my question: as soon as the DC is set to either 1 or 0, any value I send >1 results in fully on
Jul 8, 2020 at 10:10 history answered joan CC BY-SA 4.0