|
#include <TypeDef.h>
#include <delay.h>
#include <1602.h>
#include <eeprom.h>
#include <ads1110.h>
#include <stdio.h>
sbit LCD_BACKLIGHT = P4^5;
#define LCD_ON LCD_BACKLIGHT = 1;
#define LCD_OFF LCD_BACKLIGHT = 0;
#define LCD_OFF_JUDGE (LCD_BACKLIGHT == 0)
u16 power_saving_timer = 0;//節(jié)電模式計(jì)時(shí)器
void main(void)
{
LCD_ON;
P0M0 = 0; P0M1 = 0;
P1M0 = 0; P1M1 = 0;
P2M0 = 0; P2M1 = 0;
P3M0 = 0; P3M1 = 0;
P4M0 = 0x20; P4M1 = 0;
P5M0 = 0; P5M1 = 0;
P37=0;
Delay_ms(100);
Zero_Coeff_Init();
lcd_system_reset();
ads_initial();
Delay_ms(100);
string_write(0, 0, " 20200115138 ");
string_write(0, 1, " ");
Delay_ms(3500);
string_write(0, 0, "Range:10mV ");
string_write(0, 1, "Volt:0.000mVDC ");
ads_convert();
while (1)
{
Delay_ms(100);
//熄屏省電判斷
if(++power_saving_timer > 299){//30秒熄屏
LCD_OFF;
}}
這是一小段,程序沒有錯(cuò)誤。在我原先設(shè)計(jì)的焊接板上能熄滅lcd。但是下載到新的STC8H8K64U的最小系統(tǒng)里檢測(cè),5分鐘再測(cè)P45引腳,也還是高電平。沒有想象中輸出低電平是什么原因。
|
|