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;
}
}
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;
}
}