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

📄 ticpd.c

📁 aduc831精典源代码,适合初学者学习
💻 C
字号:
//********************************************************************
//
// Author        : ADI - Apps            www.analog.com/MicroConverter
//
// Date          : April 2002
//
// File          : TIC.c
//
// Hardware      : ADuC831
//
// Description   : Demonstrates the use of the Time Interval Counter to
//			       Wake Up the MicroConverter. The Time Interval Counter
//				   is set up to wake up the part after 10 seconds and toggle
//				   the L.E.D. on the evaluation board (P3.4). The part is 
//				   then placed back in power down for another 10 seconds						 	
//********************************************************************

#include <stdio.h> 
#include <ADuC831.h>

sbit LED = 0x0B4;

void TIC_int () interrupt 10
{
 	LED ^= 1;
 	TIMECON = 0x13;		// clear TII bit
}

void main (void)
{

//Configure Time Interval Counter  
   TIMECON = 0x13; 	// configure the Time Interval Counter to count seconds
   INTVAL = 0x0A;    // 10 seconds

//Configure External Interrupt
	IEIP2 = 0xA4;   // enable TIC interrupt
    EA = 1;			// enable interrupts

	while (1)
	{
	PCON = 0x22;	// power down mode
	}
}

⌨️ 快捷键说明

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