?? ticlength.c
字號:
//********************************************************************
//
// Author : ADI - Apps www.analog.com/MicroConverter
//
// Date : October 2003
//
// File : ticlength.c
//
// Hardware : ADuC842/ADuC843
//
// Description : Demonstrates the use of the Time Interval Counter to
// count an interval of 96 hours
// A message is displayed constantly on the hyperterminal window
// after the time has elapsed.
// Note: This code can be chaged to 96second period by
// setting Timecon=0x01B; to show its use
//********************************************************************
#include <stdio.h>
#include <ADuC842.h>
sbit LED = 0x0B4;
void TIC_int () interrupt 10
{
TIMECON=0x00;
LED ^= 1;
}
void main (void)
{
//Configure the baud rate 9600
T3CON = 0x83;
T3FD = 0x2D;
SCON = 0x52;
//Configure Time Interval Counter
TIMECON = 0x3B; // configure the Time Interval Counter to count a single period in hours
//set to 0x01B to time 96 seconds
INTVAL = 0x60; // 96 hours
//Configure External Interrupt
IEIP2 = 0xA4; // enable TIC interrupt
EA = 1; // enable interrupts
PCON = 0x22; // enterpowerdown
while (1)
{
printf("96 Hour Have Elapsed\n");
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -