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.
Tool/software:
Hi everyone,
I wanted clarification on how exactly the SCI FIFO TRANSMIT INTERRUPTS work. From my understanding the transmit FIFO generates interrupt when the data in the FIFO falls below the preconfigured threshold.
If this is true every time the threshold falls below the FIFO level even by one , it generates interrupts regardless of if you have data to transmit or not. How can i only generate interrupt in FIFO if and when i call the API for writing data into my FIFO. Otherwise i don't need to generate interrupts. I want to use FIFO instead of normal transmission because i want to ensure the data is sent reliably. I'm not sure if this approach is flawed or not , please correct me if i am wrong in any of this.
Currently i am facing the issue where interrupts are generated in absurd amounts even though i don't have anything to transmit. So any insights regarding this matter is welcome.
Thank you in advance
Ashwin Bhaskar A
Hi Ashwin,
From my understanding the transmit FIFO generates interrupt when the data in the FIFO falls below the preconfigured threshold.
If this is true every time the threshold falls below the FIFO level even by one , it generates interrupts regardless of if you have data to transmit or not.
Your understanding is correct.
How can i only generate interrupt in FIFO if and when i call the API for writing data into my FIFO
To do this, you can just call the TX FIFO write function (SCI_writeCharArray()) to write to the TX FIFO in your main code whenever you have data ready to send; there should be no TX interrupt needed. This function will wait in a polling loop until there is enough space in the FIFO to write all of your data.
If you're worried about a performance hit due to polling loops in your main code, you could take the approach of enabling the SCI TX interrupt in your main code whenever you're ready to transmit data and then disabling it in your ISR. Then the interrupt will happen (most likely immediately) whenever you enable it, and the FIFO has enough space. If you're transmitting infrequently and with less than 16 characters at a time though, you shouldn't see any performance issues, in which case I would recommend just calling SCI_writeCharArray() when you're ready to transmit.
Best Regards,
Delaney
Hi Delaney
Thank you for your prompt response.
you could take the approach of enabling the SCI TX interrupt in your main code whenever you're ready to transmit data and then disabling it in your ISR. Then the interrupt will happen (most likely immediately) whenever you enable it, and the FIFO has enough space. If you're transmitting infrequently and with less than 16 characters at a time though, you shouldn't see any performance issues, in which case I would recommend just calling SCI_writeCharArray() when you're ready to transmit.
I will try this method and test it to see if i can use it in my time critical application.
The frequency of how often i will be transmitting data is still unclear to me as i am at beginning of the development phase. I will need to test this to see if i can reliably transmit and receive data .
I will get back to you with updates.
Warm Regards
Ashwin
Hi Ashwin,
Sounds good, I will close this thread for now then, but feel free to make another one if you have any more questions or see issues with this solution.
Best Regards,
Delaney