bool begin(void (*funct)(), float microseconds) {
if (microseconds <= 0 || microseconds > MAX_PERIOD) return false;
uint32_t cycles = (float)(F_BUS / 1000000) * microseconds - 0.5;
if (cycles < 36) return false;
return beginCycles(funct, cycles);
}
but it needs to go below 1 microsecond so I can't use IntervalTimer
setup() {
while ( !Serial );
Serial.print( "F_BUS == " );
Serial.println( F_BUS );
...
Thank you! Didn't know that F_BUS returns the value but as Paul said the Library is limited to 36 if I understand correctly. I did some calculations and I think I need abou 170ns resolution. But with 36MHz in theory i can go 27ns?
But with 36MHz in theory i can go 27ns?
However, on Teensy 4.0 where the CPU runs at 600 MHz and the processor has a pair of 64 bit paths to tightly coupled memory, perhaps the overhead could possibly be low enough? With overclocking to 960 MHz, those ~24 CPU cycles of overhead could get down into the 27 ns range....