|
近日做的 LCM240128 時鐘溫度計經常出現 溫度顯示為零或是亂跳的現象,後來想了一想會不會是 "中断太頻繁了",於是把中断的時間提高10倍,問題居然解決了!!
void Timer0_isr(void) interrupt 1
{
// static unsigned char countdis;
static unsigned int TMnum,TPnum,TSnum;//
static unsigned char count;// int
TH0=(65536-20000)/256; //重新赋值 2ms
TL0=(65536-20000)%256; //
count++;
if(count>25) //大致300ms READ Ds1302
{
count=0;
ReadTimeFlag=1; //读标志位置1
mv_count++;// 計數器作為換字的速度
65536-2000 改成 65536-20000
count>250 改成 25 |
|