I need help to configure 2 hardware PWM channels. I am developing device, and sometimes I will need active 2 PWM channels with different frequencies (frequencies is low: 410 and 580 Hz).I'm writing program in Qt on C++. In the Broadcom datasheet I saw, that raspberry have 2 hardware PWM channels, but when I configure 2 channels - first channel not working properly: it generate signal with frequency, that I configured for second channel. Screenshot of piece of my code is attached.
1 Answer
That is a feature of wiringPi. The two channels share some settings. The range value is certainly set the same for both channels.
You will have to tailor wiringPi.c to your own requirements and rebuild wiringPi if you want different behaviour.
-
-
Perhaps contact the author (although I think given the comment in the code you would be expected to do this yourself). Why not use a different library like bcm2835 or (my) pigpio.– joanAug 5, 2019 at 9:45