Download Print this page

STC micro STC8A8K64D4 Series Reference Manual page 268

Advertisement

STC8A8K64D4 Series Manual
sfr
P3M0
sfr
P4M1
sfr
P4M0
sfr
P5M1
sfr
P5M0
sbit
P10
void LVD_Isr() interrupt 6
{
PCON &= ~LVDF;
P10 = !P10;
}
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;
PCON &= ~LVDF;
RSTCFG = LVD3V0;
ELVD = 1;
EA = 1;
while (1);
}
Assembly code
;Operating frequency for test is 11.0592MHz
RSTCFG
DATA
ENLVR
EQU
LVD2V2
EQU
LVD2V4
EQU
LVD2V7
EQU
LVD3V0
EQU
ELVD
BIT
LVDF
EQU
P0M1
DATA
P0M0
DATA
P1M1
DATA
P1M0
DATA
P2M1
DATA
P2M0
DATA
P3M1
DATA
P3M0
DATA
P4M1
DATA
P4M0
DATA
P5M1
DATA
P5M0
DATA
=
0xb2;
=
0xb3;
=
0xb4;
=
0xc9;
=
0xca;
=
P1^0;
0FFH
40H
00H
01H
02H
03H
IE.6
20H
093H
094H
091H
092H
095H
096H
0B1H
0B2H
0B3H
0B4H
0C9H
0CAH
//Clear interrupt flag
//Test port
//Interrupt flag needs to be cleared at power-on
//Set the LVD voltage to 3.0V
//Enable LVD interrupt
;RSTCFG.6
;LVD@2.2V
;LVD@2.4V
;LVD@2.7V
;LVD@3.0V
;PCON.5
-
- 252 -

Advertisement

loading
Need help?

Need help?

Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?

This manual is also suitable for:

Micro stc8a8k64d4-64pinMicro stc8a8k64d4-48pin