SWARM-Bot Firmware  v1.0
Mobile robot OS - Embedded C/C++
__timer2__.h File Reference

Header file for timer2.c. More...

#include <__swarm_wold__.h>
Include dependency graph for __timer2__.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void _timer2_init (void)
 

Detailed Description

Header file for timer2.c.

  • File: timer2.h
  • Compiler: GCC-AVR
  • Supported devices: Tested on 328p
  • AppNote: Discrete PID controller
Author
Swarm robot graduation project workgroub
Mechatronics Program for the Distinguished
$Name$
Revision
1

$RCSfile$

Date
/20/2021 12:04:32 AM

Definition in file __timer2__.h.

Function Documentation

◆ _timer2_init()

void _timer2_init ( void  )

Initialize Timer/Counter 2 with 1 prescaler (244 Hz overflow frequency at 16 MHz)

11 {
12  TCCR2A = 0;
13  OCR2A = 128;
14  TCCR2B |=(1 << CS22) | (1 << CS21) | (1 << CS20);
15  TIMSK2 |= (1 << OCIE2A) | (1 << TOIE2);
16 }