单片机定时器实验代码
部分代码 main() { // 2. init Timer 1, T1ON, 1:1 prescaler, internal clock source _T1IP = 4; // this is the default value anyway TMR1 = 0; // clear the timer PR1 = 32768-1; // set the period register TRISA = 0xff00; // set PORTA lsb as output
部分代码 main() { // 2. init Timer 1, T1ON, 1:1 prescaler, internal clock source _T1IP = 4; // this is the default value anyway TMR1 = 0; // clear the timer PR1 = 32768-1; // set the period register TRISA = 0xff00; // set PORTA lsb as output