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.

Supporting high baud rates onTiva

I am using the Tiva launchpad and am trying to read serial data at 4 Mbps from an external device.

According to the microprocessor datasheet the TM4C supports up to 5 Mbps.

I set the UART clock to the system clock of 80MHz and the internal oscillator at 16MHz

No matter what I try, I cannot get data without errors, usually overrun or framing.

I am using the driver library supplied by Tivaware to configure the UART. Does it have some limitations for baud rates ouside of the 'normal' e.g. up to 921600? Should I be setting each register manually?

  • Hi David,

    How do you configure UART speed?

    There is a bug in TivaWare:

    http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/p/348417/1322390.aspx#1322390

    So you can not use function SysCtlClockGet(). Use direct speed value or patch TivaWare.

  • No matter what I try, I cannot get data without errors, usually overrun or framing.

    What about the intermediary hardware ?

    Your levelshifter, USB-to-serial converter, cabling (or whatever you use toward the other end) must support this high bandwith, too. Even cables wich are too long or having non-matching impedance distorting your signal. Remember, a square wave signal of that frequency has significant portions of the spectrum in the VHF range, so cable impedance and termination are important. USB-to-Serial converter often specify an upper baudrate limit of less than 1 MBit.

    As a test, I would route the UART output to another internal UART of your TM4C device, keeping the cables as short as possible (or, instead, loopback to the same UART RX). If that works, software is not your problem.

  • f. m. said:
    What about the intermediary hardware ?

    Bravo f.m.!   Engineering discipline/regard pervades this (too) MCU-Centric site.

    Poster's "heavy duty" requirement was not accompanied w/appropriate, App descriptive specs.

    I do note poster's mention of, "internal oscillator" and (usually) those do not provide the long term, initial/temperature/aging/voltage frequency accuracy & stability of a properly implemented external xtal...

  • Thanks for the input. I saw the bug in the version of Tivaware installed on my home PC but my work PC has a later version with a fix.

    However after more work I discovered that my code was perfectly OK. It turned out that the device I connected to was faulty!

    What I eventually did was to configure the UART and then write the byte 0x80 in a continuous loop and look at the TX pin via a scope. A simple measurement of the gap between consecutive packets showed that the baud rate generator is spot on.

    With hindsight I should not have assumed that my data source was OK and avoid wasting a day chasing my tail.

  • Thanks for the reply.

    It turned out that I was making the faulty assumption that my customers device was OK when it fact is was faulty. 

    A simple check of writing 0x80 in a loop and connecting TX to a scope shows that the baud rate generator is spot on.

  • Good for you, Sir.  Recall the old adage, "He who assumes - makes an a** of you & moi."  Test/verify is not over-rated - we've "overflown mountains" to rescue clients - and found their "test" was (too often) a "guess/assumption."  Not good - and we did not relax/forgive our rightful time/travel charges...

    Perhaps better than 0x80 loop would be 0x55 or 0xAA or those patterns in sequence.  The regular "bit flips" enable simple "bit-time" measurements - and use of both codes exercises each/every bit - affirming signal correctness.

    Might you serve the community here - and reveal the highest baud rate you were able to achieve?  And - were RS232 level translators or UART to USB converters employed.  If so - maker & part no. would be of interest to many.

    Bon chance et merci...