Hi Paul and others,
When toggling an output pin, the IntervalTimer class, seems to be limited to 1.6 microsecond intervals on Teensy 4.
On T3.6, I was able to go as low as 0.7 microseconds - so I imagine that T4 hardware is capable of much faster updates.
Here's my code (shown with 1 microsecond intervals, this fails on T4):
I tried using both digitalWrite() and digitalWriteFast() to toggle the pin, same result.
Thanks!
When toggling an output pin, the IntervalTimer class, seems to be limited to 1.6 microsecond intervals on Teensy 4.
On T3.6, I was able to go as low as 0.7 microseconds - so I imagine that T4 hardware is capable of much faster updates.
Here's my code (shown with 1 microsecond intervals, this fails on T4):
Code:
#define OUT_PIN 17
IntervalTimer myTimer;
byte outPinState = 0;
void setup() {
pinMode(OUT_PIN, OUTPUT);
myTimer.begin(timerCallback, 1);
}
void timerCallback() {
outPinState = 1-outPinState;
digitalWriteFast(OUT_PIN, outPinState);
}
void loop() {
}
I tried using both digitalWrite() and digitalWriteFast() to toggle the pin, same result.
Thanks!