UART interrupt

Hi team, 

             I am using Segger 5.4 version and nordic SDK 16.0v for the nRF52840 microcontroller. I am working on UART peripheral to send and receive data through interrupt method. I am using UART_APP_FIFO_INIT()   API to generate interrupts. In the interrupt handler, I have given statements to transmit data and it is displayed in Putty. However, the data has been transmitted continuously (like a loop).

             I want to know how the interrupt is generated and also why it is occuring in loop? If it is in loop, what is the time period for the interrupt generation?

             Are there any other methods to generate interrupt for UART?

Parents
  • Hi 

    The UART and UARTE peripherals will typically generate interrupts every time data is transmitted or received over the UART. If you send more data every time the previous data was sent it makes sense that you would end up in a loop, where you keep sending data forever. 

    The idea behind the app_uart_fifo driver is that you should not need to worry about the interrupt handling directly. You just forward data to the app_uart_fifo interface, and it will be buffered and sent automatically. 

    Whenever there is RX data to process this will be forwarded to the application through a callback function. 

    Can you let me know what you want to use the UART for? 

    Are you just using it to send log messages, or something else? 

    Best regards
    Torbjørn

Reply
  • Hi 

    The UART and UARTE peripherals will typically generate interrupts every time data is transmitted or received over the UART. If you send more data every time the previous data was sent it makes sense that you would end up in a loop, where you keep sending data forever. 

    The idea behind the app_uart_fifo driver is that you should not need to worry about the interrupt handling directly. You just forward data to the app_uart_fifo interface, and it will be buffered and sent automatically. 

    Whenever there is RX data to process this will be forwarded to the application through a callback function. 

    Can you let me know what you want to use the UART for? 

    Are you just using it to send log messages, or something else? 

    Best regards
    Torbjørn

Children
No Data
Related