I’m trying to get the Photon’s PWM hardware working at 25Khz to avoid an annoying audible noise that a power mosfet in my design does.
I have been reading the particle docs about analogWrite and the related functions, as well as other recipes on internet but neither of that methods seems to work. (https://docs.particle.io/reference/firmware/photon/#analogwrite-pwm-)
I’ve been able to change the resolution of the PWM from 8bits to 12bits with no problem, but when I try to do analogWrite with the frequency parameter I can’t get it working above 10Khz (9999.8Hz actually)
My mosfet is connected to A4 PIN, but I have been trying with A5 and WKP with the same result, pins D2 and D3 (wich share PWM with A4 and A5 are set to digital output (LOW level) and unused in the test scenario.
I’m using firmware version 0.6.1 and Particle Dev.
Thanks for your help.