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.

problem with UART

Other Parts Discussed in Thread: TM4C123GH6PM

sir/madam, I have used the below program for UART0 and i got the output .I'm using Putty terminal to view the output. Im using ccs compiler for debugging.

when using same  concept for other UART. Its not working. 

Here i have attached the program for UART0 and UART4

//this program is for UART0

#include<stdint.h>
#include<stdbool.h>
#include<sysctl.h>
#include<hw_memmap.h>
#include<gpio.h>
#include<hw_gpio.h>
#include<uart.h>
#include<interrupt.h>t
#include<tm4c123gh6pm.h>
#include<hw_types.h>

int main(void)
{
SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE,0xff);
GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE,0xff);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

GPIOPinConfigure(0x00000001);
GPIOPinConfigure(0x00000401);
GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));

UARTCharPut(UART0_BASE, 'E');
UARTCharPut(UART0_BASE, 'n');
UARTCharPut(UART0_BASE, 't');
UARTCharPut(UART0_BASE, 'e');
UARTCharPut(UART0_BASE, 'r');
UARTCharPut(UART0_BASE, ' ');
UARTCharPut(UART0_BASE, 'T');
UARTCharPut(UART0_BASE, 'e');
UARTCharPut(UART0_BASE, 'x');
UARTCharPut(UART0_BASE, 't');
UARTCharPut(UART0_BASE, ':');
UARTCharPut(UART0_BASE, '\n');

while (1)
{
// if (UARTCharsAvail(UART0_BASE)){ }
// while(UARTBusy(UART0_BASE)); UARTCharPut(UART0_BASE,a);
}
}

// this program is for UART4

#include<stdint.h>
#include<stdbool.h>
#include<sysctl.h>
#include<hw_memmap.h>
#include<gpio.h>
#include<hw_gpio.h>
#include<uart.h>
#include<interrupt.h>
#include<tm4c123gh6pm.h>
#include<hw_types.h>

int main(void)
{
SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3);
GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE,0xff);
GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE,0xff);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART4);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);

GPIOPinConfigure(0x00021001);
GPIOPinConfigure(0x00021401);
GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5);
UARTConfigSetExpClk(UART4_BASE, SysCtlClockGet(), 115200,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));

UARTCharPut(UART4_BASE, 'E');
UARTCharPut(UART4_BASE, 'n');
UARTCharPut(UART4_BASE, 't');
UARTCharPut(UART4_BASE, 'e');
UARTCharPut(UART4_BASE, 'r');
UARTCharPut(UART4_BASE, ' ');
UARTCharPut(UART4_BASE, 'T');
UARTCharPut(UART4_BASE, 'e');
UARTCharPut(UART4_BASE, 'x');
UARTCharPut(UART4_BASE, 't');
UARTCharPut(UART4_BASE, ':');
UARTCharPut(UART4_BASE, '\n');

while (1)
{
// if (UARTCharsAvail(UART4_BASE)){ }
// while(UARTBusy(UART4_BASE)); UARTCharPut(UART4_BASE,a);
}
}

If u can please send me an checked example program for UATR1 which would work with Tiva lanchpad.