-
为什么数码管显示小时的有一位不亮
#include"stc15.h"#include"intrins.h"#include"ds1302.h"unsignedcharcodewrite[7]={0x80,0x82,0x84,0x86,0x88,0x8A,0x8C};unsignedcharcoderead[7]={0x81,0x83,0x85,0x87,0x89,0x8B,0x8D};unsignedcharnowtime[7]={0x00,0x07,0x17,0x12,0x10,0x04,0x23};unsignedchartime[8];unsignedcharcodeSMG_NoDot[18]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x80,0xc6,0xc0,0x86,0x8e,0xbf,0x7f};voidselevcehc573(unsignedcharchannel){switch(channel){case4:P2=(P2&0x1f)|0x80;break;case5:P2=(P2&0x1f)|0xa0;break;case6:P2=(P2&0x1f)|0xc0;break;case7:P2=(P2&0x1f)|0xe0;break;}}voidTimer0_Init(void)//1毫秒@12.000MHz{AUXR&=0x7F;//定时器时钟12T模式TMOD&=0xF0;//设置定时器模式TL0=0x18;//设置定时初始值TH0=0xFC;//设置定时初始值TF0=0;//清除TF0标志TR0=1;//定时器0开始计时ET0=1;//使能定时器0中断EA=1;}voidwriteds1302(){unsignedchari;Write_Ds1302_Byte(0x8e,0x00);for(i=0;i
2023-10-18 4 -
为什么数码管显示小时的有一位不亮
#include"stc15.h"#include"intrins.h"#include"ds1302.h"unsignedcharcodewrite[7]={0x80,0x82,0x84,0x86,0x88,0x8A,0x8C};unsignedcharcoderead[7]={0x81,0x83,0x85,0x87,0x89,0x8B,0x8D};unsignedcharnowtime[7]={0x00,0x07,0x17,0x12,0x10,0x04,0x23};unsignedchartime[8];unsignedcharcodeSMG_NoDot[18]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0x88,0x80,0xc6,0xc0,0x86,0x8e,0xbf,0x7f};voidselevcehc573(unsignedcharchannel){switch(channel){case4:P2=(P2&0x1f)|0x80;break;case5:P2=(P2&0x1f)|0xa0;break;case6:P2=(P2&0x1f)|0xc0;break;case7:P2=(P2&0x1f)|0xe0;break;}}voidTimer0_Init(void)//1毫秒@12.000MHz{AUXR&=0x7F;//定时器时钟12T模式TMOD&=0xF0;//设置定时器模式TL0=0x18;//设置定时初始值TH0=0xFC;//设置定时初始值TF0=0;//清除TF0标志TR0=1;//定时器0开始计时ET0=1;//使能定时器0中断EA=1;}voidwriteds1302(){unsignedchari;Write_Ds1302_Byte(0x8e,0x00);for(i=0;i
2023-10-14 0