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` is ASCII.
Attachment 2154
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:
Following is the configuration used for Tx and Rx pins. It is one of the standard examples provided by Infineon with slight modifications.
Regards,
Andrey
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` is ASCII.
Attachment 2154
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.
Code:
#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;
}
Andrey