Dynamic reconfiguration of UART pins

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

cross mob
Anonymous
Not applicable

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?

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

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]
        CY_SET_REG32(CYREG_HSIOM_PORT_SEL0, CY_GET_REG32(CYREG_HSIOM_PORT_SEL0) & 0xFF00FFFF); 

   

❐ 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. 
 
Regards,
Geona Mary

View solution in original post

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

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]
        CY_SET_REG32(CYREG_HSIOM_PORT_SEL0, CY_GET_REG32(CYREG_HSIOM_PORT_SEL0) & 0xFF00FFFF); 

   

❐ 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. 
 
Regards,
Geona Mary

0 Likes