2 Replies Latest reply on Aug 16, 2020 4:27 PM by KaKo_4074056

    PSoC4 Smart I/O controls multiple LEDs with one TCPWM channel

    KaKo_4074056

      Hi,

       

      This sample program is run on CY8CKIT-149 (PSoC 4100S Plus, PSoC Creator 4.2). The output of one TCPWM is input to the Smart I/O and distributed to control multiple LEDs with the same period and duty ratio. This is useful to control more LEDs than the number of PWM channels. The timing of turning on and off each LED is controlled by API of LUT and Port. There are two types projects with and without the internal pin of Smart I/O. The following shows the one with the internal pin as P1[3].

       

      cysch.PNG

      smartio.png

       

              /* Turn on LED5 and off the others */

              SmartIO_LUT_ConfigureMode(SmartIO_LUT0, LUT_LED_ON, SmartIO_MODE_COMB);

              SmartIO_LUT_ConfigureMode(SmartIO_LUT2, LUT_LED_OFF, SmartIO_MODE_COMB);

              SmartIO_LUT_ConfigureMode(SmartIO_LUT4, LUT_LED_OFF, SmartIO_MODE_COMB);

              SmartIO_LUT_ConfigureMode(SmartIO_LUT6, LUT_LED_OFF, SmartIO_MODE_COMB);