Hello!!! I am using MPLAB IDE along with Hi-tech C Compiler to use the PIC16F877A
I am trying to write a program to give some delay in Timer0 Mode.
But My Problem is that.
while(INTCONbits.TMR0IF == 0); //This Statement Works Fine
but when i reset the TMR0IF bit it doesnt work
means
INTCONbits.TMRR0IF = 0; //This gives no error but doesn't produce any effect
Let me ask you a question dude. Where have you provided the delay in the for which the timer 0 should run & get reset? How much time are you expecting the timer0 to run? Please do explain it.
Let me ask you a question dude. Where have you provided the delay in the for which the timer 0 should run & get reset? How much time are you expecting the timer0 to run? Please do explain it.
Firstly i am not getting what you want to know from me...
Actually i am writing some other code, where i need to generate a 1sec pulse.... and in that code i have encountered the same problem...
So i switched to a simple program and found that my TMR0IF flag is not reset when i use the statement
INTCONbits.TMR0IF == 0;
but when i use INTCON = 0x00;
then it works fine...
I want to know what's the problem in using this statement INTCONbits.TMR0IF = 0
I have also made plenty of such equally annoying mistakes. :lol:
This does underline the grave importance of EXTREME carefulness in playing with real electronics projects (not limited in the electronics domain indeed).