Finding library documentation

I started off with Timer1 with information from this page:


It got me going, but I need some more details, all my efforts to locate something have failed. I clicked the appropriate link at the bottom of the page, and it sent me to a generic Arduino information page with a search box at the top, I entered TImer1 library and a number of hits came up, they were all inapplicable to my situation , I need plain vanilla specs on the basic functions involved. If someone could provide me with a link I'd appreciate it.

I've experienced the same problem every time I've tried to get more detailed information on library funcs. Even google searches send me to that generic page and that's where things go off the rails. Maybe the problem is that the Arduino information is not set up for Teensy??

Specifically, what's the maximum value for the argument of the Initialize() function? It appears to be rolling over when I try large values.
 
My first choice for documentation is the .h file itself... At least that should be upto date for the library version... And then I would look at the .cpp file for more details.
 
Just in case this helps anyone else, I did some investigation on TimerOne on Teensy 4.0 following encountering some strange behaviour with the demo code referenced in my original post. It turns out that the maximum reliable value for the Timer1.initialize function argument is a bit over 50,000 (not 65535). Here are the delay times, eyeballed from my Rigol DS1000E:

20,000 : 20mS
50,000 : 50mS
55,000 : 55mS
60,000 : 56mS (probably rough figures from here on)
100,000 : 58mS
150,000 (as per the demo code) : 58mS
Anything larger: doesn't change.

A reminder to me to be wary with demo code, obviously each hardware device has its associated behaviour, based on the chip internals
plus the associated on-the-metal code.
 
TimerOne is very old, going back to original 8-bit Arduino. It does support T4.x, but with limitations. The code below is from TimerOne.h, and explains what you're seeing. You should try IntervalTimer, which is built into Teensy4 core, uses the IMXRT PIT and won't have the same limitations.

Code:
            prescale = 7;    // when F_BUS is 150 MHz, longest
            period = 32767; // period is 55922 us (~17.9 Hz)
 
Back
Top