Page 1 of 1

cant use timer1 overflow in pic 16f877

Posted: Thu Oct 30, 2008 10:27 pm
by khaled yasin
why i cant create a timer1 overflow interrupt using pic16f877 but i can do that with pic16f877a?????

Re: cant use timer1 overflow in pic 16f877

Posted: Fri Oct 31, 2008 10:21 am
by Benj
Hello

Check that the timer interrupt enable icon properties is using the CLKI and not the T0CLKI for the input clock.

Re: cant use timer1 overflow in pic 16f877

Posted: Fri Oct 31, 2008 11:06 am
by khaled yasin
still cant understand why,when i change the PIC target from 16f877a to 16f877 a message tells me that flow code is unable to run one or more commands....

Re: cant use timer1 overflow in pic 16f877

Posted: Fri Oct 31, 2008 12:16 pm
by Benj
Ah ok that makes sense. The timer1 interrupt is probably not defined for the 16F877 processor. If you open up the 16F877A.fcd file from the Flowcode V3/fcd folder and scroll to the bottom then you will see the interrupt code. Copy this section of code into your 16F877.fcd file and restart Flowcode. Remember to make backups of the files incase things go wrong.

Re: cant use timer1 overflow in pic 16f877

Posted: Fri Nov 28, 2008 5:20 pm
by khaled yasin
hi...
i think i might have found my problem...i used pic16f877a and just wrote a simple program with an interrupt icon,the program counts how many times timer1 overflows,just like that .but it seems that timer1 never overflows :!: :!: :!: ,i replaced the interrupt icon timer1overflow with timer0 overflow and it worked fine and the counter started incrementing each time timer0 overflowed but this as didn't work when i used timer1 overflow interrupt icon so whats the problem???

Re: cant use timer1 overflow in pic 16f877

Posted: Fri Nov 28, 2008 5:30 pm
by Benj
Hello

Are you simulating or running the code on the chip?

Re: cant use timer1 overflow in pic 16f877

Posted: Fri Nov 28, 2008 5:31 pm
by khaled yasin
no i am only simulating in flowcode3 and watching the counter for the overflow on an lcd screen

Re: cant use timer1 overflow in pic 16f877

Posted: Fri Nov 28, 2008 5:39 pm
by Benj
Ok that makes sense. The Timer0 simulation was buggy at best so the timer1 simulation has been left out of Flowcode v3. We hope to have this fixed in V4.

Sorry for any inconvenience and let me know if it doesn't work on hardware.

Re: cant use timer1 overflow in pic 16f877

Posted: Fri Nov 28, 2008 5:56 pm
by khaled yasin
will that is ok , but i thought that if it wasn't working in simulation it wont be working after i upload the hex file to the chip and see the output,so if i upload the program to the chip i will be able to see the variable that will count how many times timer1 have overflowed incrementing on the lcd :?: also is there any other way that i can see if timer1 is working while simulating in flowcode3,example or anything that i may try t do?

Re: cant use timer1 overflow in pic 16f877

Posted: Fri Nov 28, 2008 6:02 pm
by Benj
Hello

Yes the best way to test if it is indeed working would be to output the count value on the LCD on the hardware.

Once you have confirmed that it is indeed working then you can fool the simulation if you want to by pausing it and manually editing variables etc that would have been updated by the interrupt routine.