analogWriteFrequency Min/Max range

Depends on which Teensy model you're using and what CPU speed (as set in the Tools > CPU Speed menu before uploading). On some boards, also may depend on the pin, as some pins use different timers with slightly different hardware capability.

I believe code was added many years ago to support very low frequencies on Teensy 3.x by reconfiguring the timer clock source. Pretty sure that work has not (yet) been done for analogWriteFrequency() on Teensy 4.x, so the low limit is probably around 20 Hz.
 
I am trying to add support for it in Visuino. One of the features of Visuino is that it can either suggest or hard limit ranges for values.
What do you think is a good range to use for the different boards? I can specify it per board if needed.
 
The table indicated in p#2 is best guess here, PaulStoffregen would know if otherwise.

The fastest expected for each device would seem to be that shown as ideal for the 2 bit resolution. Even that may not work for all higher bit resolutions? But seems it wouldn't work faster than that in any case.

And on reading that table even for the individual Teensy - a change in clock speed from 'default' will as listed affect the resulting speed.
 
The table seems to list the default frequency. I was looking for Min Max limits. Maybe I am missing something :-(
 
The table seems to list the default frequency. I was looking for Min Max limits. Maybe I am missing something :-(

Check the indicated "PWM Resolution" section that lists the "Ideal" - that is where the math works best for adjustment for various bits of resolution. From that it was assumed the MAX would be that shown as suggested for the lowest 2 bit resolution.

The actual usable MIN as noted p#2 - will vary with the selected resolution for the device at hand given the math involved with the integer divider used to create the desired frequency.
 
Back
Top