Go to the source code of this file.
Timer2 Period in ms.
When the period is reached, the timer is reset. Since Timer2 is used in the output compare (PWM output), this period defines the period of the PWM as well. If you want 50Hz, set this as 20ms
Definition at line 27 of file timer.h.
#define T2_TICKS_TO_MSEC 642 |
Number of Timer2 ticks in a millisecond.
To calculate this, take: 1/(frequencyCPU/Timer2PreScaler)*TICKS_TO_MSEC should equal close to 0.001 or 1 ms In this case, (1/(41Mhz/64))*642 == ~1ms
This value is used to accurately define the timer2 period (used for output pwm frequency
Definition at line 20 of file timer.h.
long unsigned int getTime |
( |
| ) |
|
Get current time in ms.
- Returns
- ms
Definition at line 54 of file timer.c.
Initializes Timer2.
Its used as a 16-bit timer. Used for PWM input and output management
Its used as a 16-bit timer
Definition at line 16 of file timer.c.
Initializes Timer4.
Used as a 16-bit, interrupt enabled, 1ms timer
Initializes Timer4.
Definition at line 33 of file timer.c.