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

Header file for timer1.c. More...

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

Go to the source code of this file.

Macros

#define _TICK_US_1   0.0625
 
#define _TICK_MS_1   0.0000625
 
#define _TICK_US_0   16
 
#define _TICK_MS_0   0.016
 

Functions

void _timer1_init (void)
 
uint64_t _micros1 (void)
 
uint64_t _millis1 (void)
 

Variables

volatile uint8_t _controler_flag_A
 
volatile uint8_t _controler_flag_B
 

Detailed Description

Header file for timer1.c.

  • File: timer1.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
/9/2021 10:17:41 AM

Definition in file __timer1__.h.

Function Documentation

◆ _timer1_init()

void _timer1_init ( void  )

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

16 {
17  TCCR1A |= (1 << COM1A1) | (0 << COM1A0) | (1 << COM1B1) | (0 << COM1B0);
18  TCCR1A |= (1 << WGM11 ) | (0 << WGM10 ) ; // top is ICr , FAST PWM
19  ICR1 = 0xFFFF;
20  TCCR1B |= (1 << WGM13) | (1 << WGM12);
21  TCCR1B |= (0 << CS12 ) | (0 << CS11 ) | (1 << CS10); // timer active at 16M/65526 frequency of Overflow
22  TIMSK1 |= (1 << TOIE1);
23  sei();
24 }

Referenced by board_init().

Here is the caller graph for this function: