This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

EK-TM4C123GXL: What should be the reason for not able to see data using UART1 with PC4 and PC5 pins?

Part Number: EK-TM4C123GXL

Hello

In my project UART1 is used to receive the data from the processor so according to schematic of the project PC4 and PC5 of the controller are connected to the processor. So i was trying to access UART1 on the EK-TM4C123GXL while doing so i was able to send and receive data on the UART1 by using PB0 and PB1 but when i tried same code with little changes for PC5 and PC4, then with these pins data sending and receiving is not working. I'm attaching , my code below. Any help will be really appreciated!.

#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_memmap.h"
#include "driverlib/gpio.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "driverlib/rom_map.h"

int
main(void)
{
    //
    // Set the clocking to run directly from the external crystal/oscillator.
    // TODO: The SYSCTL_XTAL_ value must be changed to match the value of the
    // crystal on your board.
    //


    SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
                   SYSCTL_XTAL_16MHZ);
    //
    // Enable Peripheral Clocks 
    //
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);
    MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);

    //
    // Enable pin PC5 for UART1 U1TX
    //
    MAP_GPIOPinConfigure(GPIO_PC5_U1TX);
    MAP_GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_5);

    //
    // Enable pin PC4 for UART1 U1RX
    //
    MAP_GPIOPinConfigure(GPIO_PC4_U1RX);
    MAP_GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_4);

    //
    // Configure the UART for 115,200, 8-N-1 operation.
    // This function uses SysCtlClockGet() or ui32SysClock to get the system clock
    // frequency.  This could be also be a variable or hard coded value
    // instead of a function call.
    //

    UARTConfigSetExpClk(UART1_BASE, SysCtlClockGet(), 115200,
                        (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
                         UART_CONFIG_PAR_NONE));

    //
    // Put a character to show start of example.  This will display on the
    // terminal.
    //
    UARTCharPut(UART1_BASE, '@');


    //
    // Return no errors
    //
   return(0);
}

  • Hi Omkar,

      I tried to run your code on the EK-TM4C123 LaunchPad and I don't see any problem on PC5 for TX.  I can see the character put out on the scope. I don't have an external device connecting to the PC4. Please try another board to confirm if you have a problem on the other board. 

  • Hi Charles,

    I tried on the other board and it worked! surprisingly board is having issue, already i have given to hardware team. Thank you for the help.

    Regards,

    Omkar