simplicio
Junior Member level 2
pic18 timer0
don't I get to always understand the reason of the delay in bursting the timer0 after the reset? I am used PIC18F452
//My program
void main() { //função principal do programa
T0CON = 0b10000110; //configura timer modo 16 bits, com prescaler
TMR0L = 0Xf6; //carrega valores de contagem
TMR0H = 0XC2; //carrega valores de contagem
TRISd = 0; // PORT B is output
PORTd = 0xFF; // Initialize PORT B
do {
if (intcon.tmr0if == 1) { //se o flag de estouro do TIMER0 for igual a 1, então
PORTd = ~PORTd; // inverte o estado do portb
TMR0L = 0xF6;
TMR0H = 0XC2;
INTCON = 0b00000000; // Seta T0IE, apaga flag de entouro do TIMER0
//para uma nova contagem
}
} while(1); // loop
}
don't I get to always understand the reason of the delay in bursting the timer0 after the reset? I am used PIC18F452
//My program
void main() { //função principal do programa
T0CON = 0b10000110; //configura timer modo 16 bits, com prescaler
TMR0L = 0Xf6; //carrega valores de contagem
TMR0H = 0XC2; //carrega valores de contagem
TRISd = 0; // PORT B is output
PORTd = 0xFF; // Initialize PORT B
do {
if (intcon.tmr0if == 1) { //se o flag de estouro do TIMER0 for igual a 1, então
PORTd = ~PORTd; // inverte o estado do portb
TMR0L = 0xF6;
TMR0H = 0XC2;
INTCON = 0b00000000; // Seta T0IE, apaga flag de entouro do TIMER0
//para uma nova contagem
}
} while(1); // loop
}