I'm hoping somebody here can help me out as I'm new to the Giga platform and can't for the life of me understand what's happening here. I have an application where I need to use all of the standard PWM pins on the Giga (D2-D13). My first upload, I had an issue with D11, it was reading near-zero voltage when I set the duty cycle to 195. I isolated the Giga from the system and tested the board into the ground and what I discovered was that pins D11 and D12 would interfere with each other when I analogWrite. Whichever one was set most recently would read the correct voltage based on duty cycle, while the other would read about 0.3V. Some of what I tried to verify the issue:
^will flip back and forth between pin 12 set, pin 11 0V and pin 11 set, pin 12 0V every 10s
The two pins use different timers/channels and are officially supported as PWM pins. I don't see anything in the docs or any other forum posts describing this issue. I see the two pins are part of the SPI port but I don't even have the SPI library installed. I've replicated the issue on two different Gigas. I'm no stranger to Arduinos but this one has me totally stumped. Thanks in advance to anyone who can shed some light on this issue, I'll try anything!
Hi, might be worth taking a look at this git issue raised recently as it may be related. Different board / mcu but both are using the ArduinoCore for mbedOS and analogWrites to PWM pins.
Could be related to MbedOS, but my issue is with causing pins to revert to 0V, not two pins being set the same. Is this something I should make a Git issue for?
My hunch is this is normal but poorly documented for those specific pins shared with SPI. Raise an issue, someone who really knows will respond eventually.
YMMV
I think it's deserving of a git issue. I've tried a similarly simple sketch but using the mbed::PwmOut (that's used under the covers) and had the same result.