Feather nRF52840 PWM w/2 Pins Opposite Polarity

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Casey10110
 
Posts: 97
Joined: Tue May 10, 2016 9:48 am

Feather nRF52840 PWM w/2 Pins Opposite Polarity

Post by Casey10110 »

Hi Guys,

I am trying to accomplish something like the well known ToneAC library does on the Feather nRF52840. I've modified the Tone.cpp file in the NRF5 core folder to make it output the PWM signal on more than one pin, explicitly naming the pins that I am using in this application:

Code: Select all

    uint32_t pins[NRF_PWM_CHANNEL_COUNT] = {
        g_ADigitalPinMap[16],
        g_ADigitalPinMap[17],
        NRF_PWM_PIN_NOT_CONNECTED,
        NRF_PWM_PIN_NOT_CONNECTED
    };
I have read about how to modify the polarity using something like

Code: Select all

seq_values->channel_0 = duty_cycle | 0x8000;
here:

https://devzone.nordicsemi.com/f/nordic ... -behaviour

Any idea how to integrate this solution into the Tone.cpp file or elsewhere? Or perhaps a different solution? I've got the signal on both pins, but just want to flip the polarity of one of them to increase the loudness of the resulting signal.

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”