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.

TM4C1294NCPDT: Problems with the baurate and data transmission.

Part Number: TM4C1294NCPDT
Hello!

I have a problem with Serial communication.
In a serial terminal (Termite) the baudrate is set to 14400 baud although in the code,
the UARTConfigSetExpClk () function is set to 9600 baud, data looks fine in
Termite but when passing the data to LabVIEW, I just see characters that do not correspond to the plot regardless
the baudrate.

Thanks!
  • Make sure that you are passing the correct system clock value to the function UARTConfigSetExpClk(). It looks like you are running at 120MHz but passed 80MHz. Make sure you do not use the function SysCtlClockGet(). That function is for TM4C123x devices only.

        g_ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
                                           SYSCTL_OSC_MAIN |
                                           SYSCTL_USE_PLL |
                                           SYSCTL_CFG_VCO_240), 120000000);
    ...
        UARTConfigSetExpClk(UART0_BASE, g_ui32SysClock, 9600,
                (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
    

  • Hi!
    Thanks for your reply. My configuration is as follows:
    
     g_ui32SysClock = SysCtlClockFreqSet ((SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 10000000);
    
     UARTConfigSetExpClk (UART1_BASE, g_ui32SysClock, 9600, (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));
    I set up the code like the example but it didn't work, it marks an error on the line "SYSCTL_CFG_VCO_240" so I used SYSCTL_CFG_VCO_480 ".




  • I set up the code like the example but it didn't work, it marks an error on the line "SYSCTL_CFG_VCO_240" so I used SYSCTL_CFG_VCO_480 ".

    You may be using an older version of TivaWare. "SYSCTL_CFG_VCO_240" was introduced in version 2.2.0.295. Using "SYSCTL_CFG_VCO_480" will produce the same results.

  • I'm really sorry, I didn't understand the last part very well, if I set the function to 480, I get the same response as if I set it to 240?
  • There is an issue documented in the errata document as SYSCTL#22. Starting with TivaWare version 2.1.3, the function SysCtlClockFreqSe() used a VCO frequency of 240MHz instead of 480MHz to avoid this issue even though SYSCTL_CFG_VCO_480 was selected. This led to some confusion. Starting with TivaWave version 2.2.0.295, the definition SYSCTL_CFG_VCO_240 was added. Now using SYSCTL_CFG_VCO_240 or SYSCTL_CFG_VCO_480 will result in a VCO frequency of 240MHz and avoid the issue SYSCTL#22.

  • Hi!
    
    I already updated the Tivaware and modified the value of SysCtlClockFreqSet () with 240, 
    but the baudrate still has the same problem, I cannot see the data at 9600 baud or at
    14400. Now I cannot see the data in Termite.
  • Please export your project to a .zip file and post it. However, I am on holiday for the rest of this week and will not be able to look at it until next week.

  • Hi!
    Thank you very much for reviewing it! 
    I tried the program and most of the time it shows a correct result (a string HELLO WORLD),
    there are times that it shows the data as if the baudrate is not right. The name of the
    project is GPIO2.
    PROYECTO.rar
    
    
  • I am sorry. I do not have hardware that I can run your code on. My hardware has UART1TX tied to VBUS on USB. 

    I do not see any issues with the frequency setup or the baud rate setup. Could it be that the port receiving the data is confused by the RS232 levels during the device startup? Have you tried resetting the serial port on the device receiving the message from the TM4C?

  • Hi!

    No, I have not tried to restart it. Could you tell me how to do it?
    
    
  •  I don't use Termite, but you might try closing and re-openning the application. On TeraTerm from the menu you choose "Control" -> "Reset port"