Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:examples:timer:periodic_interrupt [2015/11/13 08:54] heikopikneren:examples:timer:periodic_interrupt [2020/07/20 09:00] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Periodic interrupt ====== ====== Periodic interrupt ======
  
-//Necessary knowledge: [HW] [[en:hardware:homelab:controller]], [HW] [[en:hardware:homelab:digi]], [AVR] [[en:avr:interrupts]], [AVR] [[en:avr:timers]], [LIB] [[en:software:homelab:library:pin]], [LIB] [[en:software:homelab:library:delay]], [LIB] [[en:software:homelab:library:timer]], [PRT] [[en:examples:timer:software_delay]]//+//Necessary knowledge:  
 +[HW] [[en:hardware:homelab:digi]],   
 +[AVR] [[en:avr:interrupts]], [AVR] [[en:avr:timers]], \\ 
 +[LIB] [[en:software:homelab:library:pin]],   
 +[LIB] [[en:software:homelab:library:timer]]//
  
 ===== Theory ===== ===== Theory =====
Line 77: Line 81:
 ISR(TIMER1_CAPT_vect) ISR(TIMER1_CAPT_vect)
 { {
- // Changing the state of the green LED.+ // Changing the state of the green LED
  pin_toggle(led_green);  pin_toggle(led_green);
 } }
Line 87: Line 91:
  pin_setup_output(led_green);  pin_setup_output(led_green);
  
- // Seting the timer up in the CTC mode. + // Seting the timer up in the CTC mode
  timer1_init_ctc(  timer1_init_ctc(
  TIMER1_PRESCALE_1024,  TIMER1_PRESCALE_1024,
Line 97: Line 101:
  timer1_set_input_capture_value(14400);  timer1_set_input_capture_value(14400);
  
- // Allowing interruption of achieving the value.+ // Allowing interruption of achieving the value
  timer1_input_capture_interrupt_enable(true);  timer1_input_capture_interrupt_enable(true);
  
- // Allowing global interruption.+ // Allowing global interruption
  sei();  sei();
  
- // Endless loop.+ // Endless loop
  while (1){ }  while (1){ }
 } }
en/examples/timer/periodic_interrupt.1447404845.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0