Hi.I need translate this code from hi-tech compiler to CCS.Is a timer interrupt????Thanks
Code:
void interrupt isr(void)
{
if (TMR1IF==1)
{
counter++;
if (counter==keepalive) //131 ms * counter keep_alive
{
//Go away I'm keep aliving
counter=0;
//CODE
}
TMR1IF=0;
}
}
_________________ To Pic Or No To Pic
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
Posted: Wed Feb 27, 2008 9:39 am
Yes, it is an -open- TMR1 interrupt handler.
All you need is to define how to access TMR1IF. In most 16F series, it is the Bit0 of the
PIR1 Reg.
Credit to Mark who posted an alternative header with all the byte and bits definitions for
most 16F devices using union and structs. In this way it is possible to access a single
bit within a Register.
Don't put in any code for the TMR1IF flag. CCS handles it for you.
Saratoga
Joined: 18 Jan 2006 Posts: 9
Posted: Thu Feb 28, 2008 1:29 am
Huooo .OK..
"if (TMR1IF==1)" is only for HI-tech.
It s 131ms timer x counter. I understand now.
Thanks to all.
The program is the ELM323 OBD chip firmware.
http://www.obdchip.com/node/20. I translate definitions code to CCS(gracias humberto XD). _________________ To Pic Or No To Pic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum