2 Replies Latest reply on Mar 23, 2015 2:22 AM by Madhu Lakshmipathy

    Help configuring GPOI pin as PWM and Static

    jeff.kalis

      I have an application where a GPIO pin must be driven with a PWM signal, but not all the time. The PWM output must be turned off sometimes.

         

      I can get the PWM signal to work just fine. However, I cannot figure out how to get it to stop and output static high and low values. This configures the PWM:

         

         gpioCplxConfig.driveHighEn = CyTrue;
         gpioCplxConfig.driveLowEn = CyTrue;
         gpioCplxConfig.inputEn = CyFalse;
         gpioCplxConfig.outValue = CyFalse;
         gpioCplxConfig.intrMode = CY_U3P_GPIO_NO_INTR;
         gpioCplxConfig.pinMode = CY_U3P_GPIO_MODE_PWM;
         gpioCplxConfig.timerMode = CY_U3P_GPIO_TIMER_LOW_FREQ;
         gpioCplxConfig.timer = 0x00000000;
         gpioCplxConfig.period = 0x00010000;
         gpioCplxConfig.threshold = 0x00008000;

         

      I think this should configure a static high on the pin but it doesn't work. The pin stays low.

         

         gpioCplxConfig.driveHighEn = CyTrue;
         gpioCplxConfig.driveLowEn = CyTrue;
         gpioCplxConfig.inputEn = CyFalse;
         gpioCplxConfig.outValue = CyTrue;
         gpioCplxConfig.intrMode = CY_U3P_GPIO_NO_INTR;
         gpioCplxConfig.pinMode = CY_U3P_GPIO_MODE_STATIC;
         gpioCplxConfig.timerMode = CY_U3P_GPIO_TIMER_SHUTDOWN;
         gpioCplxConfig.timer = 0x00000000;
         gpioCplxConfig.period = 0x00000000;
         gpioCplxConfig.threshold = 0x00000000;

         
           How do I get a static high on this pin?