Skip to content

Instantly share code, notes, and snippets.

@komponenrobot
Created May 24, 2019 13:42
Show Gist options
  • Save komponenrobot/eb6cf3b8843fd9ca743723c3de2290ae to your computer and use it in GitHub Desktop.
Save komponenrobot/eb6cf3b8843fd9ca743723c3de2290ae to your computer and use it in GitHub Desktop.
Timer_cvavr
// Timer 0 overflow interrupt service routine
interrupt [TIM0_OVF] void timer0_ovf_isr(void)
{
// Place your code here
TCNT0=0x64;
}
dan
// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: 15,625 kHz
// Mode: Normal top=0xFF
// OC0A output: Disconnected
// OC0B output: Disconnected
// Timer Period: 16,384 ms
TCCR0A=(0<<COM0A1) | (0<<COM0A0) | (0<<COM0B1) | (0<<COM0B0) | (0<<WGM01) | (0<<WGM00);
TCCR0B=(0<<WGM02) | (1<<CS02) | (0<<CS01) | (1<<CS00);
TCNT0=0x64;
OCR0A=0x00;
OCR0B=0x00;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment