Skip to content

Instantly share code, notes, and snippets.

@WickedDevice
Created December 3, 2012 05:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WickedDevice/4192982 to your computer and use it in GitHub Desktop.
Save WickedDevice/4192982 to your computer and use it in GitHub Desktop.
/*
* timebase.h
*
* Created on: Dec 3, 2012
* Author: vic
*/
#ifndef TIMEBASE_H_
#define TIMEBASE_H_
// timer 0 is set up as a 1ms time base
#define TIMER0_1MS_OVERFOW_PRESCALER 3 // 8MHz / 64 = 125 kHz
#define TIMER0_1MS_OVERFLOW_TCNT 131 // 255 - 131 + 1 = 125 ticks
void timebase_init();
uint32_t timebase_now();
#endif /* TIMEBASE_H_ */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment