I am using PIC16F877A and Compiler MPLABX XC8
I want to turn on LED on timer interrupt When a switch is pressed Counter goes from 0 to 22000 and when It reaches 22000 turns LED on
When switch would be pressed Timer would be load with 22000 counts when It would overflow Led would be turned ON in ISR
How to configure timer control Register?
T1SYNC = 1;
T1OSCEN = 1;
TMR1ON = 1;
TMR1CS = 1;
T1CKPS0 = 0;
T1CKPS1 = 0;
Is it a correct configuration?
I want to turn on LED on timer interrupt When a switch is pressed Counter goes from 0 to 22000 and when It reaches 22000 turns LED on
When switch would be pressed Timer would be load with 22000 counts when It would overflow Led would be turned ON in ISR
How to configure timer control Register?
T1SYNC = 1;
T1OSCEN = 1;
TMR1ON = 1;
TMR1CS = 1;
T1CKPS0 = 0;
T1CKPS1 = 0;
Is it a correct configuration?