找回密码
 立即注册
×

00:00:00

您有一张0.1元限时体验卡,马上领取获得VIP尊享特权。

关于STC8H8K64U单片机休眠电流问题,请高手解答。

2023-4-10 17:01 来自 jnyyz 发布 @ 综合讨论

本帖最后由 jnyyz 于 2023-4-10 17:34 编辑

STC8H8K64U休眠电流不稳定,有时会是0.56uA(正常值),有时是1.7uA左右,同样的程序,同样的硬件,就是飘忽不定,这次加电好了,下次可能又成了1.7uA,差1.14uA电流始终没有找到问题点。初始化代码如下:

#define GpsPowerOn()         MGRxd=1;MGTxd=1;GpsPower=0;//FLAGGpsStart=1;                                       
#define GpsPowerOff()        GpsPower =1;MGRxd=0;MGTxd=0;//FLAGGpsStart=0;
#define Uart3On()                          IE2 |= 0x08;
#define Uart3Off()                          IE2 &= ~0x08;
#define GpsBatOn()         GpsBat=1;
#define GpsBatOff()         GpsBat=0;
#define LeanPowerOff()        SSLeanPower=0;
#define LeanPowerOn()        SSLeanPower=1;
#define LedOff() LEDKey=0;
#define LedOn()                if(FLAGSetStatus) LEDKey=0;
#define GyroPowerOff()     GyroPower=0;GyroSDA=0;GyroSCL=0;
#define GyroPowerOn()     GyroSDA=1;GyroSCL=1;GyroPower=1;
#define Int0On()                       EX0 = 1;
#define Int0Off()                       EX0 = 0;
#define FlowPowerOff()         FlowPower=1;P3M1&=~0x04;ReadFlowKey=0;P0M1&=~0x10;TestFlowSen=0;
#define FlowPowerOn()         FlowPower=0;P3M1|=0x04;ReadFlowKey=1;P0M1|=0x10;TestFlowSen=1;
#define VoicePowerOn()         VoiceCtrl=1;VoicePower=0;FlagVoiceBusy=1;//WHSecIntOn |= 0x02;
#define VoicePowerOff()         VoicePower=1;VoiceCtrl=0;FlagVoiceBusy=0;//WHSecIntOn &= ~0x02;

#define BluePowerOn()          BlueTx=1;BlueRx=1;BlueSta = 1;BluePower = 0;WHFlagBlueStatus=1;                //Ê×ÏÈ¿ªÆôÃëÖжϣ¬µ¹¼ÆÊ±60Ã룬ûÓÐÁ¬½ÓÔò¹Ø¶ÏÀ¶ÑÀ
#define BluePowerOff()        BluePower = 1;BlueTx=0;BlueRx=0;BlueSta = 0;WHFlagBlueStatus=0;               
#define UltraOn()                                P30Key=1;P31Key=1;WHFlagUltraStatus=1;
#define UltraOff()                        P30Key=0;P31Key=0;WHFlagUltraStatus=0;
#define VYL_On()                                YLPower=0;
#define VYL_Off()                                YLPower=1;
#define VTemp_On()                         TPPower=1;
#define VTemp_Off()                 TPPower=0;

sbit        VoicePower= P2^0;               
sbit        VoiceCtrl        = P0^6;                 
sbit        VGPWROn         = P4^4;               
sbit        VGPWROn2         = P4^3;               
sbit        MRxd                        = P1^0;               
sbit        MTxd                        = P1^1;         
sbit        LEDKey                = P4^5;               
sbit        YLPow

免责声明:

本平台旨在开源共享精神,请勿发布敏感信息,任何违法信息我们将移交公安机关;

QQ|手机版|小黑屋|深圳国芯人工智能有限公司 ( 粤ICP备2022108929号-2 )

GMT+8, 2025-6-7 05:05 , Processed in 0.070939 second(s), 28 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

返回顶部