Using 2 interrupt service routines.
One is for a tick timer which ticks twice a second, and the second is set to interrupt on incoming serial data.
Both work fine if individually enabled with the On Interrupt Event call statement.
If both are enabled at the same time , ie using 2 On Interrupt Event call statements
the PIC runs OK for a random amount of time, anywhere from 5 minutes to an hour or so,
and then neither interrupts get serviced anymore.
The PIC keeps running whatever other code is there to run.
When you need to service more than one interrupt what determines which one gets
serviced first.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I got around the problem eventually by simply getting rid of one of the Interrupting routines, and simply polling for the serial data.
Its pretty inefficient and makes for some clumsy code, but its reliable, which is what I need.
Im thinking that with 2 or more Interrupts alive, at some random time both will be called to be serviced at exactly the same time, ie within the period of 1 clock cycle, and the CPU doesnt know which one to go to.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If that doesn't solve the problem, please post your code here, or email it to me (w_cholmondeley, at users.sourceforge.net) if it's too long or something you don't want made public.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using 2 interrupt service routines.
One is for a tick timer which ticks twice a second, and the second is set to interrupt on incoming serial data.
Both work fine if individually enabled with the On Interrupt Event call statement.
If both are enabled at the same time , ie using 2 On Interrupt Event call statements
the PIC runs OK for a random amount of time, anywhere from 5 minutes to an hour or so,
and then neither interrupts get serviced anymore.
The PIC keeps running whatever other code is there to run.
When you need to service more than one interrupt what determines which one gets
serviced first.
Can You send CODE for this? Also it is good to see ASM code for Your program.
It could help to solve Your problem.
I got around the problem eventually by simply getting rid of one of the Interrupting routines, and simply polling for the serial data.
Its pretty inefficient and makes for some clumsy code, but its reliable, which is what I need.
Im thinking that with 2 or more Interrupts alive, at some random time both will be called to be serviced at exactly the same time, ie within the period of 1 clock cycle, and the CPU doesnt know which one to go to.
Try installing one of the latest builds from http://gcbasic.sourceforge.net/update.html - I fixed a few interrupt bugs recently, one of them might be to blame here.
If that doesn't solve the problem, please post your code here, or email it to me (w_cholmondeley, at users.sourceforge.net) if it's too long or something you don't want made public.
Ill try the latest build and see what happens.
Sure is easier if I can run multiple interrupts at the same time.