1 Reply Latest reply on Jan 31, 2017 2:19 AM by GeonaP_26

    Dynamic reconfiguration of UART pins

      We are going to use PRoC for a new project.


      PRoC has 2 UART but we need to manage 3 serial devices.


      We would like to use SCB0 for bot Device1 and Device2 connecting one to pins P0.4, P0.5 (SCB0_UART_RX[1]. SCB0_UART_TX[1]) and Device2 to pins P1.4, P1.5 (SCB0_UART_RX[0]. SCB0_UART_TX[0])  and change the pin configuration dynamically (Device1 and Device2 don't have to communicate at the same time).


      Is it that possible or we have to use external hw switch?


      If it possible how can we do this using PSoC 4 Creator?

        • 1. Re: Dynamic reconfiguration of UART pins

          We can make use of High Speed I/O Matrix (HSIOM) register to dynamically switch between UART pins. Since SCB[0] tx is connected to SCB0_UART_TX[1] and SCB0_UART_TX[0] and similarly SCB[0] rx to SCB0_UART_RX[1] and SCB0_UART_RX[0], we can achieve the purpose by enabling and disabling required pins with corresponding HSIOM registers.


          ❐ Suppose to disable connection of P0[4], P0[5]


          ❐ Suppose to enable connection of P0[4], P0[5] 
                  CY_SET_REG32(CYREG_HSIOM_PORT_SEL0, CY_GET_REG32(CYREG_HSIOM_PORT_SEL0) | 0x00990000);


          Please find attached project for details. 
          Geona Mary