arduino millis() and micros() functions

Coding and general discussion relating to user created compiler modules

Moderators: David Barker, Jerry Messina

Post Reply
Jerry Messina
Swordfish Developer
Posts: 1473
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

arduino millis() and micros() functions

Post by Jerry Messina » Mon Feb 27, 2023 2:34 pm

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.

W4GNS
Registered User
Registered User
Posts: 29
Joined: Wed Nov 03, 2010 7:18 pm
Location: Occupied South (Virginia)

Re: arduino millis() and micros() functions

Post by W4GNS » Tue Feb 28, 2023 3:18 am

Thanks for all your contributions, Jerry!
Gary W4GNS

bitfogav
Registered User
Registered User
Posts: 169
Joined: Sat Oct 09, 2010 1:39 pm
Location: United Kingdom

Re: arduino millis() and micros() functions

Post by bitfogav » Sat Mar 04, 2023 2:01 pm

Thank you Jerry for sharing and the continue support here..

Post Reply