STC8A8K64D4 Series Manual
P0M0 = 0x00;
P0M1 = 0x00;
P1M0 = 0x00;
P1M1 = 0x00;
P2M0 = 0x00;
P2M1 = 0x00;
P3M0 = 0x00;
P3M1 = 0x00;
P4M0 = 0x00;
P4M1 = 0x00;
P5M0 = 0x00;
P5M1 = 0x00;
P_SW2 = 0x00;
//
P_SW2 = 0x10;
//
P_SW2 = 0x30;
P_SW2 |= 0x80;
I2CCFG = 0x80;
I2CSLCR = 0x40;
EA = 1;
PCON = 0x02;
routine after power-down wake-up
_nop_();
_nop_();
_nop_();
_nop_();
while (1)
{
P11 = ~P11;
}
}
Assembly code
; Operating frequency for test is 11.0592MHz
P_SW2
DATA
I2CCFG
XDATA
I2CSLCR
XDATA
I2CSLST
XDATA
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
0BAH
0FE80H
0FE83H
0FE84H
093H
094H
091H
092H
095H
096H
0B1H
0B2H
0B3H
0B4H
0C9H
0CAH
0000H
MAIN
00C3H
I2CISR
//Wake up MCU on the falling edge of SDA/P1.4
//Wake up MCU on the falling edge of SDA_2/P2.4
//Wake up MCU on the falling edge of SDA_4/P3.3
//Enable slave mode of I2C module
//Enable start signal interrupt
//MCU enters power-down mode, it will not enter the interrupt service
-
- 89 -
Need help?
Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?
Questions and answers