cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

New Contributor

I have found this article, which explains how to configure a pullup for the RX pin of an SCB UART via firmware. However, what is not clear to me is the following:

1. If the UART RX pin is configured to be controlled by firmware, does this mean that standard full duplex does not work until the SCB UART has been reconfigured with its default functionality?

2. I cant find the following command in PSOC creator 4.2: UART_pin_SetDriveMode(UART_pin_DM_RES_UP);

  What should this command be in PSOC creator 4.2? Does a hardware pin called UART_pin need to be placed on the schematic?

0 Likes
Reply
1 Solution
Moderator
Moderator

Hi

If you require the UART pins to be controlled firmware (like a regular GPIO), then CY_SET_REG32 (CYREG_HSIOM_PORT_SEL0, temp); API must be called afterwards to restore the normal operation. If you require the UART pins to be configured as resistive pull up, then UART_pin_SetDriveMode(UART_pin_DM_RES_UP); API must be called and this will configure the pins. In this case, CY_SET_REG32 (CYREG_HSIOM_PORT_SEL0, CY_GET_REG32 (CYREG_HSIOM_PORT_SEL0) & 0xFFFFFFF0); API need not be called. The UART will still function in duplex mode.

Therefore, if you require only the drive mode to be changed,

// Set the drive mode of UART Rx pin

UART_pin_SetDriveMode(UART_pin_DM_RES_UP);

is the only statement that needs to be called and this will change it without affecting UART operation.

Thanks and regards
Harigovind

View solution in original post

0 Likes
Reply
5 Replies
Employee

If you put a UART component named as "UART" a pin named as "rx"  is contained in the "UART" component.  The pin name is "UART_rx"

GS004377.png

The function UART_rx_SetDriveMode() is declared and defined in the UART_rx.c and UART_rx.h files.

GS004378.png

Please note that some series of PSoC 4 may not support this function.  Which PSoC 4 are you going to use?

Regards,

Noriaki

0 Likes
Reply
New Contributor

Ok. I have found this function for my PSOC. However, what I want to achieve is full duplex operation with the UART with the internal pullups.

0 Likes
Reply
Moderator
Moderator

Hi JS_4155161

1. If the UART RX pin is configured to be controlled by firmware, does this mean that standard full duplex does not work until the SCB UART has been reconfigured with its default functionality?

Yes. CY_SET_REG32 (CYREG_HSIOM_PORT_SEL0, temp); statement loads the default functionality (by connecting it to the SCB block). After this, the UART block can be used for full duplex transmission.

Thanks and regards

Harigovind

0 Likes
Reply
New Contributor

Hi, Does this mean that if the UART pins are first configured with pullup resistors and afterwards the default functionality of the SCB UART block is restored, then the UART will work as expected and the internal pullups will be used?

0 Likes
Reply
Moderator
Moderator

Hi

If you require the UART pins to be controlled firmware (like a regular GPIO), then CY_SET_REG32 (CYREG_HSIOM_PORT_SEL0, temp); API must be called afterwards to restore the normal operation. If you require the UART pins to be configured as resistive pull up, then UART_pin_SetDriveMode(UART_pin_DM_RES_UP); API must be called and this will configure the pins. In this case, CY_SET_REG32 (CYREG_HSIOM_PORT_SEL0, CY_GET_REG32 (CYREG_HSIOM_PORT_SEL0) & 0xFFFFFFF0); API need not be called. The UART will still function in duplex mode.

Therefore, if you require only the drive mode to be changed,

// Set the drive mode of UART Rx pin

UART_pin_SetDriveMode(UART_pin_DM_RES_UP);

is the only statement that needs to be called and this will change it without affecting UART operation.

Thanks and regards
Harigovind

View solution in original post

0 Likes
Reply