I am trying to get lowest duty cycle PWM output at 16 bit resolution on a Teensy 4.0, but output ceases when I specify analogWrite(pwmPin, 1).
This is not a problem if resolution of 15 bits is used.
I calculated Ideal Frequency using f = 600,000,000 / (2**BitResolution * 4), as it appears was used for the td_pulse Ideal Frequency table.
15 bit resolution works.
16 bits does not.
I may as well use 15 bits since duty cycles less than 1/32768 (2/65536) are unattainable.
I hope it is I who is doing something wrong.
I do note that on the td_pulse Ideal Frequency table, 16 bit resolution is included only for Teensy 3 series but not for Teensy 4. Perhaps there's a reason for that.
This is not a problem if resolution of 15 bits is used.
I calculated Ideal Frequency using f = 600,000,000 / (2**BitResolution * 4), as it appears was used for the td_pulse Ideal Frequency table.
15 bit resolution works.
PHP:
analogWriteResolution(15);
analogWriteFrequency(pwmPin, 4577.64);
analogWrite (pwmPin, 1); // This produces output with duty cycle 1/32768
PHP:
analogWriteResolution(16);
analogWriteFrequency(pwmPin, 2288.818);
analogWrite (pwmPin, 1); // This produces no pulses
analogWrite (pwmPin, 2); // This produces the narrowest pulse and lowest duty cycle is also (1/32768)
I hope it is I who is doing something wrong.
I do note that on the td_pulse Ideal Frequency table, 16 bit resolution is included only for Teensy 3 series but not for Teensy 4. Perhaps there's a reason for that.