Hello,
i was using a pic16f914 and had to switch to a pic16f917 because of rom size. I loaded the program and when compiling i am getting an error that TOIF is an undefined identifier. It worked fine with the 914. Any suggestions! I have the same settings for timer 0. Basically i only changed the header file for the pic. Thanks!
I have looked in both header files for 16f914 and 16f917 and found no occurences for T0IF flag in any of the headers. You must have defined it yourself in the header for 914 but not in 917.
Copy the T0IF define from the header for 914 to 917, or simply write a new one:
#bit T0IF = 0x0B.2
// t0if not toif
kender
Joined: 09 Aug 2004 Posts: 768 Location: Silicon Valley
Posted: Sat Apr 22, 2006 3:08 pm
You could also use the timer interrupt. (Of course you might have some reasons why you don't want to use the interrupt.)
Code:
#int_timer0
void isr_timer0()
{
++count;
}
janiga
Joined: 10 Apr 2006 Posts: 22
Thanks!
Posted: Sat Apr 22, 2006 3:15 pm
You are right i did not define the bit on the 917!
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