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

📄 init_timer3.c.bak

📁 diPIC 系列程序
💻 BAK
字号:


#include "p33FJ256GP710.h"





void Init_timer3(void)
{
	
	T3CON = 0x0000;
	
	PR3 = 0x5FFF;
	
	IFS0bits.T3IF = 0;
	
	IPC2bits.T3IP = 6;
	
	IEC0bits.T3IE = 1;
	
	T3CON = 0x8010;
	// 1000 0000 0001 0000
	/*
	Bit15 T2O "1" start timer
	Bit14 undefine
	Bit13 0 = Continue module operation in Idle mode
	Bit12 undefine 
	Bit11 undefine
	Bit10 undefine
	Bit09 undefine
	Bit08 undefine
	Bit07 undefine
	Bit06 TGATE 0
	Bit05 0
	Bit04 1 1:8 
	Bit03 T32 1 = Timerx and Timery form a single 32-bit timer; 0 = Timerx and Timery act as two 16-bit timers
	Bit02 undefine
	Bit01 TCS: Timerx Clock Source Select bit
	Bit00 undefine
	*/
	
		
}

void __attribute__((__interrupt__)) _T3Interrupt( void )
{
//	int count;
	/* Simple I am here indicator */
//	if ( count++ == 100 ) {
		__builtin_btg( (unsigned int *)&LATA, 3 );
//		count = 0;
//	}



	/* reset Timer 3 interrupt flag */
 	IFS0bits.T3IF = 0;
}

⌨️ 快捷键说明

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