Reconfigure pins for I2C to Digital Output

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

cross mob
MaPe_1936286
Level 3
Level 3
First like received First like given Welcome!

Hi.

Is it possible to use 2 pins both for I2C Slave and for Digital Output (Strong Drive mode)?

I don’t need to switch between I2C and Digital Output at runtime, I just need to set them at startup according to a Digital Input state (high=2 pins in I2C mode; low=2 pins in Digital Output mode).

Thanks

Maurizio

0 Likes
1 Solution
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello Maurizio,

It is possible to use two pins both for I2C Slave and for Digital Output

Each port in PSoC 4 has a dedicated High Speed I/O Matrix (HSIOM) register. The value in this register determines the source which is connected to each GPIO pin in that particular port. Each HSIOM register is 32-bit wide, where four bits are allocated for each pin in that port.

The 4 bits corresponding to each pin can be configured to select proper source for the GPIO.

Please refer to the following KBA link to switch a GPIO between different sources: https://www.cypress.com/comment/362321

You can follow similar steps to configure the pins as I2C Slave pins or digital output pins depending on the digital input state.

For more details on HSIOM you can refer to the High Speed I/O Matrix section of the Architecture TRM of the device you are using.

Please feel free to update in case of any clarification.

Best regards

Ekta

View solution in original post

0 Likes
1 Reply
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello Maurizio,

It is possible to use two pins both for I2C Slave and for Digital Output

Each port in PSoC 4 has a dedicated High Speed I/O Matrix (HSIOM) register. The value in this register determines the source which is connected to each GPIO pin in that particular port. Each HSIOM register is 32-bit wide, where four bits are allocated for each pin in that port.

The 4 bits corresponding to each pin can be configured to select proper source for the GPIO.

Please refer to the following KBA link to switch a GPIO between different sources: https://www.cypress.com/comment/362321

You can follow similar steps to configure the pins as I2C Slave pins or digital output pins depending on the digital input state.

For more details on HSIOM you can refer to the High Speed I/O Matrix section of the Architecture TRM of the device you are using.

Please feel free to update in case of any clarification.

Best regards

Ekta

0 Likes