Hello,
I need to generate a +- 22MHZ pulse
and strangely enough digitalWrite functions are extremely slow compared to the teensy 3.6 working frequency (240Mhz)
with this code I can only achieve around 600khz
I know I can do pwm, but out of curiosity, why is it so slow ???
thanks
I need to generate a +- 22MHZ pulse
and strangely enough digitalWrite functions are extremely slow compared to the teensy 3.6 working frequency (240Mhz)
Code:
#define MCLK 9
byte pulse=0;
void setup() {
pinMode(MCLK,OUTPUT);
}
void loop() {
digitalWrite(MCLK,pulse); pulse=1-pulse;
}
with this code I can only achieve around 600khz
I know I can do pwm, but out of curiosity, why is it so slow ???
thanks