⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tc.c

📁 在atmega128中实现中断
💻 C
字号:
#include<iom128v.h>
#include<macros.h>
unsigned char uc_Led;
#pragma interrupt_handler timer0_OVF:17
void timer0_OVF(void)
{
 PORTB=uc_Led;
 OCR1AH=0x00;
 OCR1AL=0xC3;
 uc_Led++;
 if(uc_Led==255)
 uc_Led=0;
}

void main(void)
{
 DDRB=0xff;
 SREG=0x80;
 TIMSK=0x03; 
 OCR1AH=0x00;
 OCR1AL=0xC3;
 TCCR0=0x2F;
 uc_Led=0;
 while(1);
}
 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -