USIC/UART - PuTTY won't show Tx data; Tx pin is working

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

cross mob
Not applicable
Hi all,

In short, I am trying to send data to my PC over UART and PuTTY won't show anything in its terminal window (same goes for Docklight, although I used it very briefly). I have tried watching the output of the Tx pin with an oscilloscope, and it seems to transmit the data as it should. Below is a sample capture of the signal transmitting `0x55` or `U` in ASCII.


1917.attach


However, nothing shows up in PuTTY. There are a few things that I have tried in order to find the source of the problem. The board is XMC4400 kit. Here are a few observations:

1. Identical code works on XMC4700 board with the same cable (i.e. `U` shows up in PuTTY and Docklight with the appropriate settings).

2. If physically shorted together, Rx and Tx pins work fine in the loopback mode, but nothing is reflected in the terminal window.



Following is the configuration used for Tx and Rx pins. It is one of the standard examples provided by Infineon with slight modifications.

#include "xmc_uart.h"
#include "xmc_gpio.h"
#include "xmc_usic.h"

int main(void)
{
XMC_GPIO_CONFIG_t rx_config = {
.mode = XMC_GPIO_MODE_INPUT_TRISTATE,
.output_level = XMC_GPIO_OUTPUT_LEVEL_HIGH,
.output_strength = XMC_GPIO_OUTPUT_STRENGTH_STRONG_SOFT_EDGE
};


XMC_GPIO_CONFIG_t tx_config = {
.mode = XMC_GPIO_MODE_OUTPUT_PUSH_PULL_ALT2,
.output_level = XMC_GPIO_OUTPUT_LEVEL_HIGH,
.output_strength = XMC_GPIO_OUTPUT_STRENGTH_STRONG_SOFT_EDGE
};

XMC_UART_CH_CONFIG_t uart_config = {
.baudrate = 19200,
.data_bits = 8,
.frame_length = 8,
.stop_bits = 1,
.oversampling = 16,
.parity_mode = XMC_USIC_CH_PARITY_MODE_NONE
};




/*Initialize and configure UART0 on channel 0 */
XMC_UART_CH_Init(XMC_UART0_CH0, &uart_config);

/*Configure RX*/
XMC_GPIO_Init(P1_4, &rx_config);

/*Configure TX*/
XMC_GPIO_Init(P1_5, &tx_config);

/*Set input source path*/
XMC_USIC_CH_SetInputSource(XMC_UART0_CH0, XMC_USIC_CH_INPUT_DX0, 1U);

/*Configure transmit FIFO*/
XMC_USIC_CH_TXFIFO_Configure(XMC_UART0_CH0, 16U, XMC_USIC_CH_FIFO_SIZE_16WORDS, 1U);

/*Configure receive FIFO*/
XMC_USIC_CH_RXFIFO_Configure(XMC_UART0_CH0, 0U, XMC_USIC_CH_FIFO_SIZE_16WORDS, 15U);

/*Start UART */
XMC_UART_CH_Start(XMC_UART0_CH0);

while (1)
{
XMC_UART_CH_Transmit(XMC_UART0_CH0, 0x55);

}
return 1U;
}


Regards,
Andrey

Edit:

This seems to be a connection problem somewhere on the board. The designated output pin (P1_5 on my board) is working fine when I monitor it's output with a scope. However, this signal does not make it to the host (PC). Could you please let me know if there's a way I can verify if this is a hardware problem or not? Thank you!
3 Replies
chismo
Employee
Employee
First like received
Hello Andrey,

For the XMC4400 card, the COM port is using P1.7 as TXD and P1.5 as RXD, unlike XMC4700 Relax kit.

Regards,
Min Wei
0 Likes
Not applicable
Hi Min Wei,

Thank you so much - this fixed the problem. I am curious, however - the two pins, P1.7 and P1.5 both have U0C0.DOUT0 as one of their alternative functions. Does this mean that both pins are capable of acting as a TXD?

Regards,
Andrey
0 Likes
chismo
Employee
Employee
First like received
Hello Andrey,

Yes, your understanding is correct because the single DOUT0 output signal is connected to multiple pins.
And whether a particular output function is enabled at a pin depends of the configuration of the individual pin.

Therefore, if the DOUT0 is selected at both P1.5 and P1.7 for example, then both will output the same TXD signal.

Regards,
Min Wei