Download Print this page

STC micro STC8A8K64D4 Series Reference Manual page 90

Advertisement

STC8A8K64D4 Series Manual
#define
LVD2V4
#define
LVD2V7
#define
LVD3V0
sbit
ELVD
#define
LVDF
sbit
P32
sfr
P0M1
sfr
P0M0
sfr
P1M1
sfr
P1M0
sfr
P2M1
sfr
P2M0
sfr
P3M1
sfr
P3M0
sfr
P4M1
sfr
P4M0
sfr
P5M1
sfr
P5M0
void Lvd_Isr() interrupt 6
{
PCON &= ~LVDF;
P32 = ~P32;
}
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 = ENLVR | LVD3V0;
RSTCFG = LVD3V0;
ELVD = 1;
EA = 1;
while (1);
}
Assembly code
; Operating frequency for test is 11.0592MHz
RSTCFG
DATA
ENLVR
EQU
LVD2V0
EQU
LVD2V4
EQU
LVD2V7
EQU
LVD3V0
EQU
0x01
0x02
0x03
=
IE^6;
0x20
=
P3^2;
=
0x93;
=
0x94;
=
0x91;
=
0x92;
=
0x95;
=
0x96;
=
0xb1;
=
0xb2;
=
0xb3;
=
0xb4;
=
0xc9;
=
0xca;
0FFH
40H
00H
01H
02H
03H
//LVD@2.4V
//LVD@2.7V
//LVD@3.0V
//PCON.5
//Clear interrupt flag
//Test port
//Test port
//Low voltage reset when 3.0V is enabled, no LVD interrupt is generated
//Low voltage interrupt when 3.0V is enabled
//Enable LVD interrupt
;RSTCFG.6
;LVD@2.0V
;LVD@2.4V
;LVD@2.7V
;LVD@3.0V
-
- 74 -

Advertisement

loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Micro stc8a8k64d4-64pinMicro stc8a8k64d4-48pin