SCB Uart Pin Change run time to Input GPIO

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

cross mob
BiBr_4596811
Level 2
Level 2
5 replies posted 5 questions asked 5 sign-ins

Hello,

I am using PSOC4100S MCU CY8C4147AZI-S445 with PSOC Creator 4.2.

I want to switch Pins(P3.0(RX) and P3.1(TX))  from UART SCB to Input pins. 

I followed this link.

In this Uart port is stopped, but In Uart tx pin, it reads value 0, but on the it is 3.3V (tested with multimeter). I used following code:

 

 

temp = CY_GET_REG32 (CYREG_HSIOM_PORT_SEL3);

        // Configure UART_Rx pin to be controlled in firmware

        CY_SET_REG32 (CYREG_HSIOM_PORT_SEL3, CY_GET_REG32 (CYREG_HSIOM_PORT_SEL3) & 0xFFFFFF00);

        // Set the drive mode of UART Rx pin

        UART_1_tx_SetDriveMode(UART_1_tx_DM_RES_UP);
        //CY_SET_REG32 (CYREG_HSIOM_PORT_SEL3, temp);

 

 

 

Please help me for this issue.

Thank You 

0 Likes
1 Solution
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @BiBr_4596811 , You need to enable the Digital input driver to read the external digital input of the pin. Please check the GPIO_PRTx_PC2 register (where x is the port number)  to enable or disable the input enable register. For the RX pin this should have been already enabled. Tx is an output pin, therefore the Digital input driver will be disabled in the start up code. You need to set this bit to 0 to enable the input driver for the TX pin. Please refer register TRM for details on how to use this register.

https://www.cypress.com/file/280661/download

BragadeeshV_0-1615467514853.png

 

Regards,
Bragadeesh

View solution in original post

2 Replies
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @BiBr_4596811 , You need to enable the Digital input driver to read the external digital input of the pin. Please check the GPIO_PRTx_PC2 register (where x is the port number)  to enable or disable the input enable register. For the RX pin this should have been already enabled. Tx is an output pin, therefore the Digital input driver will be disabled in the start up code. You need to set this bit to 0 to enable the input driver for the TX pin. Please refer register TRM for details on how to use this register.

https://www.cypress.com/file/280661/download

BragadeeshV_0-1615467514853.png

 

Regards,
Bragadeesh
BiBi_1928986
Level 7
Level 7
First comment on blog 500 replies posted 250 replies posted

Hello.

The link you found is for PSoC 4 (like CY8C4245) with HSIOM and DSI inter-connection.  Similar discussion found at this link:
Solved: How to share IO between SPI module and I/O Pin fun... - Cypress Developer Community

However, CY8C4147 device is HSIOM and SMART I/O.  So, only some information from above web links is applicable.

I do not have a good answer for you as I am not familiar with SMART I/O.

I would suggest you read the register description:
PSoC(R) 4100S Plus PSoC 4 Registers Technical Reference Manual (TRM) (cypress.com)

And go through the architecture description:
PSoC 4100S and PSoC 4100S Plus: PSoC 4 Architecture Technical Reference Manual (TRM) (cypress.com)

to get a better understanding of how GPIO pins are connected/disconnected from internal functions, such as SCB UART.

There is also this web link with discussion about SMART I/O and GPIO connections you might find interesting.  It doesn't answer your question, but it has good descriptions.
Solved: PSoC 4100S Plus Digital Inputs and Digital Outputs... - Cypress Developer Community

You could also build a simple project that only configures the GPIO the way you want them.  Then, look at the register initialization in the configuration files generated by Creator.  This will give you the binary info for the writing to the registers.

Good luck with your project.

 

0 Likes