Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

Not Working SimulIDE and Timer1 flag TMR1IF in PIC16F887

Go down  Message [Page 1 of 1]

jaltiti



Please share if you faced the same issue below and found the solution.
Timer1 flag TMR1IF does not get detected when TMR1H and TMR1L reaches 65536 (overflow). as the statement below does not get recognized by SimulIDE. the code is written in MikroC PRO. SimulIDE does not get out of the statement
while (TMR1IF_BIT == 0);

void main()
{
int i;
TRISD = 0;
PORTD = 0x55;
TMR1CS_BIT = 0;
T1CKPS0_BIT = 0;
T1CKPS1_BIT = 0;
TMR1GE_BIT = 0;
TMR1ON_BIT = 0;
TMR1IF_BIT = 0;
while(1)
{
for(i = 0; i <153; i++)
{
TMR1L = 0x00;
TMR1H = 0x00;
TMR1ON_BIT = 1 ;
while (TMR1IF_BIT == 0); // THE PROBLEM IS HERE
PIR1.TMR1IF = 0;
TMR1ON_BIT = 0;
}
PORTD = ~PORTD;
}
}

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum