Hi,
I'm thinking of using a Teensy for a I2C sniffer, and am experimenting to see how fast I can loop through a small program to toggle a single output line (Teensy Blink without the delay). On my O'Scope it appears it takes about 7 uSec (~150KHz) for a complete cycle, which is way too slow for even 100KHz I2C bus speed. So, I switched to a T3.5, and got an almost identical result. Is there something I'm missing here - maybe a CPU speed setting?
Here's the code I'm running:
I'm thinking of using a Teensy for a I2C sniffer, and am experimenting to see how fast I can loop through a small program to toggle a single output line (Teensy Blink without the delay). On my O'Scope it appears it takes about 7 uSec (~150KHz) for a complete cycle, which is way too slow for even 100KHz I2C bus speed. So, I switched to a T3.5, and got an almost identical result. Is there something I'm missing here - maybe a CPU speed setting?
Here's the code I'm running:
HTML:
const int LED_PIN = 13;
void setup()
{
Serial.begin(115200);
while (!Serial && millis() < 13000);
Serial.print("Teensy Online @ millis=");
Serial.println(millis());
Serial.println("Starting Teensy");
pinMode(LED_BUILTIN, OUTPUT);
//12/17/19 for I2C sniffer testing
pinMode(2, INPUT);
pinMode(3, INPUT);
/* add setup code here */
}
void loop()
{
bool status = digitalRead(LED_BUILTIN);
digitalWrite(LED_BUILTIN, !status);
//delay(1250);
//Serial.println("blink");
/* add main program code here */
}