Page 1 of 1

arduino millis() and micros() functions

Posted: Mon Feb 27, 2023 2:34 pm
by Jerry Messina
I did a port of the arduino millis() and micros() library functions that uses a 16-bit TMR along with a CCP module to produce msec and usec delays with 1us resolution. See the wiki page millis() and micros() timer routines

These are improved versions that do not suffer from the same inaccuracies/lack of resolution as the original arduino functions.

The millimicros.bas module also shows two different methods for safely accessing variables shared between an ISR and the main context.

Re: arduino millis() and micros() functions

Posted: Tue Feb 28, 2023 3:18 am
by W4GNS
Thanks for all your contributions, Jerry!

Re: arduino millis() and micros() functions

Posted: Sat Mar 04, 2023 2:01 pm
by bitfogav
Thank you Jerry for sharing and the continue support here..