/*********PIC16F877A TMR0定時(shí)器實(shí)驗(yàn)2*******使用前置分頻器,為實(shí)現(xiàn)精確定時(shí),不應(yīng)對(duì)TMR0進(jìn)行重復(fù)寫入操作PS2 PS1 PS00 0 0 2 分頻0 0 1 4 分頻0 1 0 8 分頻0 1 1 16 分頻1 0 0 32 分頻1 0 1 64 分頻1 1 0 128分頻1
#include #define uchar unsigned char#define uint unsigned int__CONFIG(0X3B32);#define LED PORTDchar Counter = 0; // 1S計(jì)數(shù)變量清零/********定時(shí)器0初始化函數(shù)********/void timer0_init(){ OPTION_R