?? ticpd.c
字號:
//********************************************************************
//
// Author : ADI - Apps www.analog.com/MicroConverter
//
// Date : October 2003
//
// File : TIC.c
//
// Hardware : ADuC842
//
// 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 <ADuC842.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 + -