cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4

JaSi_1632926
Contributor

Hello, During factory testing (on board level - where we have several unconnected ports) we'd like to detect soldering issues on GPIOs. One neat way to do this is to iterate over all the unconnected GPIOs, set one of them to output (digital high), and read in the rest (they should all be 0). However, in order to do this we need to be able to dynamically reconfigure the port direction and drive strength. Is this possible during runtime? We need to be able to turn an input pin to an output pin, and vice versa. Thanks, Jacob

0 Likes
1 Solution
Bob_Marlowe
Expert II

As long as you don't disable the input buffer in pin's configuration the pins will be input and output. So you can read the pins at any time. Output should be configured as "high impedance digital" when reading.

Bob

View solution in original post

0 Likes
3 Replies
Bob_Marlowe
Expert II

You may change the pins drive mode at any time. See pin datasheet, Pin_SetDriveMode() API and the drive mode constants.

Bob

0 Likes
JaSi_1632926
Contributor

Yes, but that won't change the direction, will it?

- Jacob

0 Likes
Bob_Marlowe
Expert II

As long as you don't disable the input buffer in pin's configuration the pins will be input and output. So you can read the pins at any time. Output should be configured as "high impedance digital" when reading.

Bob

View solution in original post

0 Likes