7 Replies Latest reply on May 11, 2017 10:18 AM by user_365962704

    PSoC6 interrupt configuration on PSoC Creator

    hien

      I have tried to implement the interrupt on PSoC6 BLE pioneer kit, but the interrupt of PWM is not occurred. I confirmed GPIO interrupt occurred.

      I attach my sample project as a reference.

       

      My questions are:

      a) What is needed to occur the interrupt?

          a-1) Is the configuration of PWM correct?

      b) What is the API to clear the interrupt flag? I can't find it.

       

      Please let me know.

        • 1. Re: PSoC6 interrupt configuration on PSoC Creator
          arvi

          Hi,

           

          Couple of things to consider:

           

          1. The interrupt wasn't triggering as it wasn't enabled properly. Please replace the NVIC_EnableIRQ() code with the following:

          //NVIC_EnableIRQ(PWM_INT_INTR_CORTEXM0P_SRC); // < Incorrect
          NVIC_EnableIRQ(PWM_INT_cfg.intrSrc); // < Recommended way to use
          //NVIC_EnableIRQ(PWM_INT__INTC_CORTEXM0P_MUX); // < Also works
          

           

          It's better to use the Creator generated structure element .intrSrc so that it automatically reflects the interrupt assignment changes you might do using the Interrupts DWR configuration GUI window. This is defined in the auto-generated file 'cyfitter_sysint_cfg.c' (you need not modify any of this code):

           

          /* File Name: cyfitter_sysint_cfg.c */
          /* PWM_INT */
              const cy_stc_sysint_t PWM_INT_cfg = {
                  .intrSrc = (IRQn_Type)PWM_INT__INTC_CORTEXM0P_MUX,
                  .cm0pSrc = (cy_en_intr_t)PWM_INT__INTC_NUMBER,
                  .intrPriority = PWM_INT__INTC_CORTEXM0P_PRIORITY
              };
          

           

          2. The configuration is PWM is fine. The ISR just needed a statement to clear the PWM's interrupt state. This is done by adding this line (somewhere early) inside the ISR function:

          PWM_ClearInterrupt(CY_TCPWM_INT_ON_CC_OR_TC); /**< Clear Interrupt on TC or CC */
          

           

          I'm sorry that I couldn't attach the complete project as I don't currently have the same version as yours

          Please do give these changes a try and let me know if you still have issues.

           

          Cheers,

          Arvind

          • 2. Re: PSoC6 interrupt configuration on PSoC Creator
            hien

            Hi Arvind-san,

             

            I confirmed the interrupt operation with adding the following codes:

            -  NVIC_EnableIRQ(PWM_INT_INTR_CORTEXM0P_MUX);

            - PWM_ClearInterrupt(CY_TCPWM_INT_ON_CC_OR_TC);

            (I can't use the recommended code of NVIC enable)

             

            I have been using PSoC Creator 4.1.0.2015 that is provided on this community because this is an environment that the customer can use it currently.

            The package is "PSoC 6 complete documentsand tools Rev 1.1 April 6th 2017.zip".

             

            The environment is not same, so the auto-generated contents are also different.

             

            Thanks and best regards,

            hien

            • 3. Re: PSoC6 interrupt configuration on PSoC Creator
              arvi

              I confirmed the interrupt operation with adding the following codes:

              -  NVIC_EnableIRQ(PWM_INT_INTR_CORTEXM0P_MUX);

              - PWM_ClearInterrupt(CY_TCPWM_INT_ON_CC_OR_TC);

              That's good.

               

              (I can't use the recommended code of NVIC enable)

              Yes, my bad.. In my version the name of the structure is called PWM_INT_cfg, in yours I think it should be PWM_INT_cfg_cm0p. You can check the cyfitter_sysint_cfg.c for the correct one. Please don't worry too much about the change in names, once the latest version of Creator 4.1 is out, members on the forum should be able to help make any necessary changes.

              • 4. Re: PSoC6 interrupt configuration on PSoC Creator
                maskrtnik01_1570836

                Hi,

                 

                Is PSoC Creator for PSoC6 available to download? Could you tell me where?

                 

                Stanislav

                • 5. Re: PSoC6 interrupt configuration on PSoC Creator
                  iym

                  Stanislav,

                   

                  The latest PSoC Creator 4.1 is not yet available for download. We plan to release on our web, cypress.com in the next couple of weeks and also a tool that will reveal PSoC 6 parts to this community in the same time frame. Apologies for the delay and thanks for your patience!

                  • 6. Re: PSoC6 interrupt configuration on PSoC Creator
                    maskrtnik01_1570836

                    Well....from what was told here, I feel like a few users already have the new PSoC Creator. Did I misunderstand something?

                     

                    Also, you're not saying "a couple of weeks" for the first time. Do I misunderstand what is a couple? Or do you have some problems which cause the delay?

                     

                    Stanislav

                    • 7. Re: PSoC6 interrupt configuration on PSoC Creator
                      user_365962704

                      I guess only special users got "beta" releases of the new versions of Creator for testing and maybe bug hunting, so when Creator is ready it is released for all.

                      Do not despair , we all are waiting for the release of Creator and PSoC6 documentation.

                      1 of 1 people found this helpful