I have an external sensor that needs at minimum, a 40 kHz oscillator which I made using a LTC6907. To read out the data, I need to be able to count pulses in order to synchronize to it and I chose the Nano33 BLE since it had a clock speed of 64 MHz. As a simple test, only the oscillator is connected to the Nano33 and the simplest amount of code is used. The oscillator is an external interrupt on D2, the routine then counts the number of interrupts. I expected 40,000 but instead, I got anywhere between 19,000 to 29,000 counts. I'm baffled. I would have thought it would be able to keep up. Any ideas why it's not even close? I verified the input frequency using a scope and everything is correct.
testnano33ble4xscan.ino (939 Bytes)