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.

CCS/TM4C123GH6PM: UART faile

Part Number: TM4C123GH6PM

Tool/software: Code Composer Studio

I dont transmit data to terminal .I use UART3 in library tiva C.Can you help me?

/*
* main.c
*
* Created on: Oct 29, 2017
* Author: huong
*/
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <assert.h>
#include "inc/tm4c123gh6pm.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/interrupt.h"
#include "driverlib/gpio.h"
#include "driverlib/timer.h"
#include "driverlib/adc.h"
#include "driverlib/uart.h"
#include "inc/hw_ints.h"

int main()
{
SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART3);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
GPIOPinConfigure(GPIO_PC6_U3RX);
GPIOPinConfigure(GPIO_PC7_U3TX);
GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_6| GPIO_PIN_7);
UARTConfigSetExpClk(UART3_BASE, SysCtlClockGet(), 115200,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
UARTFIFOEnable(UART3_BASE);
UARTEnable(UART3_BASE);
IntMasterEnable(); //enable processor interrupts
IntEnable(INT_UART3); //enable the UART interrupt
UARTIntEnable(UART3_BASE, UART_INT_RX); //only enable RX
UARTFIFOLevelSet(UART3_BASE,UART_FIFO_TX1_8,UART_FIFO_RX1_8);
IntPrioritySet(INT_UART3,1);
while(1)
{
UARTCharPut(UART3_BASE,'x');
SysCtlDelay(SysCtlClockGet()/1000);
}
}

  • Hello,
    Your request is best served by the experts in the TM4C forum. I will move this thread there.

    Thanks
    ki
  • You don't specify the "signal level" required by your terminal. (It is assumed that you "seek" to "Send data from your MCU's UART to that terminal" - and it is that "send or receive" (or both) which fails.

    You are aware that the MCU's UART - without the addition of some, "Signal and/or Protocol Translator" is NOT "directly compatible" with most all such "terminals." (it is likely your terminal is a PC - running terminal program SW)

    The LPad's UART3 has no such, "Signal/Protocol" Translator - present nor attached. You must "add" such - before you can (successfully) transmit data to the terminal... Note that the LPad's UART0 includes such a device (on board) which explains "how" it is able to "send/receive" to/from a PC.
  • Hi huong,

    I agree with what cb1 said... if you are using a LaunchPad, UART3 isn't designed on the LaunchPad to instantly work on a PC terminal. Also it's not clear what connection you are making between the TM4C and the PC to send the data from UART 3 to the PC. More elaboration on your setup would be helpful if you think it is valid.