8H8K64U实测掉电模式0.7μA左右(有零点零几μA的固定电流应该是热电势产生的)
实测视频:
LED闪烁5次后进入PD状态
- #include <AI8H.H>
- #include <intrins.h>
-
- #define FOSC 24000000UL //主时钟
-
- void Delay_ms(unsigned char ms)
- {
- unsigned int i;
- do
- {
- i=FOSC/10000;
- while(--i); //10T per loop
- }
- while(--ms);
- }
-
- void Init(void)
- {
- P_SW2|=EAXFR;
-
- P0M1=0x00; P0M0=0x00; //设置为准双向口
- P1M1=0x00; P1M0=0x00; //设置为准双向口
- P2M1=0x00; P2M0=0x00; //设置为准双向口
- P3M1=0x00; P3M0=0x00; //设置为准双向口
- P4M1=0x00; P4M0=0x00; //设置为准双向口
- P5M1=0x00; P5M0=0x00; //设置为准双向口
- P6M1=0x00; P6M0=0x00; //设置为准双向口
- P7M1=0x00; P7M0=0x00; //设置为准双向口
- }
-
- void main(void)
- {
- Init();
- P32=!P32;
- Delay_ms(250);
- Delay_ms(250);
- P32=!P32;
- Delay_ms(250);
- Delay_ms(250);
- P32=!P32;
- Delay_ms(250);
- Delay_ms(250);
- P32=!P32;
- Delay_ms(250);
- Delay_ms(250);
- P32=!P32;
- Delay_ms(250);
- Delay_ms(250);
- P32=!P32;
- Delay_ms(250);
- Delay_ms(250);
- P32=!P32;
- Delay_ms(250);
- Delay_ms(250);
- P32=!P32;
- Delay_ms(250);
- Delay_ms(250);
- P32=!P32;
- Delay_ms(250);
- Delay_ms(250);
- P32=!P32;
- Delay_ms(250);
- Delay_ms(250);
- PCON|=0x02;
- while(1)
- {
-
- }
- }
复制代码
|