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.

tiva TM4C1294XL uart 7 dont work

Other Parts Discussed in Thread: MAX232

hello my problem is that I can not capture data and send keyboard and read by the UART 7 or different from UART0. I'm working with TM4C1294XL launchpad and connect to the PC through a max 232 to view the data by hyperterminal.
I have taken as reference examples echo and qs but none of the 2 functions to set the uart7, UART2 or a different one.
thank you very much for your attention.

  • Hello Carlos,

    How have you configured the IO's for UART in question?

    Regards
    Amit
  • Thank you for your attention and for your prompt response, I do not know if you meant this:

    otherwise modify the file? or be inserted in a command file so that the uart7 or UART2 or uart6, functioning by console?
    I thank you for way too actually take three weeks and I could not solve this problem.

    void
    UARTIntHandler(void)
    {
    uint32_t ui32Status;
    // Get the interrrupt status.
    //ui32Status = ROM_UARTIntStatus(UART0_BASE, true);
    ui32Status = ROM_UARTIntStatus(UART7_BASE, true);
    //
    // Clear the asserted interrupts.
    //
    //ROM_UARTIntClear(UART0_BASE, ui32Status);
    ROM_UARTIntClear(UART7_BASE, ui32Status);

    //
    // Loop while there are characters in the receive FIFO.
    //
    // while(ROM_UARTCharsAvail(UART0_BASE))
    while(ROM_UARTCharsAvail(UART7_BASE))
    {
    //
    // Read the next character from the UART and write it back to the UART.
    //
    ROM_UARTCharPutNonBlocking(UART7_BASE, ROM_UARTCharGetNonBlocking(UART7_BASE));

    *********************************************************


    //*****************************************************************************
    void
    UARTSend(const uint8_t *pui8Buffer, uint32_t ui32Count)
    {
    //
    // Loop while there are more characters to send.
    //
    while(ui32Count--)
    {
    //
    // Write the next character to the UART.
    //
    ROM_UARTCharPutNonBlocking(UART7_BASE, *pui8Buffer++);
    }
    }

    //*****************************************************************************
    int
    main(void)
    {
    //
    // Set the clocking to run directly from the crystal at 120MHz.
    //
    g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
    SYSCTL_OSC_MAIN |
    SYSCTL_USE_PLL |
    SYSCTL_CFG_VCO_480), 120000000);
    //
    // Enable the GPIO port that is used for the on-board LED.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);

    //
    // Enable the GPIO pins for the LED (PN0).
    //
    ROM_GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_0);

    //
    // Enable the peripherals used by this example.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART7);
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);


    //
    // Enable processor interrupts.
    //
    ROM_IntMasterEnable();

    //
    // Set GPIO A0 and A1 as UART pins.
    //
    GPIOPinConfigure(GPIO_PC4_U7RX);
    GPIOPinConfigure(GPIO_PC5_U7TX);
    ROM_GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5);

    //
    // Configure the UART for 115,200, 8-N-1 operation.
    //
    ROM_UARTConfigSetExpClk(UART7_BASE, g_ui32SysClock, 115200,
    (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
    UART_CONFIG_PAR_NONE));

    //
    // Enable the UART interrupt.
    //
    ROM_IntEnable(INT_UART7);
    ROM_UARTIntEnable(UART7_BASE, UART_INT_RX | UART_INT_RT);

    //
    // Prompt for text to be entered.
    //
    UARTSend((uint8_t *)"\033[2JEnter text: ", 16);

    //
    // Loop forever echoing data through the UART.
    //
    while(1)
    {
    }
    }

    int
    main(void)
    {
    //
    // Set the clocking to run directly from the crystal at 120MHz.
    //
    g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
    SYSCTL_OSC_MAIN |
    SYSCTL_USE_PLL |
    SYSCTL_CFG_VCO_480), 120000000);
    //
    // Enable the GPIO port that is used for the on-board LED.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPION);

    //
    // Enable the GPIO pins for the LED (PN0).
    //
    ROM_GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_0);

    //
    // Enable the peripherals used by this example.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART7);
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);


    //
    // Enable processor interrupts.
    //
    ROM_IntMasterEnable();

    //
    // Set GPIO A0 and A1 as UART pins.
    //
    GPIOPinConfigure(GPIO_PC4_U7RX);
    GPIOPinConfigure(GPIO_PC5_U7TX);
    ROM_GPIOPinTypeUART(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_5);

    //
    // Configure the UART for 115,200, 8-N-1 operation.
    //
    ROM_UARTConfigSetExpClk(UART7_BASE, g_ui32SysClock, 115200,
    (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
    UART_CONFIG_PAR_NONE));

    //
    // Enable the UART interrupt.
    //
    ROM_IntEnable(INT_UART7);
    ROM_UARTIntEnable(UART7_BASE, UART_INT_RX | UART_INT_RT);

    //
    // Prompt for text to be entered.
    //
    UARTSend((uint8_t *)"\033[2JEnter text: ", 16);

    //
    // Loop forever echoing data through the UART.
    //
    while(1)
    {
    }
    }
  • Hello Carlos,

    The code looks fine.

    1. Have you checked that the UART Int Handler has been mapped to UART7 in the startup_ccs.c file?
    2. Have you checked the connection between MAX232 and the UART pins if the correct connections have been done?

    Regards
    Amit
  • Several points to check

    carlos bautista said:
    view the data by hyperterminal

    I always dread working with hyperterminal. Have you verified that your hyperterminal setup is working? 

    There are many other terminal programs out there.

    carlos bautista said:
    hello my problem is that I can not capture data and send keyboard and read by the UART 7 or different from UART0

    Measure that your signal is getting to/from the appropriate pins. 

    Do not rely on echo as the first program.  The first should be something that endlessly transmits a single character.  Preferably this character should be 0xAA or   0x55. These characters have alternating 1's and 0's so you can easily measure your baud rate.

    Until you have a transmit working with a known good baud rate, attempting an echo is a step too far.

    Robert

  • Hello Robert,

    Me too (Added a like for the post). I did a small experiment of using the code from Carlos, and converting the GPIO PA0 and PA1 as Input. Then wired the PC4 and PC5 from booster pack header to PA0 and PA1 on the LP. Bingo!!! UART 7 is working on ICDI...

    Regards
    Amit
  • Thanks for the borrowed time
    to the second question if I have reviewed and confirmed that the pins are connected well. also in the example code qs for achievement send and display any written message, through uartprintf although only 18 characters
    example
    the message is 123456789012345678901234567890 and hyper 123456789012345678 message only reaches the other data is lost.
    I just need to send one or two characters then this is no problem. but what I do not get is a data capture keyboard and display.

    to your question 1 is not that you refer and forgive my ignorance because I have little experience in this area, but what I understood is:

    startup_ccs.c

    UARTIntHandler extern void (void);

    #pragma DATA_SECTION (g_pfnVectors, ".intvecs")
    void (* const g_pfnVectors []) (void) =
    {
        (Void (*) (void)) ((uint32_t) & __ STACK_TOP)


    ...................
    ............

     UARTIntHandler // UART0 Rx and Tx
     IntDefaultHandler // UART7 Rx and Tx

    this is a difference if it is not correct change it

     UARTIntHandler // UART0 Rx and Tx
      UARTIntHandler // UART7 Rx and Tx

    Again thank you very much
  • Hello Carlos

    Change it to (why have the same handler to another interrupt when it has got nothing to do with UART7 Interrupt)

    IntDefaultHandler // UART0 Rx and Tx
    UARTIntHandler // UART7 Rx and Tx

    Also use TeraTerm instead of HyperTerminal (as Robert already suggested)

    Regards
    Amit
  • robert thanks
    if transmicion and a while (1) sent by the uartsend my name and always sends complete with a delay but I can not capture the keyboard.
      I deeply appreciate your interest
  • thanks again
    I'm already working with the TeraTerm and the problem continues.
    I am sure that the port sends the character on the keyboard, as the max 232 turn on  LED each keystroke.
    I also checked the max and is working well.
    I generated a question, you have to create lines of code in .c file to print to the console?
    I'm working with uart7 or UART2 or uart6 as they have pins on the launchpad but none of them work. plays configure some other different file .c or .h?
    I appreciate any other suggestions.
  • Now check that you are actually sending characters from the PC and that they make it across the transceiver

    Robert
  • Hello Carlos,

    The only difference on configuration aspect is the IO and UART Instance configuration. The basic code would still remain the same. To better understand what is happening can you draw a block diagram of your application?

    Regards
    Amit