Menu

16F628 and multiple Interrupts

Help
Mauried
2009-07-12
2013-05-30
  • Mauried

    Mauried - 2009-07-12

    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.

     
    • Nobody/Anonymous

      Can You send CODE for this? Also it is good to see ASM code for Your program.
      It could help to solve Your problem.

       
    • Mauried

      Mauried - 2009-07-19

      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.

       
      • Hugh Considine

        Hugh Considine - 2009-07-19

        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.

         
    • Nobody/Anonymous

      Ill try the latest build and see what happens.
      Sure is easier if I can run multiple interrupts at the same time.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.