标题:
使用STC15单片机驱动LCD12864显示熄屏的问题
[打印本页]
作者:
feelings
时间:
2021-4-30 14:41
标题:
使用STC15单片机驱动LCD12864显示熄屏的问题
LCD总是会显示一段时间后就不显示了,就是显示屏像处于熄屏状态,每次显示到熄灭的时间长度都不一样,我测试过,程序没有卡死,显示屏的供电也没有问题,请问是什么问题
单片机源程序如下:
/*---------------------------------------------------------------------*/
/* --- STC MCU International Limited ----------------------------------*/
/* --- STC 1T Series MCU Demo Programme -------------------------------*/
/* 如果要在程序中使用此代码,请在程序中注明使用了宏晶科技的资料及程序 */
/*---------------------------------------------------------------------*/
/************* 本程序功能说明 **************
******************************************/
#define MAIN_Fosc 24000000UL //定义主时钟 22118400UL
#define LcmXPixel 128 //横向宽度
#define LcmYPixel 64 //纵向高度
#define MIN(A,B) ((A)<(B)?(A):(B))
#define Uchar unsigned char
#define Uint unsigned int
#define Timer0_Reload (MAIN_Fosc / 1000) //Timer 0 中断频率, 1000次/秒
//DS1302地址定义
#define ds1302_sec_add 0x80 //秒数据地址
#define ds1302_min_add 0x82 //分数据地址
#define ds1302_hr_add 0x84 //时数据地址
#define ds1302_date_add 0x86 //日数据地址
#define ds1302_month_add 0x88 //月数据地址
#define ds1302_day_add 0x8a //星期数据地址
#define ds1302_year_add 0x8c //年数据地址
#define ds1302_control_add 0x8e //控制数据地址
#define ds1302_charger_add 0x90
#define ds1302_clkburst_add 0xbe
#include <intrins.h>
#include "STC15Fxxxx.H"
///
///
/************* IO口定义 **************/
sbit CS = P3^6; //片选
sbit SID = P3^4; //数据
sbit SCK = P3^2; //Clock 信号
sbit RS = P3^3; //数据指令选择
sbit Key = P3^4; //测试架锁定按键(测试架专用)
sbit RES = P3^5; //测试架复位是板载 RC 复位,可以不需要 IO 口操作
sbit turn_counter = P4^2; //电机转圈计数脚
//DS1302引脚定义
sbit RST=P0^0;
sbit IO=P0^1;
sbit DS_SCK=P0^2;
Uchar code ASCIIchardot[];
Uchar code bmp1[];
Uchar code bmp2[];
Uchar code bmp3[];
Uchar code ComTable[]={3,2,1,0,7,6,5,4,};
Uchar second_high;
Uchar second_low;
u8 cnt=0; //按键延时计时
//
u8 display_index; //显示位索引
bit B_1ms; //1ms标志
u8 Tday,Thour,Tminute,Tsecond; //RTC变量
u16 Tmsecond;
u32 Tset; u32 Tuse; u32 Tleft;
u32 Tlockm;
int mark=0;
int ds1302_second=0;
//DS1302
Uchar dis_time_buf[16]={0};
Uchar time_buf[8] ={0x20,0x21,0x04,0x02,0x09,0x00,0x00,0x05};//初始时间2021年4月02号09点00分00秒 星期五
Uint t;
Uint motor_turn=0; //电机转动圈数
Uint counter1, counter2;//电机转动计数1、计数2
Uint interrupt_counter=0;//中断计数
Uint interrupt_counter1=1;
/**************** 外部函数声明和外部变量声明 *****************/
//串口模式下只能写不能读,也不能查忙,因此用户要控制好速度不要太快
void WriteCommand( Uchar CommandByte )
{
Uchar i;
CS=0;
RS=0; //Command
for(i=0;i<8;i++)
{ SCK=1;
SID=( (CommandByte>>(7-i)) &0x01);
SCK=0;
_nop_();
SCK=1;
}
}
void WriteData( Uchar DataByte )
{
Uchar i;
CS=0;
RS=1; //Data
for(i=0;i<8;i++)
{
SCK=1;
SID=( (DataByte>>(7-i)) &0x01);
SCK=0;
_nop_();
SCK=1;
}
}
void DelayMS(unsigned int MS)
{
unsigned char us,usn;
while(MS!=0)
{
usn = 2; //for 12M
while(usn!=0)
{
us=0xf6;
while (us!=0){us--;};
usn--;
}
MS--;
}
}
void LcmClear( Uchar FillData )
{
Uint i,j;
for(i=0;i<8;i++)
{
WriteCommand(0xB0|ComTable[i]); //Set Page Address
WriteCommand(0x10); //Set Column Address = 0
WriteCommand(0x01); //Colum from S1 -> S128 auto add
for(j=0;j<128;j++)
{
WriteData( FillData );
}
}
}
void LcmInit( void )
{
WriteCommand(0xAE); //Display OFF
WriteCommand(0xA2); //1/64 Duty 1/9 Bias
WriteCommand(0xA0); //ADC select S0->S131(玻璃设计用 S1-S128)
WriteCommand(0xC0); //com1 --> com64
WriteCommand(0x24); //对某些模块没用,用的外部 Rb/Ra
WriteCommand(0x81); //Sets V0
WriteCommand(48); //内部电位器调节对比度
WriteCommand(0x2F); //voltage follower ON regulator ON booster ON
WriteCommand(0xA6); //Normal Display (not reverse dispplay)
WriteCommand(0xA4); //Entire Display Disable
WriteCommand(0x40); //Set Display Start Line = com0
WriteCommand(0xB0); //Set Page Address = 0
WriteCommand(0x10); //Set Column Address 4 higher bits = 0
WriteCommand(0x01); //Set Column Address 4 lower bits = 1 , from IC SEG1 -> SEG128
LcmClear(0);
WriteCommand(0xAF); //Display ON
}
//显示 ASICC 字符的函数
void LcmPutChar(Uchar col,Uchar page,Uchar Order)
{
Uchar i;
Uint x;
x = (Order-0x20)*0x10; //ASICC 字符从 0x20 开始,每个 16 byte
WriteCommand(ComTable[page&0x07]|0xB0); //Set Page Address
WriteCommand( ((col+1)>>4) | 0x10); //Set Column Address High Byte
WriteCommand( (col+1)&0x0F ); //Low Byte Colum from S128 -> S1 auto add
for(i=0;i<8;i++)
{
WriteData( ASCIIchardot[x] );
x++;
}
page++; //下半字符 page+1
WriteCommand(ComTable[page&0x07]|0xB0); //Set Page Address
WriteCommand( ((col+1)>>4) | 0x10); //Set Column Address High Byte
WriteCommand( (col+1)&0x0F ); //Low Byte Colum from S128 -> S1 auto add
for(i=0;i<8;i++)
{
WriteData( ASCIIchardot[x] );
x++;
}
page--; //写完一个字符 page 还原
}
//显示字符串的函数
void LcmPutStr(Uchar col,Uchar page,Uchar *puts)
{
while(*puts != '\0') //判断字符串时候显示完毕
{
if(col>(LcmXPixel-8)) //判断行末空间是否足够放一个字符,自动换行
{
page=page+2;
col=0;
}
if(page>(LcmYPixel/8-2)) //到了屏幕最下角,自动返回左上角
{
page=0;
col=0;
}
LcmPutChar(col,page+4,*puts);
puts++;
col=col+8; //下一个字符 8 列之后
}
}
//显示 3 位数的数值(0-999)
void LcmPutNum(Uchar col,Uchar page,u16 Num)
{
Uchar a,b,c;
a=Num/100;
b=(Num%100)/10;
c=Num%10;
if(a==0) //也不写空格,直接跳过去
LcmPutChar(col,page,0x20);
else LcmPutChar(col,page+4,a+0x30);
if(a==0 && b==0) //也不写空格,直接跳过?
LcmPutChar(col,page,0x20);
else LcmPutChar(col+8,page+4,b+0x30);
LcmPutChar(col+16,page+4,c+0x30);
}
/********************** RTC演示函数 ************************/
void RTC(void) //一轮计数后59到01,没能刷新十位,应该为01,
{
if(++Tsecond >=60)
{
LcmClear(0);
Tsecond = 0;Tlockm++;
if(++Tminute >= 60)
{
LcmClear(0);
Tminute = 0;
if(++Thour >= 24)
{
LcmClear(0);
Thour = 0;
Tday++;
}
}
}
}
/*单字节写入一字节数据*/
//向DS1302写入一字节数据
void ds1302_write_byte(Uchar addr, Uchar d)
{
Uchar i;
RST=1; //启动DS1302总线
//写入目标地址:addr
addr = addr & 0xFE; //最低位置零,寄存器0位为0时写,为1时读
for (i = 0; i < 8; i ++)
{
if (addr & 0x01) {
IO=1;
}
else {
IO=0;
}
DS_SCK=1; //产生时钟
DS_SCK=0;
addr = addr >> 1;
}
//写入数据:d
for (i = 0; i < 8; i ++) {
if (d & 0x01) {
IO=1;
}
else {
IO=0;
}
DS_SCK=1; //产生时钟
DS_SCK=0;
d = d >> 1;
}
RST=0; //停止DS1302总线
}
//从DS1302读出一字节数据
Uchar ds1302_read_byte(Uchar addr)
{
Uchar i,temp;
RST=1; //启动DS1302总线
//写入目标地址:addr
addr = addr | 0x01; //最低位置高,寄存器0位为0时写,为1时读
for (i = 0; i < 8; i ++) {
if (addr & 0x01) {
IO=1;
}
else {
IO=0;
}
DS_SCK=1;
DS_SCK=0;
addr = addr >> 1;
}
//输出数据:temp
for (i = 0; i < 8; i ++) {
temp = temp >> 1;
if (IO) {
temp |= 0x80;
}
else {
temp &= 0x7F;
}
DS_SCK=1;
DS_SCK=0;
}
RST=0; //停止DS1302总线
return temp;
}
//向DS302写入时钟数据
void ds1302_write_time(void)
{
ds1302_write_byte(ds1302_control_add,0x00); //关闭写保护
ds1302_write_byte(ds1302_sec_add,0x80); //暂停时钟
//ds1302_write_byte(ds1302_charger_add,0xa9); //涓流充电
ds1302_write_byte(ds1302_year_add,time_buf[1]); //年
ds1302_write_byte(ds1302_month_add,time_buf[2]); //月
ds1302_write_byte(ds1302_date_add,time_buf[3]); //日
ds1302_write_byte(ds1302_hr_add,time_buf[4]); //时
ds1302_write_byte(ds1302_min_add,time_buf[5]); //分
ds1302_write_byte(ds1302_sec_add,time_buf[6]); //秒
ds1302_write_byte(ds1302_day_add,time_buf[7]); //周
ds1302_write_byte(ds1302_control_add,0x80); //打开写保护
}
//从DS302读出时钟数据
void ds1302_read_time(void)
{
time_buf[1]=ds1302_read_byte(ds1302_year_add); //年
time_buf[2]=ds1302_read_byte(ds1302_month_add); //月
time_buf[3]=ds1302_read_byte(ds1302_date_add); //日
time_buf[4]=ds1302_read_byte(ds1302_hr_add); //时
time_buf[5]=ds1302_read_byte(ds1302_min_add); //分
time_buf[6]=(ds1302_read_byte(ds1302_sec_add))&0x7f;//秒,屏蔽秒的第7位,避免超出59
time_buf[7]=ds1302_read_byte(ds1302_day_add); //周
}
//DS1302初始化函数
void ds1302_init(void)
{
RST=0; //RST脚置低
DS_SCK=0; //SCK脚置低
RST=1; //RST脚置高
ds1302_write_byte(0x8e, 0);
RST=0; //RST脚置低
}
void main( void )
{
//button
Uchar b0click=0; Uchar b0cflag=0; Uchar B0PressOnce=0;
Uchar b1click=0; Uchar b1cflag=0; Uchar B1PressOnce=0;
Uchar b2click=0; Uchar b2cflag=0; Uchar B2PressOnce=0;
Uchar b3click=0; Uchar b3cflag=0; Uchar B3PressOnce=0;
Uchar b4click=0; Uchar b4cflag=0; Uchar B4PressOnce=0;
Uchar b5click=0; Uchar b5cflag=0; Uchar B5PressOnce=0;
Uchar b6click=0; Uchar b6cflag=0; Uchar B6PressOnce=0;
Uchar LTclick=0; Uchar LTcflag=0; Uchar LTPressOnce=0;
//
//page1`
Uchar pagenum=88; Uchar secodein=191; Uchar select=1;
Uchar secode1=0; Uchar secode2=0; Uchar secode3=0;
//
//page2
Uchar select_2=1;
//
//page4
Uchar select_4=1;Uchar secode1_4=5; Uchar secode2_4=0;Uchar secode3_4=0; u16 VTBI=500; // Uchar secode4_4=0;
//page41
Uchar seday_4=2;
//
//page5
Uchar select_5=1;
//
//page6
Uchar Bolusvol=15;Uchar BolusTime=1;Uchar select_6=1;
//
//page8
Uchar Demandvol=15; Uchar LockoutTime=15;Uchar select_8=1; Uchar secode1_8=0; Uchar secode2_8=1; Uchar secode3_8=5;
//
//page10
Uchar select_10=1;
//
//page11
Uchar seday_10=1;
//
//page21
u16 delaytime=0; u16 VINF=0; u16 lockouttime=0; u16 runtime=0; u16 infcount=0; u32 lightcount=0; u32 bolushandcount=0;
//
//start
Uchar confirmflag=0; Uchar startcount=0;
//
//run
Uchar run=0; Uchar beep=0; u16 bolusrun=0; u16 bolustime=0; Uchar bolusflag=0; Uchar lockflag=0; Uchar stateflag=0; Uchar onoffflag=1;
Uchar onoffstate=1;
//
//light switch
Uchar lighton=0;
//
Uchar contrast=30; //对比度=48(根据我们常用的外部电阻参数来的)
DelayMS(10);
RES = 0;
DelayMS(200);
RES = 1;
DelayMS(50);
LcmInit();
//*********************ds1302实时时钟初始化***************************
ds1302_init();
ds1302_write_time(); //写入初始值
//********************************************************************
P0M1 = 0; P0M0 = 0; //设置为准双向口
P1M1 = 0; P1M0 = 0; //设置为准双向口
P2M1 = 0; P2M0 = 0; //设置为准双向口
P3M1 = 0; P3M0 = 0; //设置为准双向口
P4M1 = 0; P4M0 = 0; //设置为准双向口
P5M1 = 0; P5M0 = 0; //设置为准双向口
P6M1 = 0; P6M0 = 0; //设置为准双向口
P7M1 = 0; P7M0 = 0; //设置为准双向口
//*********************************中断3用于触发开关机************
INT_CLKO |= 0x20; //使能外部中断3下降沿中断
//****************************************************************
display_index = 0;
AUXR |= 0x80; //Timer0 set as 1T, 16 bits timer auto-reload,
TMOD &= 0xF0; //设置定时器模式
TL0 = 0x00;// TH0 = (u8)(Timer0_Reload / 256);
TH0 = 0xDC;// TL0 = (u8)(Timer0_Reload % 256);
ET0 = 1; //Timer0 interrupt enable
TR0 = 1; //Timer0 run
EA = 1; //打开总中断
TF0 = 0;
Thour = 0; //初始化时间值
Tminute = 0;
Tsecond = 0;
Tday= 0;
Tset= 0;
Tuse= 0;
Tleft= 0;
//
while(1)
{
// if(B_1ms){B_1ms = 0;if(++Tmsecond >= 75){Tmsecond = 0;RTC();}}//1秒到 250-255 254
if(P27==0){b0click=1;}else{b0click=0;b0cflag=0;} if(b0click==1&&b0cflag==0){b0cflag=1;B0PressOnce=1;} //b6 27
if(P24==0){b1click=1;}else{b1click=0;b1cflag=0;} if(b1click==1&&b1cflag==0){b1cflag=1;B1PressOnce=1;beep=0;} //up 22
if(P23==0){b2click=1;}else{b2click=0;b2cflag=0;} if(b2click==1&&b2cflag==0){b2cflag=1;B2PressOnce=1;beep=1;} //down 23
if(P22==0){b3click=1;}else{b3click=0;b3cflag=0;} if(b3click==1&&b3cflag==0){b3cflag=1;B3PressOnce=1;} //add 24
if(P25==0){b4click=1;}else{b4click=0;b4cflag=0;} if(b4click==1&&b4cflag==0){b4cflag=1;B4PressOnce=1;} //select 25
if(P26==0){b5click=1;}else{b5click=0;b5cflag=0;} if(b5click==1&&b5cflag==0){b5cflag=1;B5PressOnce=1;} //start/stop 26
// if(P27==0){b6click=1;}else{b6click=0;b6cflag=0;} if(b6click==1&&b6cflag==0){b6cflag=1;B1PressOnce=1;} //out bolus btn
if(B0PressOnce==1){B0PressOnce=0;if(onoffflag==0){onoffflag=1;}else{onoffflag=0;}}
if(onoffflag==1)
{if(onoffstate==0){onoffstate=1;contrast=30;}//kaiji
}else
{if(onoffstate==1){onoffstate=0;contrast=0;}//guanji
}
if(counter1==1){LTclick=1;}else{LTclick=0;LTcflag=0;} if(LTclick==1&<cflag==0){LTcflag=1;LTPressOnce=1;}//lighton替换为counter1
if(beep==0) {P16=1;} else{P16=0;}
if(run==0) {P17=1;} else{P17=0;}
if(bolusrun==0) {P17=1;} else{P17=0;}
// if(P14==0){counter1=0;}else{counter1=1;}//lighton替换为counter1
// if(lightcount<infcount*Bolusvol+bolushandcount*Demandvol){P17=0;}else{P17=1;}
VINF=infcount*Bolusvol+bolushandcount*Demandvol;
if(motor_turn<170){P17=0;}else{P17=1;}
WriteCommand(0x81); //Sets V0
WriteCommand(contrast); //恢复对比度
if(pagenum==88)
{ LcmClear(0x00);
if(B1PressOnce==1){LcmPutStr(0,0,"1");run=1;}
if(B2PressOnce==1){LcmPutStr(50,0,"2");run=0;}
if(B3PressOnce==1){LcmPutStr(0,2,"3");}
if(B4PressOnce==1){LcmPutStr(50,2,"4");}
if(B5PressOnce==1){LcmPutStr(0,4,"5");}
if(lightcount<=20){run=0;}
LcmPutNum(100,6,motor_turn);
}
if(pagenum==1)
{
LcmPutStr(0,0,"Security Code");
LcmPutNum(10,3,secode1);
LcmPutNum(30,3,secode2);
LcmPutNum(50,3,secode3);
//
if(select==1){LcmPutStr(27,5,"^ ");}
if(select==2){LcmPutStr(23,5," ^ ");}
if(select==3){LcmPutStr(26,5," ^ ");}
if(B2PressOnce==1)
{
B2PressOnce=0;
if(select==1){if(secode1<9){secode1++; }else{secode1=0;}}
if(select==2){if(secode2<9){secode2++; }else{secode2=0;}}
if(select==3){if(secode3<9){secode3++; }else{secode3=0;}}
}
if(B3PressOnce==1)
{
B3PressOnce=0;
if(select==1) {select=2;}
else if(select==2){select=3;}
else if(select==3){select=1;}
}
if(B4PressOnce==1)
{
B4PressOnce=0;
if(secode1==1&&secode2==9&&secode3==1)
{
LcmPutStr(10,5,"Code Right");
DelayMS(20000);
pagenum=2;
LcmClear(0x00);
}
else
{
LcmPutStr(10,5,"Code Worror");
DelayMS(20000);
LcmPutStr(10,5," ");
}
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==2)
{
LcmPutStr(0,0,"New Patient?");
LcmPutStr(25,2,"YES");
LcmPutStr(25,4,"NO");
if(select_2==1){LcmPutStr(5,2,">");LcmPutStr(5,4," ");}
if(select_2==2){LcmPutStr(5,4,">");LcmPutStr(5,2," ");}
if(B3PressOnce==1)
{
B3PressOnce=0;
if(select_2==1) {select_2=2;}
else if(select_2==2){select_2=1;}
}
if(B4PressOnce==1)
{
B4PressOnce=0;
if(select_2==1){pagenum=4;LcmClear(0x00);}
else {pagenum=3;LcmClear(0x00);}
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==3)
{
LcmPutStr(0,0,"Review Mode");
LcmPutStr(15,2,"Adjust Setting");
LcmPutStr(5,2,">");
if(B4PressOnce==1)
{
B4PressOnce=0;
pagenum=12;LcmClear(0x00);
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==4)
{
LcmPutStr(0,0,"Vol To Be Inf");
LcmPutNum(5,3,secode1_4);
LcmPutNum(25,3,secode2_4);
LcmPutNum(46,3,secode3_4);
// LcmPutNum(65,3,secode4_4);
LcmPutStr(100,3,"mls");
if(select_4==1){LcmPutStr(22,5,"^ ");}
if(select_4==2){LcmPutStr(18,5," ^ ");}
if(select_4==3){LcmPutStr(21,5," ^ ");}
// if(select_4==4){LcmPutStr(18,5," ^ ");}
if(B2PressOnce==1)
{
B2PressOnce=0;
if(select_4==1){if(secode1_4<9){secode1_4++; }else{secode1_4=0;}}
if(select_4==2){if(secode2_4<9){secode2_4++; }else{secode2_4=0;}}
if(select_4==3){if(secode3_4<9){secode3_4++; }else{secode3_4=0;}}
// if(select_4==4){if(secode4_4<9){secode4_4++; }else{secode4_4=0;}}
}
VTBI= secode1_4*100+secode2_4*10+secode3_4;
if(B3PressOnce==1)
{
B3PressOnce=0;
if(select_4==1) {select_4=2;}
else if(select_4==2){select_4=3;}
else if(select_4==3){select_4=1;}
// else if(select_4==4){select_4=1;}
}
if(B4PressOnce==1)
{
B4PressOnce=0;
if(secode1_4!=0||secode2_4!=0||secode3_4!=0)
{
pagenum=41;
LcmClear(0x00);
}
else
{
LcmPutStr(10,5,"Vol Error");
DelayMS(30000);
LcmPutStr(10,5," ");
}
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==41)
{
LcmPutStr(0,0,"Dutation Days");
LcmPutStr(23,3," ");
LcmPutNum(25,3,seday_4);
LcmPutStr(80,3,"Days");
if(B2PressOnce==1)
{
B2PressOnce=0;
if(seday_4<10){seday_4++; }else{seday_4=1;}
}
if(B4PressOnce==1)
{
B4PressOnce=0;
pagenum=5;
LcmClear(0x00);
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==5)
{
LcmPutStr(0,0,"Infusion Type");
LcmPutStr(10,2,"-PIB+Demand");
LcmPutStr(15,4,"-Library");
LcmPutStr(20,6,"YES");
LcmPutStr(70,6,"NO");
if(select_5==1){LcmPutStr(5,6,">");LcmPutStr(55,6," ");}
if(select_5==2){LcmPutStr(55,6,">");LcmPutStr(5,6," ");}
if(B3PressOnce==1)
{
B3PressOnce=0;
if(select_5==1) {select_5=2;}
else if(select_5==2){select_5=1;}
}
if(B4PressOnce==1)
{
B4PressOnce=0;
if(select_5==1){pagenum=10;LcmClear(0x00);}
else {pagenum=6;LcmClear(0x00);}
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==6)
{
LcmPutStr(0,0,"PIB Bolus Volume");
LcmPutNum(5,2,Bolusvol);
LcmPutStr(60,2,"mls");
LcmPutStr(0,4,"PIB Bolus Interval");
LcmPutStr(4,6," ");
LcmPutNum(5,6,BolusTime);
LcmPutStr(60,6,"hrs");
if(select_6==1){LcmPutStr(5,2,"> ");LcmPutStr(5,6," ");}
if(select_6==2){LcmPutStr(5,6,">");LcmPutStr(5,2," ");}
if(B2PressOnce==1)
{
B2PressOnce=0;
if(select_6==1){if(Bolusvol<15){Bolusvol++; }else{Bolusvol=0;}}
if(select_6==2){if(BolusTime<12){BolusTime++; }else{BolusTime=1;}}
}
if(B3PressOnce==1)
{
B3PressOnce=0;
if(select_6==1) {select_6=2;}
else if(select_6==2){select_6=1;}
}
if(B4PressOnce==1)
{
B4PressOnce=0;
pagenum=8;
LcmClear(0x00);
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==8)
{
LcmPutStr(4,2," ");
if(select_8==1){LcmPutStr(5,2,">");}else{LcmPutStr(5,2," ");}
if(select_8==2){LcmPutStr(21,6,"_");}
if(select_8==3){LcmPutStr(41,6,"_");}
if(select_8==4){LcmPutStr(61,6,"_");}
DelayMS(100);//0.01s
LcmPutStr(0,0,"Demand Volume");
LcmPutNum(5,2,Demandvol);
LcmPutStr(80,2,"mls");
LcmPutStr(0,4,"Lockout Time");
LcmPutStr(80,6,"min");
LcmPutNum(5,6,secode1_8);
LcmPutNum(25,6,secode2_8);
LcmPutNum(45,6,secode3_8);
DelayMS(300);//0.03s
if(B2PressOnce==1)
{
B2PressOnce=0;
if(select_8==1){if(Demandvol<15){Demandvol++; }else{Demandvol=0;}}
if(select_8==2){if(secode1_8<1){secode1_8++; }else{secode1_8=0;}}
if(select_8==3){if(secode1_8==1){if(secode2_8<2){secode2_8++; }else{secode2_8=0;}} else if(secode2_8<9){secode2_8++; }else{secode2_8=0;}}
if(select_8==4){if(secode1_8==1&&secode2_8==2){secode3_8=0;} else {if(secode3_8<9){secode3_8++; }else{secode3_8=0;}}}
}
if(secode1_8*100+secode2_8*10+secode3_8>=120) {secode1_8=1;secode2_8=2;secode3_8=0;}
LockoutTime=secode1_8*100+secode2_8*10+secode3_8;
if(B3PressOnce==1)
{
B3PressOnce=0;
if(select_8==1) {select_8=2;}
else if(select_8==2){select_8=3;}
else if(select_8==3){select_8=4;}
else if(select_8==4){select_8=1;}
}
if(B4PressOnce==1)
{
B4PressOnce=0;
pagenum=10;
LcmClear(0x00);
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==10)
{
LcmPutStr(0,0,"Secondary Porgram?");
LcmPutStr(25,4,"YES");
LcmPutStr(25,6,"NO");
if(select_10==1){LcmPutStr(5,4,">");LcmPutStr(5,6," ");}
if(select_10==2){LcmPutStr(5,6,">");LcmPutStr(5,4," ");}
if(B3PressOnce==1)
{
B3PressOnce=0;
if(select_10==1) {select_10=2;}
else if(select_10==2){select_10=1;}
}
if(B4PressOnce==1)
{
B4PressOnce=0;
if(select_10==1){pagenum=11;LcmClear(0x00);}
else {pagenum=12;LcmClear(0x00);}
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==11)
{
LcmPutStr(0,0,"Set Day To Begin");
LcmPutStr(23,3," ");
LcmPutNum(25,3,seday_10);
LcmPutStr(80,3,"Days");
LcmPutStr(0,6,"PIB+Demand");
if(B2PressOnce==1)
{
B2PressOnce=0;
if(seday_10<4){seday_10++; }else{seday_10=1;}
}
if(B4PressOnce==1)
{
B4PressOnce=0;
pagenum=12;
LcmClear(0x00);
LcmPutStr(0,2,"confirm your input");
DelayMS(30000);
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==12)
{
LcmPutStr(0,0,"Vol To Be Inf");
LcmPutNum(25,2,VTBI);
LcmPutStr(80,2,"mls");
LcmPutStr(90,6,"1/7");
if(B4PressOnce==1)
{
B4PressOnce=0;
pagenum=13;
LcmClear(0x00);
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==13)
{
LcmPutStr(0,0,"Dutation Days");
LcmPutNum(25,2,seday_4);
LcmPutStr(80,2,"Days");
LcmPutStr(90,6,"2/7");
if(B4PressOnce==1)
{
B4PressOnce=0;
pagenum=14;
LcmClear(0x00);
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==14)
{
LcmPutStr(0,0,"Bolus Volume");
LcmPutNum(25,2,Bolusvol);
LcmPutStr(80,2,"mls");
LcmPutStr(90,6,"3/7");
if(B4PressOnce==1)
{
B4PressOnce=0;
pagenum=15;
LcmClear(0x00);
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==15)
{
LcmPutStr(0,0,"Bolus Interval");
LcmPutNum(25,2,BolusTime);
LcmPutStr(80,2,"hrs");
LcmPutStr(90,6,"4/7");
if(B4PressOnce==1)
{
B4PressOnce=0;
pagenum=16;
LcmClear(0x00);
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==16)
{
LcmPutStr(0,0,"Demand Volume");
LcmPutNum(25,2,Demandvol);
LcmPutStr(80,2,"mls");
LcmPutStr(90,6,"5/7");
if(B4PressOnce==1)
{
B4PressOnce=0;
pagenum=17;
LcmClear(0x00);
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==17)
{
LcmPutStr(0,0,"Lockout Time");
LcmPutNum(25,2,LockoutTime);
LcmPutStr(80,2,"min");
LcmPutStr(90,6,"6/7");
if(B4PressOnce==1)
{
B4PressOnce=0;
pagenum=18;
LcmClear(0x00);
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==18)
{
LcmPutStr(0,0,"Set Day To Begin");
LcmPutNum(25,2,seday_10);
LcmPutStr(80,2,"Days");
LcmPutStr(90,6,"7/7");
if(B4PressOnce==1)
{
B4PressOnce=0;
pagenum=12;
LcmClear(0x00);
}
confirmflag=1;
// LcmPutNum(100,6,motor_turn);
}
if(b5click==0)
{
if(pagenum>=12)
{
confirmflag=1;}startcount=0;
}
if(b5click==1&&confirmflag==1)
{
DelayMS(5000);
startcount++;
if(startcount==6)
{
if(stateflag==0)
{
if(select_10==1)
{
pagenum=20;Thour=0;Tminute=0;Tsecond=0;Tday=0;
dis_time_buf[13]=0x00;
time_buf[6]=0x00;
ds1302_write_byte(ds1302_control_add,0x00); //关闭写保护
ds1302_write_byte(ds1302_sec_add,time_buf[6]); //秒
ds1302_write_byte(ds1302_control_add,0x80); //打开写保护
} //ds1302秒置零
else
{
pagenum=21;Thour=0;Tminute=0;Tsecond=0;Tday=0;
dis_time_buf[13]=0x00;
time_buf[6]=0x00;
ds1302_write_byte(ds1302_control_add,0x00); //关闭写保护
ds1302_write_byte(ds1302_sec_add,time_buf[6]); //秒
ds1302_write_byte(ds1302_control_add,0x80); //打开写保护
}
stateflag=1;LcmClear(0x00);
}
else if(stateflag==1){TR0 = 0;LcmPutStr(0,6,"SYS IS SUSPEND");stateflag=2;}
else if(stateflag==2){TR0 = 1;LcmPutStr(0,6," ");stateflag=1;}
confirmflag=0;
}
if(b5click==0&&startcount<6)
{
startcount=0;
}
}
if(pagenum==20) //wait for the start secondary program
{
seday_10=4;
runtime=Tday*24*60+Thour*60+Tminute; //u16 u8
Tset=seday_10*24*60; //u32 Uchar
Tuse=runtime; //u32 u16
Tleft=Tset-Tuse;
if(Tleft>1440){LcmPutNum(30,2,(Tleft/1440));}else{LcmPutNum(30,2,0);}LcmPutStr(55,2,"d");
if(Tleft/60>24){LcmPutNum(60,2,(Tleft/60)%24);}else{LcmPutNum(60,2,Tleft/60);}LcmPutStr(85,2,"h");
LcmPutNum(90,2,Tleft%60);LcmPutStr(115,2,"m");
LcmPutStr(0,0,"waitforthestart");
if(runtime>=seday_10*24*60)
{pagenum=21;delaytime=0;LcmClear(0x00);
Thour=0;Tminute=0;Tsecond=0;Tday=0;
dis_time_buf[13]=0x00;
time_buf[6]=0x00;
ds1302_write_byte(ds1302_control_add,0x00); //关闭写保护
ds1302_write_byte(ds1302_sec_add,time_buf[6]); //秒
ds1302_write_byte(ds1302_control_add,0x80); //打开写保护
}
// LcmPutNum(100,6,motor_turn);
}
if(pagenum==21)
{
// lighton
runtime=Tday*24*60+Thour*60+Tminute;
Tset=seday_4*24*60;
Tuse=runtime;
Tleft=Tset-Tuse;
if(VINF<=VTBI&&runtime<=(seday_4*24*60))
{
LcmPutNum(10,0,VINF); LcmPutStr(50,0,"/");LcmPutNum(70,0,VTBI);LcmPutStr(105,0,"ml"); //has been infused / to be infuse
LcmPutStr(0,2,"PIB");
if(Tleft>1440){LcmPutNum(30,2,(Tleft/1440));}else{LcmPutNum(30,2,0);}LcmPutStr(55,2,"d");
if(Tleft/60>24){LcmPutNum(60,2,(Tleft/60)%24);}else{LcmPutNum(60,2,Tleft/60);}LcmPutStr(85,2,"h");
LcmPutNum(90,2,Tleft%60);LcmPutStr(115,2,"m");
LcmPutStr(0,4,"Dem");
lockouttime=Tlockm;
if(lockouttime>=LockoutTime){lockflag=1;}else{lockflag=0;}
if(lockflag==1){LcmPutStr(60,4,"ready ");}else{LcmPutStr(60,4,"unready");}
if(B1PressOnce==1){B1PressOnce=0;if(lockflag==1){Tlockm=0;bolushandcount++;}}
if(LTPressOnce==1){LTPressOnce=0;lightcount++;}
infcount=runtime/(BolusTime*60);
LcmPutNum(10,6,Thour);
LcmPutNum(40,6,Tminute);
LcmPutNum(70,6,Tsecond);
// LcmPutNum(0,6,stateflag); LcmPutNum(50,6,bolushandcount); LcmPutNum(90,6,lightcount);
}else
{
LcmClear(0x00);LcmPutStr(50,0,"Infuse has been finshed");
// beep=0;DelayMS(5000);beep=1;DelayMS(5000);
}
// LcmPutNum(100,6,motor_turn);
}
// LcmPutNum(100,6,pagenum);
// LcmClear(0xff);
}
}
/********************** Timer0 1ms中断函数 ************************/
void timer0 (void) interrupt TIMER0_VECTOR
{
B_1ms = 1; //1ms标志
}
/********************* INT3中断函数 *************************/
void INT3_int (void) interrupt INT3_VECTOR //进中断时已经清除标志
{
// INT_CLKO &= 0xDF; //若需要手动清除中断标志,可先关闭中断,此时系统会自动清除内部中断标志
interrupt_counter++; //中断次数计数
}
void tm0_isr() interrupt 1 //中断入口
{
// interrupt_counter1++; //中断次数计数
TL0 = 0x00; //设定定时器初值
TH0 = 0xDC; //设定定时器初值
//每500us进行中断,输出取反,即1ms周期的方波
t++;
if(t==400) //间隔200ms(50ms*4)读取一次时间
{
t=0;
ds1302_read_time(); //读取时间
// dis_time_buf[0]=(time_buf[0]>>4); //年
// dis_time_buf[1]=(time_buf[0]&0x0f);
//
// dis_time_buf[2]=(time_buf[1]>>4);
// dis_time_buf[3]=(time_buf[1]&0x0f);
//
//
//
// dis_time_buf[4]=(time_buf[2]>>4); //月
// dis_time_buf[5]=(time_buf[2]&0x0f);
//
// dis_time_buf[6]=(time_buf[3]>>4); //日
// dis_time_buf[7]=(time_buf[3]&0x0f);
//
// dis_time_buf[14]=(time_buf[7]&0x07); //星期
//
// //第2行显示
// dis_time_buf[8]=(time_buf[4]>>4); //时
// dis_time_buf[9]=(time_buf[4]&0x0f);
//
// dis_time_buf[10]=(time_buf[5]>>4); //分
// dis_time_buf[11]=(time_buf[5]&0x0f);
dis_time_buf[12]=(time_buf[6]>>4); //秒
dis_time_buf[13]=(time_buf[6]&0x0f);
if((dis_time_buf[12]+'0')=='0'&&(dis_time_buf[13]+'0')=='1')
{
Tmsecond=0;
RTC();
dis_time_buf[13]=0x00;
time_buf[6]=0x00;
ds1302_write_byte(ds1302_control_add,0x00); //关闭写保护
ds1302_write_byte(ds1302_sec_add,time_buf[6]); //秒
ds1302_write_byte(ds1302_control_add,0x80); //打开写保护
}
// ******************电机转圈计数********************
counter2=counter1;//保存上次状态
counter1 = turn_counter;
if((counter1==0)&&(counter2==1))//下降沿 //电机转动圈数超999时,千位会以字母表示?
{
motor_turn++; //电机转动圈数
}
//***************************************************
}
}
/* ASICC 字库代码 8x16 点阵 */
unsigned char code ASCIIchardot[16*96] = {
/*-- 文字: --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: ! --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x0E,0x1F,0x1F,0x0E,0x00,0x00,0x00,0x00,0x00,0xB0,0xB0,0x00,0x00,0x00,
/*-- 文字: " --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1C,0x1C,0x00,0x00,0x1C,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: # --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x04,0x1F,0x1F,0x04,0x1F,0x1F,0x04,0x00,0x40,0xF0,0xF0,0x40,0xF0,0xF0,0x40,
/*-- 文字: $ --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x0C,0x1E,0x73,0x71,0x18,0x08,0x00,0x00,0x20,0x30,0x1C,0x9C,0xF0,0x60,0x00,
/*-- 文字: % --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x18,0x3C,0x24,0x3D,0x1B,0x06,0x0C,0x00,0x00,0x60,0xC0,0xB0,0x78,0x48,0x78,0x30,
/*-- 文字: & --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x0D,0x1F,0x12,0x1E,0x0C,0x00,0x00,0x00,0xE0,0xF0,0x10,0x90,0xE0,0xF0,0x90,
/*-- 文字: ' --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x00,0x1C,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: ( --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x03,0x0F,0x1C,0x10,0x00,0x00,0x00,0x00,0xE0,0xF8,0x1C,0x04,0x00,0x00,
/*-- 文字: ) --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x10,0x1C,0x0F,0x03,0x00,0x00,0x00,0x00,0x04,0x1C,0xF8,0xE0,0x00,0x00,
/*-- 文字: * --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x01,0x05,0x07,0x03,0x07,0x05,0x01,0x00,0x00,0x40,0xC0,0x80,0xC0,0x40,0x00,
/*-- 文字: + --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x01,0x01,0x07,0x07,0x01,0x01,0x00,0x00,0x00,0x00,0xC0,0xC0,0x00,0x00,0x00,
/*-- 文字: , --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x3C,0x38,0x00,0x00,
/*-- 文字: - --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: . --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x00,0x00,
/*-- 文字: / --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x00,0x01,0x07,0x1E,0x18,0x00,0x00,0x18,0x78,0xE0,0x80,0x00,0x00,0x00,
/*-- 文字: 0 --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x0F,0x1F,0x10,0x16,0x1F,0x0F,0x00,0x00,0xE0,0xF0,0xD0,0x10,0xF0,0xE0,
/*-- 文字: 1 --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x04,0x04,0x0C,0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0x00,0x00,
/*-- 文字: 2 --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x0C,0x1C,0x10,0x11,0x1F,0x0E,0x00,0x00,0x30,0x70,0xD0,0x90,0x10,0x10,0x00,
/*-- 文字: 3 --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x0C,0x1C,0x11,0x11,0x1F,0x0E,0x00,0x00,0x60,0x70,0x10,0x10,0xF0,0xE0,0x00,
/*-- 文字: 4 --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x1F,0x1F,0x00,0x07,0x07,0x00,0x00,0xC0,0xC0,0x40,0x40,0xF0,0xF0,0x40,
/*-- 文字: 5 --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x11,0x11,0x11,0x10,0x00,0x00,0x10,0x10,0x10,0x30,0xE0,0xC0,0x00,
/*-- 文字: 6 --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x03,0x07,0x1E,0x1A,0x13,0x01,0x00,0x00,0xE0,0xF0,0x10,0x10,0xF0,0xE0,0x00,
/*-- 文字: 7 --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x10,0x10,0x11,0x17,0x1E,0x18,0x00,0x00,0x00,0x70,0xF0,0x80,0x00,0x00,0x00,
/*-- 文字: 8 --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x0E,0x1F,0x13,0x11,0x1F,0x0E,0x00,0x00,0xE0,0xF0,0x10,0x90,0xF0,0xE0,0x00,
/*-- 文字: 9 --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x0F,0x1F,0x10,0x10,0x1F,0x0F,0x00,0x00,0x00,0x90,0xB0,0xF0,0xC0,0x80,0x00,
/*-- 文字: : --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x00,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00,0x30,0x30,0x30,0x00,0x00,
/*-- 文字: ; --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x00,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00,0x34,0x3C,0x38,0x00,0x00,
/*-- 文字: < --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x01,0x03,0x06,0x0C,0x18,0x10,0x00,0x00,0x00,0x80,0xC0,0x60,0x30,0x10,0x00,
/*-- 文字: = --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x00,0x00,0x80,0x80,0x80,0x80,0x80,0x80,0x00,
/*-- 文字: > --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x10,0x18,0x0C,0x06,0x03,0x01,0x00,0x00,0x10,0x30,0x60,0xC0,0x80,0x00,0x00,
/*-- 文字: ? --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x0C,0x1C,0x11,0x13,0x1E,0x0C,0x00,0x00,0x00,0x00,0xB0,0xB0,0x00,0x00,0x00,
/*-- 文字: @ --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x0F,0x1F,0x10,0x11,0x13,0x12,0x1F,0x0F,0xE0,0xF0,0x10,0x90,0xD0,0x50,0xD0,0xD0,
/*-- 文字: A --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x07,0x0F,0x18,0x18,0x0F,0x07,0x00,0x00,0xF0,0xF0,0x80,0x80,0xF0,0xF0,0x00,
/*-- 文字: B --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x11,0x11,0x1F,0x0E,0x00,0x00,0xF0,0xF0,0x10,0x10,0xF0,0xE0,0x00,
/*-- 文字: C --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x0F,0x1F,0x10,0x10,0x1C,0x0C,0x00,0x00,0xE0,0xF0,0x10,0x10,0x70,0x60,0x00,
/*-- 文字: D --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x10,0x18,0x0F,0x07,0x00,0x00,0xF0,0xF0,0x10,0x30,0xE0,0xC0,0x00,
/*-- 文字: E --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x11,0x11,0x11,0x10,0x00,0x00,0xF0,0xF0,0x10,0x10,0x10,0x10,0x00,
/*-- 文字: F --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x11,0x11,0x11,0x10,0x00,0x00,0xF0,0xF0,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: G --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x0F,0x1F,0x10,0x10,0x1C,0x0C,0x00,0x00,0xE0,0xF0,0x10,0x90,0xF0,0xF0,0x00,
/*-- 文字: H --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x01,0x01,0x1F,0x1F,0x00,0x00,0xF0,0xF0,0x00,0x00,0xF0,0xF0,0x00,
/*-- 文字: I --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x10,0x1F,0x1F,0x10,0x00,0x00,0x00,0x00,0x10,0xF0,0xF0,0x10,0x00,0x00,
/*-- 文字: J --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x00,0x00,0x00,0x1F,0x1F,0x00,0x00,0x60,0x70,0x10,0x10,0xF0,0xE0,0x00,
/*-- 文字: K --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x01,0x07,0x1E,0x18,0x00,0x00,0xF0,0xF0,0x00,0xC0,0xF0,0x30,0x00,
/*-- 文字: L --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0xF0,0xF0,0x10,0x10,0x10,0x10,0x00,
/*-- 文字: M --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x04,0x03,0x04,0x1F,0x1F,0x00,0xF0,0xF0,0x00,0x80,0x00,0xF0,0xF0,
/*-- 文字: N --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x06,0x03,0x01,0x1F,0x1F,0x00,0xF0,0xF0,0x00,0x00,0x80,0xF0,0xF0,
/*-- 文字: O --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x0F,0x1F,0x10,0x10,0x1F,0x0F,0x00,0x00,0xE0,0xF0,0x10,0x10,0xF0,0xE0,0x00,
/*-- 文字: P --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x11,0x11,0x1F,0x0E,0x00,0x00,0xF0,0xF0,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: Q --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x0F,0x1F,0x10,0x10,0x1F,0x0F,0x00,0x00,0xE0,0xF0,0x10,0x18,0xFC,0xE4,0x00,
/*-- 文字: R --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x11,0x11,0x1F,0x0E,0x00,0x00,0xF0,0xF0,0x00,0x80,0xF0,0x70,0x00,
/*-- 文字: S --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x0C,0x1E,0x13,0x11,0x18,0x08,0x00,0x00,0x20,0x30,0x10,0x90,0xF0,0x60,0x00,
/*-- 文字: T --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x10,0x10,0x1F,0x1F,0x10,0x10,0x00,0x00,0x00,0x00,0xF0,0xF0,0x00,0x00,0x00,
/*-- 文字: U --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x00,0x00,0x1F,0x1F,0x00,0x00,0xE0,0xF0,0x10,0x10,0xF0,0xE0,0x00,
/*-- 文字: V --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x00,0x00,0x1F,0x1F,0x00,0x00,0xC0,0xE0,0x30,0x30,0xE0,0xC0,0x00,
/*-- 文字: W --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x00,0x03,0x00,0x1F,0x1F,0x00,0x80,0xF0,0x70,0x80,0x70,0xF0,0x80,
/*-- 文字: X --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x18,0x1C,0x07,0x03,0x1C,0x18,0x00,0x00,0x70,0xF0,0x00,0x80,0xF0,0x70,0x00,
/*-- 文字: Y --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1E,0x1F,0x01,0x01,0x1F,0x1E,0x00,0x00,0x00,0x00,0xF0,0xF0,0x00,0x00,0x00,
/*-- 文字: Z --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x10,0x10,0x11,0x13,0x1E,0x1C,0x00,0x00,0x70,0xF0,0x90,0x10,0x10,0x10,0x00,
/*-- 文字: [ --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x1F,0x1F,0x10,0x10,0x00,0x00,0x00,0x00,0xFE,0xFE,0x02,0x02,0x00,0x00,
/*-- 文字: \ --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x18,0x1E,0x07,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xE0,0x78,0x18,0x00,
/*-- 文字: ] --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x10,0x10,0x1F,0x1F,0x00,0x00,0x00,0x00,0x02,0x02,0xFE,0xFE,0x00,0x00,
/*-- 文字: ^ --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x10,0x30,0x60,0x60,0x30,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: _ --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x02,0x02,0x02,0x02,0x02,0x02,0x02,
/*-- 文字: ` --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x40,0x60,0x70,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: a --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x04,0x04,0x04,0x07,0x03,0x00,0x00,0x60,0xF0,0x90,0x90,0xF0,0xF0,0x00,
/*-- 文字: b --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x04,0x04,0x07,0x03,0x00,0x00,0xF0,0xF0,0x10,0x10,0xF0,0xE0,0x00,
/*-- 文字: c --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x03,0x07,0x04,0x04,0x06,0x02,0x00,0x00,0xE0,0xF0,0x10,0x10,0x30,0x20,0x00,
/*-- 文字: d --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x03,0x07,0x04,0x04,0x1F,0x1F,0x00,0x00,0xE0,0xF0,0x10,0x10,0xF0,0xF0,0x00,
/*-- 文字: e --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x03,0x07,0x04,0x04,0x07,0x03,0x00,0x00,0xE0,0xF0,0x90,0x90,0x90,0x80,0x00,
/*-- 文字: f --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x01,0x0F,0x1F,0x11,0x11,0x11,0x00,0x00,0x00,0xF0,0xF0,0x00,0x00,0x00,0x00,
/*-- 文字: g --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x03,0x07,0x04,0x04,0x07,0x07,0x00,0x00,0xE2,0xF2,0x12,0x12,0xFE,0xFC,0x00,
/*-- 文字: h --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x04,0x04,0x07,0x03,0x00,0x00,0xF0,0xF0,0x00,0x00,0xF0,0xF0,0x00,
/*-- 文字: i --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x04,0x04,0x37,0x37,0x00,0x00,0x00,0x00,0x10,0x10,0xF0,0xF0,0x10,0x10,0x00,
/*-- 文字: j --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x04,0x04,0x37,0x37,0x00,0x00,0x00,0x02,0x02,0x02,0xFE,0xFC,0x00,0x00,
/*-- 文字: k --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x00,0x01,0x07,0x06,0x00,0x00,0xF0,0xF0,0x80,0xC0,0x70,0x30,0x00,
/*-- 文字: l --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x10,0x10,0x1F,0x1F,0x00,0x00,0x00,0x00,0x10,0x10,0xF0,0xF0,0x10,0x10,0x00,
/*-- 文字: m --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x07,0x07,0x04,0x07,0x04,0x07,0x03,0x00,0xF0,0xF0,0x00,0xE0,0x00,0xF0,0xF0,
/*-- 文字: n --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x07,0x07,0x04,0x04,0x07,0x03,0x00,0x00,0xF0,0xF0,0x00,0x00,0xF0,0xF0,0x00,
/*-- 文字: o --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x03,0x07,0x04,0x04,0x07,0x03,0x00,0x00,0xE0,0xF0,0x10,0x10,0xF0,0xE0,0x00,
/*-- 文字: p --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x07,0x07,0x04,0x04,0x07,0x03,0x00,0x00,0xFE,0xFE,0x10,0x10,0xF0,0xE0,0x00,
/*-- 文字: q --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x03,0x07,0x04,0x04,0x07,0x07,0x00,0x00,0xE0,0xF0,0x10,0x10,0xFE,0xFE,0x00,
/*-- 文字: r --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x07,0x07,0x01,0x02,0x06,0x06,0x00,0x00,0xF0,0xF0,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: s --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x03,0x07,0x04,0x04,0x04,0x04,0x00,0x00,0x10,0x90,0x90,0x90,0xF0,0x60,0x00,
/*-- 文字: t --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x04,0x1F,0x1F,0x04,0x04,0x04,0x00,0x00,0x00,0xE0,0xF0,0x10,0x10,0x10,0x00,
/*-- 文字: u --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x07,0x07,0x00,0x00,0x07,0x07,0x00,0x00,0xE0,0xF0,0x10,0x10,0xF0,0xF0,0x00,
/*-- 文字: v --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x07,0x07,0x00,0x00,0x07,0x07,0x00,0x00,0xC0,0xE0,0x30,0x30,0xE0,0xC0,0x00,
/*-- 文字: w --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x07,0x07,0x00,0x03,0x00,0x07,0x07,0x00,0xC0,0xF0,0x30,0xC0,0x30,0xF0,0xC0,
/*-- 文字: x --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x06,0x07,0x01,0x01,0x07,0x06,0x00,0x00,0x30,0x70,0xC0,0xC0,0x70,0x30,0x00,
/*-- 文字: y --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x07,0x07,0x00,0x00,0x07,0x07,0x00,0x02,0xE2,0xF2,0x16,0x1C,0xF8,0xE0,0x00,
/*-- 文字: z --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x04,0x04,0x04,0x05,0x07,0x06,0x00,0x00,0x30,0x70,0xD0,0x90,0x10,0x10,0x00,
/*-- 文字: { --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x01,0x0F,0x1E,0x10,0x00,0x00,0x00,0x80,0xC0,0x78,0x3C,0x04,0x00,0x00,
/*-- 文字: | --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x00,0x1F,0x1F,0x00,0x00,0x00,0x00,0x00,0x00,0xFE,0xFE,0x00,0x00,0x00,
/*-- 文字: } --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x00,0x10,0x1E,0x0F,0x01,0x00,0x00,0x00,0x00,0x04,0x3C,0x78,0xC0,0x80,0x00,
/*-- 文字: ~ --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x0C,0x18,0x10,0x18,0x0C,0x04,0x0C,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*-- 文字: --*/
/*-- Fixedsys12; 此字体下对应的点阵为:宽 x 高=8x16 --*/
0x00,0x1F,0x1F,0x1F,0x1F,0x1F,0x1F,0x00,0x00,0xF0,0xF0,0xF0,0xF0,0xF0,0xF0,0x00,
};
复制代码
作者:
wc86110
时间:
2021-4-30 17:49
问题是显示屏的背光完全由程序自行控制
作者:
feelings
时间:
2021-4-30 17:57
wc86110 发表于 2021-4-30 17:49
问题是显示屏的背光完全由程序自行控制
感谢回复,我使用的是不用背光的显示屏,问题已经解决了,我把RTC函数里的三个lcm clear(0)去掉后就没有问题了,虽然不太理解,可能是因为命令发送过快导致的吧
欢迎光临 (http://www.51hei.com/bbs/)
Powered by Discuz! X3.1