-1

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.

enter image description here

1
  • 2
    Please don't use pictures of text. Instead paste the text direct into the question.
    – Ingo
    Jul 31 '19 at 7:16
0

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.

2
  • Can you help me change sources ? Aug 5 '19 at 9:21
  • 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.
    – joan
    Aug 5 '19 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.