来水一楼
今天把段式液晶仔细整理了一下
因为管脚次序已经完全打乱
没有规律可循
没算法能够用统一的方法寻址显示段位
只能够傻x兮兮地做了一个100x4的显示数组
显示10个数字位的0-9,苦逼啊
const unsigned int num[100][4]= { {0x00000002,0x00000003,0x00000002,0x00000003},//1-0 {0x00000000,0x00000002,0x00000002,0x00000000},//1-1 {0x00000002,0x00000001,0x00000003,0x00000002},//1-2 {0x00000002,0x00000002,0x00000003,0x00000002},//1-3 {0x00000000,0x00000002,0x00000003,0x00000001},//1-4 {0x00000002,0x00000002,0x00000001,0x00000003},//1-5 {0x00000002,0x00000003,0x00000001,0x00000003},//1-6 {0x00000000,0x00000002,0x00000002,0x00000002},//1-7 {0x00000002,0x00000003,0x00000003,0x00000003},//1-8 {0x00000002,0x00000002,0x00000003,0x00000003},//1-9 {0x00000008,0x0000000c,0x00000008,0x0000000c},//2-0 {0x00000000,0x00000008,0x00000008,0x00000000},//2-1 {0x00000008,0x00000004,0x0000000c,0x00000008},//2-2 {0x00000008,0x00000008,0x0000000c,0x00000008},//2-3 {0x00000000,0x00000008,0x0000000c,0x00000004},//2-4 {0x00000008,0x00000008,0x00000004,0x0000000c},//2-5 {0x00000008,0x0000000c,0x00000004,0x0000000c},//2-6 {0x00000000,0x00000008,0x00000008,0x00000008},//2-7 {0x00000008,0x0000000c,0x0000000c,0x0000000c},//2-8 {0x00000008,0x00000008,0x0000000c,0x0000000c},//2-9 {0x00000030,0x00000030,0x00000020,0x00000030},//3-0 {0x00000010,0x00000020,0x00000020,0x00000000},//3-1 {0x00000030,0x00000010,0x00000030,0x00000020},//3-2 {0x00000030,0x00000020,0x00000030,0x00000020},//3-3 {0x00000010,0x00000020,0x00000030,0x00000010},//3-4 {0x00000030,0x00000020,0x00000010,0x00000030},//3-5 {0x00000030,0x00000030,0x00000010,0x00000030},//3-6 {0x00000010,0x00000020,0x00000020,0x00000020},//3-7 {0x00000030,0x00000030,0x00000030,0x00000030},//3-8 {0x00000030,0x00000020,0x00000030,0x00000030},//3-9 {0x00001800,0x00001000,0x00001800,0x00001000},//4-0 {0x00000000,0x00001000,0x00001000,0x00000000},//4-1 {0x00001000,0x00001800,0x00000800,0x00001000},//4-2 {0x00001000,0x00001800,0x00001000,0x00001000},//4-3 {0x00000800,0x00001800,0x00001000,0x00000000},//4-4 {0x00001800,0x00000800,0x00001000,0x00001000},//4-5 {0x00001800,0x00000800,0x00001800,0x00001000},//4-6 {0x00001000,0x00001000,0x00001000,0x00000000},//4-7 {0x00001800,0x00001800,0x00001800,0x00001000},//4-8 {0x00001800,0x00001800,0x00001000,0x00001000},//4-9 {0x00402000,0x00400000,0x00402000,0x00400000},//5-0 {0x00000000,0x00400000,0x00400000,0x00000000},//5-1 {0x00400000,0x00402000,0x00002000,0x00400000},//5-2 {0x00400000,0x00402000,0x00400000,0x00400000},//5-3 {0x00002000,0x00402000,0x00400000,0x00000000},//5-4 {0x00402000,0x00002000,0x00400000,0x00400000},//5-5 {0x00402000,0x00002000,0x00402000,0x00400000},//5-6 {0x00400000,0x00400000,0x00400000,0x00000000},//5-7 {0x00402000,0x00402000,0x00402000,0x00400000},//5-8 {0x00402000,0x00402000,0x00400000,0x00400000},//5-9 {0x00810000,0x00010000,0x00810000,0x00810000},//6-0 {0x00000000,0x00010000,0x00010000,0x00800000},//6-1 {0x00010000,0x00810000,0x00800000,0x00810000},//6-2 {0x00010000,0x00810000,0x00010000,0x00810000},//6-3 {0x00800000,0x00810000,0x00010000,0x00800000},//6-4 {0x00810000,0x00800000,0x00010000,0x00810000},//6-5 {0x00810000,0x00800000,0x00810000,0x00810000},//6-6 {0x00010000,0x00010000,0x00010000,0x00800000},//6-7 {0x00810000,0x00810000,0x00810000,0x00810000},//6-8 {0x00810000,0x00810000,0x00010000,0x00810000},//6-9 {0x01020000,0x01000000,0x01020000,0x01020000},//7-0 {0x00000000,0x01000000,0x01000000,0x00020000},//7-1 {0x01000000,0x01020000,0x00020000,0x01020000},//7-2 {0x01000000,0x01020000,0x01000000,0x01020000},//7-3 {0x00020000,0x01020000,0x01000000,0x00020000},//7-4 {0x01020000,0x00020000,0x01000000,0x01020000},//7-5 {0x01020000,0x00020000,0x01020000,0x01020000},//7-6 {0x01000000,0x01000000,0x01000000,0x00020000},//7-7 {0x01020000,0x01020000,0x01020000,0x01020000},//7-8 {0x01020000,0x01020000,0x01000000,0x01020000},//7-9 {0x04100000,0x00100000,0x04100000,0x00100000},//8-0 {0x00000000,0x00100000,0x00100000,0x00000000},//8-1 {0x00100000,0x04100000,0x04000000,0x00100000},//8-2 {0x00100000,0x04100000,0x00100000,0x00100000},//8-3 {0x04000000,0x04100000,0x00100000,0x00000000},//8-4 {0x04100000,0x04000000,0x00100000,0x00100000},//8-5 {0x04100000,0x04000000,0x04100000,0x00100000},//8-6 {0x00100000,0x00100000,0x00100000,0x00000000},//8-7 {0x04100000,0x04100000,0x04100000,0x00100000},//8-8 {0x04100000,0x04100000,0x00100000,0x00100000},//8-9 {0x00200100,0x00000100,0x00200100,0x00200100},//9-0 {0x00000000,0x00000100,0x00000100,0x00200000},//9-1 {0x00000100,0x00200100,0x00200000,0x00200100},//9-2 {0x00000100,0x00200100,0x00000100,0x00200100},//9-3 {0x00200000,0x00200100,0x00000100,0x00200000},//9-4 {0x00200100,0x00200000,0x00000100,0x00200100},//9-5 {0x00200100,0x00200000,0x00200100,0x00200100},//9-6 {0x00000100,0x00000100,0x00000100,0x00200000},//9-7 {0x00200100,0x00200100,0x00200100,0x00200100},//9-8 {0x00200100,0x00200100,0x00000100,0x00200100},//9-9 {0x000000c0,0x00000040,0x000000c0,0x000000c0},//10-0 {0x00000000,0x00000040,0x00000040,0x00000080},//10-1 {0x00000040,0x000000c0,0x00000080,0x000000c0},//10-2 {0x00000040,0x000000c0,0x00000040,0x000000c0},//10-3 {0x00000080,0x000000c0,0x00000040,0x00000080},//10-4 {0x000000c0,0x00000080,0x00000040,0x000000c0},//10-5 {0x000000c0,0x00000080,0x000000c0,0x000000c0},//10-6 {0x00000040,0x00000040,0x00000040,0x00000080},//10-7 {0x000000c0,0x000000c0,0x000000c0,0x000000c0},//10-8 {0x000000c0,0x000000c0,0x00000040,0x000000c0}//10-9 };
感觉被击中了
void Display_updata(double temperature,unsigned char day,unsigned char month,unsigned char hour ,unsigned char minute) { unsigned int temp,temp1,temp2,temp3,mask[4]; temp = (unsigned int)(temperature*10.0); temp1 = temp/100; temp2 = temp%100/10+10; temp3 = temp%100%10+20; mask[0] = num[temp1][0]|num[temp2][0]|num[temp3][0]; mask[1] = num[temp1][1]|num[temp2][1]|num[temp3][1]; mask[2] = num[temp1][2]|num[temp2][2]|num[temp3][2]; mask[3] = num[temp1][3]|num[temp2][3]|num[temp3][3]; temp1 = month/10; temp2 = month%10+30; if(temp1>0) { mask[0] = mask[0]|num[temp2][0]; mask[1] = mask[1]|num[temp2][1]; mask[2] = mask[2]|num[temp2][2]; mask[3] = mask[3]|num[temp2][3]|0x00000800; } else{ mask[0] = mask[0]|num[temp2][0]; mask[1] = mask[1]|num[temp2][1]; mask[2] = mask[2]|num[temp2][2]; mask[3] = mask[3]|num[temp2][3]; } temp1 = day/10+40; temp2 = day%10+50; mask[0] = mask[0]|num[temp1][0]|num[temp2][0]; mask[1] = mask[1]|num[temp1][1]|num[temp2][1]; mask[2] = mask[2]|num[temp1][2]|num[temp2][2]; mask[3] = mask[3]|num[temp1][3]|num[temp2][3]; temp1 = minute/10+60; temp2 = minute%10+70; mask[0] = mask[0]|num[temp1][0]|num[temp2][0]; mask[1] = mask[1]|num[temp1][1]|num[temp2][1]; mask[2] = mask[2]|num[temp1][2]|num[temp2][2]; mask[3] = mask[3]|num[temp1][3]|num[temp2][3]; temp1 = hour/10+80; temp2 = hour%10+90; mask[0] = mask[0]|num[temp1][0]|num[temp2][0]; mask[1] = mask[1]|num[temp1][1]|num[temp2][1]; mask[2] = mask[2]|num[temp1][2]|num[temp2][2]; mask[3] = mask[3]|num[temp1][3]|num[temp2][3]; HAL_LCD_Write(&LCDHandle, LCD_RAM_REGISTER0, 0, mask[0]); HAL_LCD_Write(&LCDHandle, LCD_RAM_REGISTER2, 0, mask[1]); HAL_LCD_Write(&LCDHandle, LCD_RAM_REGISTER4, 0, mask[2]); HAL_LCD_Write(&LCDHandle, LCD_RAM_REGISTER6, 0, mask[3]); HAL_LCD_UpdateDisplayRequest(&LCDHandle); }
顺道用渣表做了一个简单的电流测试
先看代码
int main(void) { unsigned char i; SystemClock_Config(); LCD_GPIO_Config(); HAL_PWREx_EnableUltraLowPower(); HAL_LCD_DeInit(&LCDHandle); LCD_GLASS_Init(); for(i=0;i<10;i++){ Display_updata(i*1.2,i,i*2,i*3,i*4); delay_ms(15); } Display_updata(35.9,27,12,43,14); //HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON,PWR_SLEEPENTRY_WFI); HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON,PWR_STOPENTRY_WFI); // HAL_PWR_EnterSTANDBYMode(); /* Infinite loop */ while (1) { } } }
做个静态显示,进入stop模式
GIF显示
在全速填充段式液晶的时候
电流达到了370μA以上
进入stop模式后,电流掉到40-50μA
传说中的低功耗出现了
不过是20mA档测的,估计误差不小
表有点磕碜
这回下血本撸了块四位半
还在快递路上
VC86E,支持国产
欢迎吐槽,欢迎拿fluke来比
等表拿到手
再来认真测试一把
to be continued......
胜利四位半到手
当天就阵亡了
国产表啊,叫我如何是好
一怒之下,如了17B+
拿到新表,又仔细把L053的低功耗特性测试了一遍
特别针对休眠状态的电流
运行时的电流,直接在后面实际展示
使用的官方库例程
上结果
先是sleep模式
灰常失望
数据手册上给出的都是几十μA的测试数据
看看实测
1090μA,简直是坑爹啊
不过后来发现一个很有意思的问题
如果直接从stlink下载固件复位运行
会出现测试电流很大的情况
不知道是不是板子设计上的问题
所以导致sleep模式的测试偏差
最好能够手动复位一下
接下来的测试,都是下载后,掉电测得
室温大约在18度左右
看standby模式
手册上给出
使能LSI时,最大值是1.7μA,典型值1.3μA
失能LSI时,最大值0.6μA,典型值0.29μA
看看实测
使能LSI时
1.1μA,很稳定,比手册给出的典型值牛x
失能LSI
灰常给力,在0.1到0.2之间跳动
多数时间在0.1μA
已经是17B+的极限了
再来看看stop模式的两种情况
stop模式失能rtc和使能rtc两种情况并没有给出具体的数值
来个实测
失能RTC时
RTC不工作的时候,比典型值小
大概在0.3μA
使能RTC时
RTC用来唤醒stop模式
这个时候休眠电流在1.3μA
经过上面的测试
可以看出来
ST这次推的L053功耗做得相当可以
至少比F系列进步了许多
顺道测试了一下自己做的小东东
在读取传感器并填充段码液晶屏的时候
电流在400+μA
进入stop+RTC模式后
液晶屏继续显示
电流降低到85μA
下一步深入调试低功耗吧
to be continued......
回复
有奖活动 | |
---|---|
【有奖活动——B站互动赢积分】活动开启啦! | |
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |