cant use timer1 overflow in pic 16f877

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
khaled yasin
Posts: 43
Joined: Sat Sep 13, 2008 10:36 pm
Contact:

cant use timer1 overflow in pic 16f877

Post by khaled yasin »

why i cant create a timer1 overflow interrupt using pic16f877 but i can do that with pic16f877a?????

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: cant use timer1 overflow in pic 16f877

Post by Benj »

Hello

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

khaled yasin
Posts: 43
Joined: Sat Sep 13, 2008 10:36 pm
Contact:

Re: cant use timer1 overflow in pic 16f877

Post 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....

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: cant use timer1 overflow in pic 16f877

Post 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.

khaled yasin
Posts: 43
Joined: Sat Sep 13, 2008 10:36 pm
Contact:

Re: cant use timer1 overflow in pic 16f877

Post 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???

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: cant use timer1 overflow in pic 16f877

Post by Benj »

Hello

Are you simulating or running the code on the chip?

khaled yasin
Posts: 43
Joined: Sat Sep 13, 2008 10:36 pm
Contact:

Re: cant use timer1 overflow in pic 16f877

Post by khaled yasin »

no i am only simulating in flowcode3 and watching the counter for the overflow on an lcd screen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: cant use timer1 overflow in pic 16f877

Post 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.

khaled yasin
Posts: 43
Joined: Sat Sep 13, 2008 10:36 pm
Contact:

Re: cant use timer1 overflow in pic 16f877

Post 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?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: cant use timer1 overflow in pic 16f877

Post 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.

Post Reply