shaolinyo
Newbie level 6
hello, i used tmr0 for timing , i dont use portb , but when i run the simlation i get that portB is set with a value 1
and that is the code:
thank you
and that is the code:
Code:
int t=0; //time counter
void interrupt()
{
if(INTCON.T0IF){
t++; //for evry inettruption occure we increment t
TMR0=150;//the value to start the tmr0 if is spesified in the main program
}
INTCON.T0IF=0;
}
void main() {
Option_Reg=0b00010000;
INTCON=0b10100000;
trisc=0;
portc=0;
TMR0=150;
for(;;){
if(t==1)
portc.rc1=0;
if(t==2) {
portc.rc1=1;
t=0;
}
}
}
thank you