8 Replies Latest reply on Oct 31, 2019 3:24 AM by MoTa_728816

    PSoC 4100S Plus PWM output seems to be different via SmartIO

    MoTa_728816

      Hi,

       

      Today one of my colleagues encountered an interesting phenomenon.

      He was using a CY8CKIT-149.

       

      He connected an output of a PWM to an output pin LED13 (P5[5]) and to data7 of SmartIO.

      The SmartIO was configured just like a jumper wire (1->1, 0->0) and its gpio6 was connected to LE8 (P1[6]).

       

      When both PWM and SmartIO were Start()ed, both LEDs were blinking together.

      But when PWM_Stop() was called, LED8 was ON but LED13 was OFF.

       

      We were expecting that both LEDs should behave similarly as their logic come from the same line_n of PWM.

       

      Since LED8 was ON, we assumed that the line connected to data7 of SmartIO is LOW,

      then LED13 which is connected to the same line should be LOW, too.

      And if it is so, LED13 should be ON.

       

      [ QUESTION! ] Could someone teach us why this is happening?

       

      To reproduce the phenomenon, I made following simplified project.

       

      Schematic

       

       

       

       

      Pin Assignment

      001-pin-assignment.JPG

       

      SmartIO Configuration

      002-SmartIO-Config.JPG

       

      LUT 6

      003-LUT6.JPG

       

      PWM Config

      004-PWM-Config.JPG

       

      main.c

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

      #include "project.h"

       

      /**

      * LED8  is connected to SmartIO

      * LED13 is conncted to PWM line_n

      */

      int main(void)

      {

          CyGlobalIntEnable; /* Enable global interrupts. */

         

          SmartIO_Start() ; // (A) LED8 is ON and LED13 is OFF

         

          PWM_Start() ;     // (B) both LED8 and LED13 blink synchronizedly

       

          CyDelay(3000) ;   // (C) let LEDs blink for 3 seconds

       

          PWM_Stop() ;      // (D) LED8 is ON and LED13 is OFF

         

          SmartIO_Stop() ;  // (E) both LED8 and LED13 is OFF

       

          for(;;)          

          {

                           // rest is silence

          }

      }

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

       

      moto

        • 1. Re: PSoC 4100S Plus PWM output seems to be different via SmartIO
          MoTa_728816

          Oops, I was trying to replace the schematic, but accidentally saved the topic.

           

          Following is the schematic

          000-schematic.JPG

          moto

          • 2. Re: PSoC 4100S Plus PWM output seems to be different via SmartIO
            RuzheZ_36

            Tanaka-san,

             

            I guess there may be something with drive mode of these two pins or the internal connection issue.

            I saw drive mode of these two pins are both strong drive.

            So this could be caused by internal connection of these two pins after PWM stop are different. I will double-check the code and internal connection.

            Meanwhile, we can test if both line output and line_n output has same phenomenon.

             

            Best Regards,

            Ryan

            • 3. Re: PSoC 4100S Plus PWM output seems to be different via SmartIO
              MoTa_728816

              Dear Ryan-san,

               

              Thank you very much for your response!

               

              Since I'm out of my office, I can not test it today,

              but I'd like to test line and line_n tomorrow.

               

              And, Yes,  I'm looking forward to hearing update(s) from you.

               

              Best Regards,

              9-Oct-2019

              Motoo Tanaka

              • 4. Re: PSoC 4100S Plus PWM output seems to be different via SmartIO
                MoTa_728816

                Dear Ryan-san,

                 

                I tested with line.

                And again LEDs did not agree when PWM is stopped.

                 

                PWM config

                004-PWM-config.JPG

                Although PWM config, IMHO, suggests that line is LOW when not active,

                the PWM's line output connected to the external pin (P5[6]) behave otherwise,

                meantime SmartIO shows that data6, which is also connected to PWM's line output shows it is LOW.

                 

                We have some suspect that when an internal component is stopped the IOB connected to that component

                takes its "initial value" instead of the supposed logical value of the internal component.

                In this case, LED13's Initial drive state is High(1), although we can not control it.

                 

                This assumption also agrees with the behavior of LED8, which is ON after PWM was stopped,

                but when SmartIO is stopped, LED8 also gets OFF.

                005-LED13-config.JPG

                 

                schematic

                000-schematic.JPG

                pin assign

                001-pin-assign.JPG

                SmartIO config

                002-SmartIO.JPG

                LUT7 config

                003-LUT7.JPG

                 

                main.c

                 

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

                #include "project.h"

                 

                /**

                * LED8  is connected to SmartIO

                * LED13 is conncted to PWM line

                */

                int main(void)

                {

                    CyGlobalIntEnable; /* Enable global interrupts. */

                   

                    SmartIO_Start() ; // (A) LED8 is ON and LED13 is OFF

                   

                    PWM_Start() ;     // (B) both LED8 and LED13 blink synchronizedly

                 

                    CyDelay(3000) ;   // (C) let LEDs blink for 3 seconds

                 

                    PWM_Stop() ;      // (D) LED8 is ON and LED13 is OFF

                   

                    SmartIO_Stop() ;  // (E) both LED8 and LED13 is OFF

                 

                 

                    for(;;)          

                    {

                                     // rest is silence

                    }

                }

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

                 

                Best Regards,

                10-Oct-2019

                Motoo Tanaka

                • 5. Re: PSoC 4100S Plus PWM output seems to be different via SmartIO
                  RuzheZ_36

                  Tanaka-san,

                   

                  PWM_Stop() ; only stopped output of PWM component,

                  but the output buffer of SMARTIO is not disabled. SmartIO_Stop() ; will disable SMARTIO Component output buffer so that output of SmarIO will be stopped.

                   

                  Best Regards,

                  Ryan

                  • 6. Re: PSoC 4100S Plus PWM output seems to be different via SmartIO
                    MoTa_728816

                    Dear Ryan-san,

                     

                    Thank you very much for your answer.

                     

                    Would you teach us below?

                     

                    > PWM_Stop() ; only stopped output of PWM component,

                    > but the output buffer of SMARTIO is not disabled.

                     

                    What is the "output" of PWM?

                    Is it the output port connected to the external pin

                    or the "line" signal of PWM component?

                     

                    From the symptom I think that the output PIN (port) of PWM

                    is either high or high-Z so that LED turns off.

                     

                    But as LED connected to the SmartIO is on,

                    which means the signal "line" of PWM is LOW

                    or SmartIO treats disabled signal ("line" of PWM) as LOW,

                    so that the LED turns on.

                     

                    I'm sorry for being picky, but we also having been wondering about this.

                     

                    Best Regards,

                    28-Oct-2019

                    Motoo Tanaka

                     

                    • 7. Re: PSoC 4100S Plus PWM output seems to be different via SmartIO
                      RuzheZ_36

                      Tanaka-san,

                       

                      Thank you for your update on the topic.

                      We welcome any study and research on Cypress product application which is a key to help us move on continually.

                      Regarding the phenomenon, output PIN (port) of PWM is high-Z(as per HSIOM configuration) so that PWM output LED turns off.

                      Yes. I think so. SmartIO treats disabled signal ("line" of PWM) as LOW (When I change LUT6 logic to 0 0 0->1, 1 1 1->). After PWM_Stop(), SmartIO output will be high, and SmartIO LED turned off.  

                       

                      Best Regards,

                      Ryan

                      • 8. Re: PSoC 4100S Plus PWM output seems to be different via SmartIO
                        MoTa_728816

                        Dear Ryan-san,

                         

                        Thank you very much for your answer!

                         

                        Best Regards,

                        31-Oct-2019

                        Motoo Tanaka