1 Reply Latest reply on Sep 25, 2019 2:58 AM by EktaN_26

    Reconfigure pins for I2C to Digital Output

    MaPe_1936286

      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

        • 1. Re: Reconfigure pins for I2C to Digital Output
          EktaN_26

          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