Hello all, I'm hoping to generate a 54MHz clock signal from a Teensy 3.6
I've looked into "fast" ways to set and clear ports, etc, and am currently running this very simple program:
...however, this produces a square wave with an asymmetrical waveform / a non-50/50 duty cycle, and the wave is only at around 2.5MHz.
I'm compiling with "CPU Speed" at 240MHz and "Optimize" set to "Fastest". I don't understand why, but if I compile at "240MHz" and "Smallest Code", I get a 10MHz waveform that erratically (about 1 in 4 times) sticks in the "on" position for a clock cycle or two...
I'm sorry if I've missed something obvious - I'd be very grateful for anyone's opinion/debug/advice-to-just-use-a-clock-generator...
Thank you,
AKA
I've looked into "fast" ways to set and clear ports, etc, and am currently running this very simple program:
Code:
#define ap 5
void setup() {
pinMode(ap, OUTPUT);
}
void loop() {
while (1) {
digitalWriteFast(ap, HIGH);
digitalWriteFast(ap, LOW);
}
}
...however, this produces a square wave with an asymmetrical waveform / a non-50/50 duty cycle, and the wave is only at around 2.5MHz.
I'm compiling with "CPU Speed" at 240MHz and "Optimize" set to "Fastest". I don't understand why, but if I compile at "240MHz" and "Smallest Code", I get a 10MHz waveform that erratically (about 1 in 4 times) sticks in the "on" position for a clock cycle or two...
I'm sorry if I've missed something obvious - I'd be very grateful for anyone's opinion/debug/advice-to-just-use-a-clock-generator...
Thank you,
AKA