EasyManua.ls Logo

STC micro STC8A8K64D4 Series - Page 204

Default Icon
901 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
STC8A8K64D4 Series Manual
-
- 188 -
delay_ms(50);
while(!INT0) delay_ms(10); //Waiting for the key to be released once more
TR0 = 0; //
󳮾󰅫󰯇
IE0 = 0; //
󰭾
0
󰷘󰖨
EX0 = 1; //INT0 Enable
IT0 = 1; //INT0
󳰞󱊐󰭾
P1n_push_pull(0xff); //com
seg
󳚹󳕤
0
P2n_push_pull(0xff);
P1 = 0;
P2 = 0;
PCON |= 0x02; //Sleep
_nop_();
_nop_();
_nop_();
LCD_SET_2M; //Display hour-minute division interval:
LCD_SET_4M; //Display minute-second division interval:
LoadRTC(); //Display time
TR0 = 1; //Open the timer
while(!INT0) delay_ms(10); //Waiting for the key to be released
delay_ms(50);
while(!INT0) delay_ms(10); //Waiting for the key to be released once more
}
}
}
}
/********************delay function**************************/
void delay_ms(u8 ms)
{
unsigned int i;
do{
i = MAIN_Fosc / 13000;
while(--i); //14T per loop
}while(--ms);
}
/********************* Timer0 interrupt function************************/
void timer0_int (void) interrupt 1
{
LCD_scan();
B_2ms = 1;
}
/********************* INT0 interrupt function *************************/
void INT0_int (void) interrupt 0
{
EX0 = 0;
IE0 = 0;
}
/****************** LCD Segment code scan function ***************************/
void LCD_scan(void) //5us @22.1184MHZ
{
u8 code T_COM[4]={0x08,0x04,0x02,0x01};
u8 j;
j = scan_index >> 1;

Table of Contents

Related product manuals