AVR microcontroller timer T0 basic interrupt using ICCAVR

Publisher:hfy13567003617Latest update time:2016-10-23 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

#include 
void main(void)
{
  TCNT0=0x83;
  TCCR0=0x07;
  TIMSK=0x01;
  SEI();
  DDRC=0xff;
  PORTC=0;
  OCR0=0X00;
  while(1);
}
#pragma interrupt_handler Timer0:iv_TIMER0_OVF
void Timer0()
{
    TCNT0=0x83;
 PORTC=~PORTC;
}

The conclusion is: don't count on coincidence.
Reference address:AVR microcontroller timer T0 basic interrupt using ICCAVR

Previous article:AVR MCU ADC Experiment
Next article:AVR interrupt transceiver program atemga128A

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号