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

📄 time_interrupt.c

📁 h8/3649f芯片内部时钟中断
💻 C
字号:
#include <machine.h>                  
#include "iodefine.h"


#ifdef __cplusplus
extern "C" {
#endif
void abort(void);
#ifdef __cplusplus
}
#endif

#define BRINK_INTERVAL 305

#pragma interrupt(int_TimerA)
void int_TimerA(void);

#pragma section V1

void(*const VEC_TBL1[])(void)={
	int_TimerA
};

#pragma section

unsigned int TimerA_tick=0;
	
void main(void)
{
	set_imask_ccr(1);
	IO.PCR8=0xff;
	IO.PDR8.BIT.B0=1;
	IO.PDR8.BIT.B1=0;
	
	TA.TMA.BIT.CKSI=0x05;
	IENR1.BIT.IENTA=1;
	set_imask_ccr(0);
	while(1);
}


void abort(void)
{

}



void int_TimerA(void){
	//IRR1.BIT.IRRTA=0;
	if(TimerA_tick<305){
		TimerA_tick++;
	}else{
		TimerA_tick=0;
		IO.PDR8.BIT.B0=0;
		IO.PDR8.BIT.B1=1;
	}
}

⌨️ 快捷键说明

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