//程序电源
#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long
#define uDelay() _nop_();_nop_();_nop_();_nop_();_nop_()
#include "stc12c2052ad.h"
#include "intrins.h"
const uchar Hidden=0x10;
uchar code
DispTab[]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x7,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x7
1,0x0};
// 0 1 2 3 4 5 6 7 8 9 A B
C D E F hidden
uchar code BitTab[]={0xdf,0xfb,0xfd,0xfe};
const uchar Led1=0x01; //P1.0
const uchar Led2=0x02; //P1.1
const uchar Led3=0x04; //P1.2
const uchar Led4=0x08; //P1.3
uchar OutCnt=0xff; //如果该变量为 0,则输出禁止
uchar fastChg=0; //快速改变输出电压
bit bLed1,bLed2,bLed3,bLed4;
#define IspIapByteRead 1 //字节读
#define IspIapBytePrg 2
#define IspIapSecErase 3
#define WAIT_TIME 5
uint Vv=100; //电压设置值
uchar DispBuf[3];
sbit PwmOut= P3^7; /*Pwm 输出引脚*/
unsigned int Tmr0H; //用于 PwmOut 输出为高时的定时时间常数
unsigned int Tmr0L; //用于 PwmOut 输出为低时的定时时间常数
unsigned char Tmr0HH; //用于 PwmOut 输出为高时定时常数的高 8 位
unsigned char Tmr0HL; //用于 PwmOut 输出为高时定时常数的低 8 位
unsigned char Tmr0LH; //用于 PwmOut 输出为低时定时常数的高 8 位
unsigned char Tmr0LL; //用于 PwmOut 输出为低时定时常数的低 8 位
const uint PwmZs=20000; //Pwm 的总数