Timers

Timers are very interesting and essential part of ZPuino ,consider including your blinking sketch or any timely mannered code in a function which runs on its own depending if it is time or not ,Timers are also essential for generating PWM which are essential for controlling motors speeds or dimming an LED.

ZPuino has :

  1. Two independent Timers
  2. 10-bit prescaler
  3. 16 and 24 bit counter
  4. Count up and count down mode
  5. Clear on compare match support
  6. Interrupt support on compare match
  7. Output compare Registers to GPIO PINS (Allows PWM)
  8. The first 16-bit timer has prescaler and TSC (Time Stamp Counter)
  9. The second 24-bit timer has no prescaler nor TSC
  10. The PWM controls of the 2nd timer are double buffered

please refer to ZPuino timer section for more details

You control the timers by writing directly to its registers as referred in the link above or if you are not familiar with such operation you can simply use the functions developed by Alvaro.

Functions:

Examples:

  

Share |