Skip to content

Commit ecd4dfc

Browse files
authored
Clarification Systick use by SAM(D) architectures
1 parent bed5bee commit ecd4dfc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Language/Functions/Time/millis.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void loop() {
6666
=== Notes and Warnings
6767
Please note that the return value for millis() is of type `unsigned long`, logic errors may occur if a programmer tries to do arithmetic with smaller data types such as `int`. Even signed `long` may encounter errors as its maximum value is half that of its unsigned counterpart.
6868

69-
AVR-based architectures program a timer to implement millis(), reconfiguring these timers may result in inaccurate millis() readings. ArduinoCore-AVR relies on TIM0 which is programmed to generate an interrupt every 16384 clock cycles (clock divider set to 64, overflow every 256 ticks). The same holds for ArduinoCore-mega-AVR, except that it uses TIMx if MILLIS_USER_TIMx (0<=x<=3) is defined.
69+
On some architectures reconfiguration of timers may result in inaccurate millis() readings. AVR-based architectures program a timer to implement millis(): ArduinoCore-AVR programs TIM0 to generate an interrupt every 16384 clock cycles (clock divider set to 64, overflow every 256 ticks). The same holds for ArduinoCore-mega-AVR, except that it uses TIMx if MILLIS_USER_TIMx (0<=x<=3) is defined. The ArduinoCore-SAM(D) architectures rely on the Systick timer which is programmed to generate an interrupt every 1 ms.
7070

7171
--
7272
// HOW TO USE SECTION ENDS

0 commit comments

Comments
 (0)