Can capsense pins be reassigned?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
brza_3998571
Level 1
Level 1

If you have created a capsense sensor, can the corresponding pins be reassigning at any time, or are they now dedicated capsense pins?

Can you set a capsense pin to be digital high or digital low?

0 Likes
1 Solution
RyanZhao
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hi Braeden,

Yes. the corresponding pin can be reassigned in run-time, but I think it is not "at any time". If required, the CapSense pin should be re-assigned after a full cycle of CapSense scan&process.

About how to re-assign it..Refer HSIOM parts in PSoC4 registers TRM.

For example, if you are using PSoC4000S, here is its regester TRM:

https://www.cypress.com/documentation/technical-reference-manuals/psoc-4000s-family-psocr-4-register...

Thanks,

Ryan

View solution in original post

0 Likes
5 Replies
RyanZhao
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hi Braeden,

Yes. the corresponding pin can be reassigned in run-time, but I think it is not "at any time". If required, the CapSense pin should be re-assigned after a full cycle of CapSense scan&process.

About how to re-assign it..Refer HSIOM parts in PSoC4 registers TRM.

For example, if you are using PSoC4000S, here is its regester TRM:

https://www.cypress.com/documentation/technical-reference-manuals/psoc-4000s-family-psocr-4-register...

Thanks,

Ryan

0 Likes

Thank you for the response.

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.

CY_SET_REG32(CYDEV_HSIOM_BASE, CYVAL_HSIOM_SEL0_GPIO);

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

0 Likes

Hi,

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.

https://www.cypress.com/file/136296/download

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.

Thanks

Ganesh

0 Likes

Ok so I did this and I was able to set the one pin high, and the other to be in analog mode with buffers disabled. I was wondering how I could send the signal from the analog pin to an ADC now that I have the pin in the correct mode. I have one in my top design, and I was wondering how I could send this signal to it during run time? or else what is the best way to approach this to get usable measurements from the pin during run time?

thanks Braeden

0 Likes

Reconfigure HSIOM register different values, pins will be re-assigned and routed to different component. Same for ADC input channel pins.

It is better to take care of other pins connection/configuration you don't want to change because there is no bit-operation of PSoC4 registers. 

Thanks,

Ryan

0 Likes