qiang2751290
級(jí)別: 家園常客
|
51單片機(jī)如何長(zhǎng)時(shí)間延時(shí)? 單片機(jī)延時(shí)一個(gè)小時(shí)??? |
---|---|
|
supermax
級(jí)別: 工控俠客
|
#pragma interrupt_handler timer0_ovf_isr:10 //TIMER0 定時(shí)2ms中斷. void timer0_ovf_isr(void) { TCNT0 = 0xD9; //reload counter value timer2ms++; if(timer2ms >= 5) { timer2ms = 0; timer10ms ++; systimer10ms ++; if(systimer10ms >= 22) //內(nèi)部1M晶振 { systimer10ms = 0; timer1s ++; } } 網(wǎng)上找到的 |
---|---|
|