+ Reply to Thread
Results 1 to 4 of 4

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

  1. #1
    Beginner Beginner agrus has a spectacular aura about
    Join Date
    Jan 2016
    Posts
    72
    Points
    106.875

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

    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.


    Click image for larger version

Name:	hdiPr.png
Views:	0
Size:	9.1 KB
ID:	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; }
    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!
    Last edited by agrus; Mar 17th, 2016 at 10:37 AM.

  2. #2
    chismo is on a distinguished road
    Join Date
    Apr 2013
    Posts
    267
    Points
    2451.25
    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

  3. #3
    Beginner Beginner agrus has a spectacular aura about
    Join Date
    Jan 2016
    Posts
    72
    Points
    106.875
    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

  4. #4
    chismo is on a distinguished road
    Join Date
    Apr 2013
    Posts
    267
    Points
    2451.25
    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

+ Reply to Thread

Tags for this Thread

Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.