STC8A8K64D4 Series Manual
P1 = TH0;
}
void main()
{
P0M0 = 0x00;
P0M1 = 0x00;
P1M0 = 0x00;
P1M1 = 0x00;
P2M0 = 0x00;
P2M1 = 0x00;
P3M0 = 0x00;
P3M1 = 0x00;
P4M0 = 0x00;
P4M1 = 0x00;
P5M0 = 0x00;
P5M1 = 0x00;
AUXR = 0x80;
TMOD = 0x08;
TL0 = 0x00;
TH0 = 0x00;
while (INT0);
TR0 = 1;
IT0 = 1;
EX0 = 1;
EA = 1;
while (1);
}
Assembly code
;Operating frequency for test is 11.0592MHz
AUXR
DATA
P0M1
DATA
P0M0
DATA
P1M1
DATA
P1M0
DATA
P2M1
DATA
P2M0
DATA
P3M1
DATA
P3M0
DATA
P4M1
DATA
P4M0
DATA
P5M1
DATA
P5M0
DATA
ORG
LJMP
ORG
LJMP
ORG
INT0ISR:
MOV
MOV
8EH
093H
094H
091H
092H
095H
096H
0B1H
0B2H
0B3H
0B4H
0C9H
0CAH
0000H
MAIN
0003H
INT0ISR
0100H
P0,TL0
P1,TH0
//TH0 is the high byte of the measured value
//1T mode
//Enable GATE, and enable timing when INT0 is 1
//Wait for INT0 to be low
//Start timer
//Enable INT0 falling edge interrupt
;TL0 is the low byte of the measured value
;TH0 is the high byte of the measured value
- 305 -
Need help?
Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?