1 Reply Latest reply on Feb 3, 2019 10:29 PM by GaneshD_41

    Switching Capsense Pins


      So I am using the CY8CKIT-042 PSoc 4 Pioneer Kit, and I am using two pins for capsense, one as a sensor and one as a driven shield. At a certain point I would like to switch these pins, one to be a 5v signal and one to read an analog sensor.


      I looked at https://www.cypress.com/file/122336/download

      at the HSIOC section and I think I would need to switch capsense to be GPIO as follows.



      Is this right? And now how do I setup these pins as a high signal and an analog sensor now that they are GPIO?


      so far I have performed my capsense function, and I have written  CY_SET_REG32(CYDEV_HSIOM_BASE, CYVAL_HSIOM_SEL0_GPIO); to change the pins to be GPIO

        • 1. Re: Switching Capsense Pins



          To change the pin mode to Analog you have to set the HSIOM_SEL0[3:0] directly to AMUXBUSA or AMUXBUSB. You don't need to use GPIO mode in between. Please refer corresponding port's HSIOM_SEL0 bit definitions in the register TRM of PSoC 4200. For example please refer page number 185 of the architecture TRM.




          After changing the pin to analog mode you have to disable the input buffer of the pin. For this please refer to the register PRT_PCx register.


          It is not possible to connect the pins to 5V unless the VDDIO is 5V.  If VDDIO is 5 volts you can connect the pin to 5V. These are the following steps:

          1. Change the HSIOM_SEL0 of the pin to GPIO.

          2. Change the drive mode of the pin to Resistive pull-up.

          3. Write 1 to the pin.