When i set the PWM Frequency at the GPIO Node to 25khz
Why i just get 5,68kHz at the oscilloscope?
Nobody an idear?
the default nodes just use the python GPIO.PWM code which may be well off (though I'm surprised it's that bad) - eg see https://raspberrypi.stackexchange.com/questions/298/can-i-use-the-gpio-for-pulse-width-modulation-pwm
Thanks i will have a look at it
Seems that that the WiringPi node is discontinued.
Have to check the others...
??? - are you using the built in node to start with ?
If you have a scope and some time ... :-)... it would be great if you could do some measurements. At various frequencies from say 20Hz, 50, 100, 200, 500, 1K... etc and report the level of inaccuracy... if it's a simple function we may be able to compensate in the node - or not... Also would ideally need to try various different Pi versions to see how much is down to overheads in the OS that the processor speed can't cope with etc.
This was with the standart Node.
I will do a few test this evening
Very interesting - which Pi version is this ?
Net I take from that is this particular implementation of PWM only really works up to about 1kHz. (I'll add a note to the info to reflect this limitation)
It may be worth also looking at http://abyz.me.uk/rpi/pigpio/pigs.html#HP
The node-red-node-pi-gpiod node uses the pigpiod as it's base instead - and can also do pwm - but currently it doesn't allow frequency to be set. see https://github.com/node-red/node-red-nodes/blob/master/hardware/pigpiod/pi-gpiod.js#L149
Certainly I've used it in servo mode and it seems to be very solid timing wise - so maybe its pwm is beeter also.
it is a 3b+
Pi-Blaster also cant 25kHz cause of a bug or something like that.
Any other ideas?