Control GPIO Output After Stopping the PWM - KBA218991

Version 3

    Version: **


    Translation - Japanese: PWM停止後のGPIO制御 - KBA218991- Community Translated (JA)



    How do I control the GPIO output after stopping the PWM?



    Once the GPIO is connected to the PWM, it cannot be directly controlled by the firmware because when the Pin connects to the PWM “line”, the HSIOM4A register is changed automatically. Thus, you cannot use the firmware Pin_1_Write(0); or Pin_1_Write(1); to control the GPIO output level.


    If it is necessary to control the GPIO output, change the inner connection by changing the HSIOM4A register manually. The project schematic of an example project attached with this article is shown in Figure 1.


    Figure 1. Project Schematic

    1.pngThis project uses Port 0_Pin 2 as Pin_1. The following code is used to modify the HSIOM_PORT_SEL0 register.




    Pin_1 will be configured as a GPIO. Refer to PSoC4 Register TRM for details.