2 Replies Latest reply on Nov 21, 2012 9:48 AM by user_1377889

    Multiple custom ISRs on PSoC 5

    anders.fiilse.ramsing

       Hey Everybody

         

      We are trying to use our first touch starter kit to make a self balancing robot. But it seems that the system won't let us use two custom build clock driven ISRs in the same time? Has anyone in here expirienced some similar problems, or does anyone know a solution?

         

      Best Regards

         

      Anders

        • 1. Re: Multiple custom ISRs on PSoC 5
          user_78878863

          I think it should work - in a recent project I had 2 ISRr trigger by timer components (one with 10Hz and the other one with 1000Hz). What do you want to do exactly?

          • 2. Re: Multiple custom ISRs on PSoC 5
            user_1377889

            There is no such restriction. As a rule of thumb:

               

            Declare your interrupt handlers with CY_ISR_PROTO() and define them with CY_ISR() macros. Both explained in short in the System Reference Guide (Help -> Documentation -> System Reference ->)

               

            Use isr_StartEx() to tell which handler will use which isr.

               

            Keep the handlers short, no output to LCD, do not wait for anything.

               

             

               

            Since you are going to program a closed loop (PID) you'll need a (relatively) constant time-base (20 to 50 ms) get the 3 values of the on-board accellerometer and call your PID-function.

               

             

               

            Bob