What is the best method to get the Teensy 3.2 to produce a 16MHz clock output for another chip?
My guess is that PWM output at 50% dutycycle is the best way, but please let me know if there is a better solution.
I think this might not quite be right, particularly the resolution and value I use analogWrite to set, but is this about what I need?
In this application I'm not using any other PWM pins, thankfully, though it would be nice to know if there's a way to generate a high frequency clock while still being able to use 16-bit PWM on other pins at lower PWM frequency.
My guess is that PWM output at 50% dutycycle is the best way, but please let me know if there is a better solution.
Code:
pinMode(5, OUTPUT); // Configure pin 5 as output.
analogWriteFrequency(5, 16000000); // Set PWM frequency to 16M
analogWriteResolution(1); // Set PWM resolution to 1 bit
analogWrite(5,0); // On from start until counter reaches 0, then shuts off until counter reaches 1 and then loops back?
I think this might not quite be right, particularly the resolution and value I use analogWrite to set, but is this about what I need?
In this application I'm not using any other PWM pins, thankfully, though it would be nice to know if there's a way to generate a high frequency clock while still being able to use 16-bit PWM on other pins at lower PWM frequency.