9 Replies Latest reply on Nov 9, 2018 7:08 PM by user_13463998

    ISR won't execute

    user_48410712

      Hi - I have a DMA nrq signal connected to ISR_1.  I can not get the ISR to execute even though I bought out the nrq pin and I can see a 50 ns pulse there.  I can insert the software command to trigger the IRQ and that works fine.  I did an experiment where I tied the IRQ to a digital constant "1" with level triggering and that works.  It looks like the processor is stuck in CY_ISR(IntDefaultHandler).  I'm not sure what I'm doing wrong and would appreciate some help here.  File with the ISR calls is ModulatorLoop.c

       

      thanks much - Paul

        • 1. Re: ISR won't execute
          user_13463998

          Hi,

           

          How about trying something like ..

          ==========================

          CY_ISR(isr_1_func)

          {

               isr_1_func_ClearPending() ;

               /* do something for isr_1 interrupt */

          }

          int main()

          {

               /* Enable Global Interrupts */

               CYGlobal IntEnable ;

           

               isr_1_StartEx(isr_1_fun) ;

           

               /* start the LCD display */

               ...

          ==========================

           

          moto

          • 2. Re: ISR won't execute
            user_48410712

            Hi Motoo - Thanks for the suggestion.  I've done several PSoC designs using DMA and interrupts.  This design is a bit different.  MAIN calls a subroutine ModulatorLoop that has ISR.  So MAIN is not calling the ISR in my case.  Something fails in setting up the ISR.  Rather that restructure all my code I'd prefer to make this topology work. 

            • 3. Re: ISR won't execute
              user_13463998

              Dear Paul-san,

               

              I'm sorry for my short sight, yes you were initializing the isr in ModulatorLoop().

               

              Another thing I've encountered before is

              the InterruptType of the isr.

               

              Currently your isr_1 is set to DERIVED.

               

              How about trying RISING_EDGE or LEVEL

              as you have already confirmed that the signal is alive.

               

              TYPE == DERIVED

              isr_1_DELIVED.JPG

               

              TYPE == RISING_EDGE (I hope this is the right one...)

              isr_1_RISING_EDGE.JPG

               

              TYPE == LEVEL

              isr_1_LEVEL.JPG

               

              Best Regards,

              9-Nov-2018

              moto

              • 4. Re: ISR won't execute
                user_48410712

                Hi Motoo – It’s not the ISR type.  I did try rising edge, no difference. I brought the ISR input trigger out to a pin and saw a clean 50ns pulse when the DMA completes.  I believe the ISR pointer is not set up properly.  P.

                • 5. Re: ISR won't execute
                  user_13463998

                  Dear Paul-san,

                   

                  Wow, it's getting very tough!

                   

                  Two things, I'd like to try if I were you, are

                  (1) set a break point at

                       isr_1_StartEx(DMA_1_isr_handler) ;

                       and make sure this is called.

                   

                  (2) Just like before, moving CY_ISR(DMA_1_isr_handler) { ... } and isr_1_StartEx(DMA_1_isr_handler)

                    into the main.c, early part of main() and see if it makes any difference.

                   

                  moto

                  • 6. Re: ISR won't execute
                    user_48410712

                    Hi Motoo - Yes isr_1_StartEx(DMA_1_isr_handler) is called.  I will try moving the ISR to main.  thanks for the suggestions

                    • 7. Re: ISR won't execute
                      user_13463998

                      Dear Paul-san,

                       

                      I've been studying your project, some other things I noticed are

                       

                      (1) From your problem description

                      >> CY_ISR(IntDefaultHandler)

                         This seems either assigning your handler have failed

                         or handler for isr_1 has been re-assigned to  IntDefaultHandler.

                        (inside the isr_1_Stop(), isr_1_SetVector(&IntDefaultHandler) ; is called )

                       

                      You may be able to use isr_1_GetVector() to confirm which address is assigned to isr_1.

                       

                      (2) You wrote 50ns pulse, but your bus clock is 36MHz.

                        As 1/50ns = 20MHz, may be you need to sample it with 40MHz or faster.

                           You might be able to try put SR-FF after DMA_1 so that pulse will be level.

                       

                      Sorry for being a scatterbrain, but these are what I could come up with.

                       

                      Best Regards,

                      9-Nov-2018

                      moto

                      • 8. Re: ISR won't execute
                        user_48410712

                        Hi Motoo – I reverted to old code and added the new changes one at a time.  Works now!  I can’t explain it but I’m moving on.

                        Thanks for your input.  I appreciate it.  Have a great weekend - Paul

                        • 9. Re: ISR won't execute
                          user_13463998

                          Dear Paul-san,

                           

                          I'm glad hearing that you problem was solved!

                           

                          Although my first response was pretty useless,

                          if any of later message(s) could provide you some hit

                          I would appreciate your marking it as helpful.

                           

                          Anyway, have a nice weekend for you, too!

                           

                          Best Regards,

                          10-Nov-2018

                          Motoo Tanaka

                          P.S. I was working at 1501 Page Mill Road

                          as a lab engineer from 2000~2002 ;-)