Timers - PalouseRobosub/SUBLIBinal GitHub Wiki

#Timers This page contains information about the implementation of timers using the SUBLIBinal Timers peripheral library. Timers can be easily implemented by filling out the Timer_Config structure and then calling the initialize_Timer function. There are three different parts to know about timers, including the functions involved, the structures used for creation, and the enumerations used within the structures. Please use the following links to read more about the different parts of timer functionality.

Timer Implementation:

To view code examples of the implementation of a timer, please refer to the Timer Example page.

What are timers?

Timers are devices within the microcontroller that use the internal clock on the microcontroller to measure time. A timer is typically set to finish its count, for example, every second. When the second has passed, an interrupt service routine is called and certain code is executed. Timers are typically used for clocking events that need to occur repeatedly and at normal intervals, such as querying external devices. Timers can also be used for generating wave forms using the output compare module. SUBLIBinal implements this through the PWM peripheral library. Timers are one of the most fundamental and easy to use peripherals within the microcontroller.