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.

UART losing data

Hi,

I'm using Tm4C129x series controller in your project,

I'm using UART5  to communicate with the other board, other board will transmit huge data. Her I'm losing character in between.

I have configured baud rate as 115200. I'm receiving data at the UART interrupt ISR.

Please help me to avoid this data loss.

Thank you

Basavanagouda.

  • I'm using UART5  to communicate with the other board, other board will transmit huge data. Her I'm losing character in between.

    Why didn't you follow up that thought ?

    You lose characters because you need more time for processing, than you do for receiving.

    I'm receiving data at the UART interrupt ISR.

    Posting the UART interrupt code would be really helpful here. My guess - you are calling other, time-consuming functions from within the interrupt, causing lost characters. Perhaps printf() or similiar ...

    Try using hardware support, like the FIFO or DMA, which would reduce the interrupt rate by collecting "packages" of characters.

  • hi,

    thank you for your replay,

    I'm trying to prioritize UART5 interrupt, how I can do this?
    I'm not using CCS IDE to code it. I need do with register settings. I'm confused with the process of doing it.
    Please help me with procedure and example code.

    thank you
    Basavanagouda
  • I'm trying to prioritize UART5 interrupt, how I can do this?

    That's a bit quick - you don't know if concurrent interrupts are the core of your problem.

    If the issue is contained in the UART interrupt routine (i.e. you are spending too much time in that routine itself), prioritization will not help you.

    If you can't estimate run times by inspecting the source code (difficult, requires lots of experience), use a scope for visualization. Toggle a GPIO in all suspicious interrupt routines (up on entry, down on exit) especially the UART interrupt. View those GPIO, and the UART signal, on a scope. If possible, i.e. you have enough scope channels, create a trigger signal (toggle GPIO) on the UART overflow condition.

    Alternatively, present the relevant source code here.

    'm not using CCS IDE to code it.

    Neither do I. That should not matter, since the build/run steps seem to work.

  • f. m. said:
    I'm trying to prioritize UART5 interrupt, how I can do this?

    That's a bit quick - you don't know if concurrent interrupts are the core of your problem.

    If the issue is contained in the UART interrupt routine (i.e. you are spending too much time in that routine itself), prioritization will not help you.

    If you can't estimate run times by inspecting the source code (difficult, requires lots of experience), use a scope for visualization. Toggle a GPIO in all suspicious interrupt routines (up on entry, down on exit) especially the UART interrupt. View those GPIO, and the UART signal, on a scope. If possible, i.e. you have enough scope channels, create a trigger signal (toggle GPIO) on the UART overflow condition.

    Since you seem to headed off in the other direction, let me reinforce f.m.'s point here.

    Measure then fix is more productive and certain than fix and check.

    Robert