Software Serial IrqHandler

Good afternoon,
I’m working with an Arduino Nano 33 Iot, and I decided to create a Software serial that I saw in Internet (Here). In that program it uses this Interrupt handler, but I don’t understand why?. Can somebody explain me why this is needed in my code.
Thank you,

Uart SoftwSerial (&sercom0, 5, 6, SERCOM_RX_PAD_1, UART_TX_PAD_0);

void SERCOM0_Handler()
{
SoftwSerial.IrqHandler();
}

That is the way the author designed the program.

What do YOU want to do?

That article has nothing to do with Software Serial. In fact, the first sentence reads: “There is no SoftwareSerial.h available for the Arduino Nano 33 IoT because it is not required.”

Sorry, It has SERCOM ports to enable them to act as a Serial port. But I’m asking about the handler that I put.

I want to know when this handler is executed

I’m going to guess that the “SERCOMx_Handler” names are somehow associated with the various processor interrupt vectors somewhere in the build processes. Similar to how names such as “TIMER0_COMPA_vect” are assigned as handlers for the various interrupt vectors in an AVR processor.

So, those handlers would execute when the associated interrupt occurs.

In the AVR world, most of the time, you have an interrupt vector for UART receive, and a separate interrupt vector for UART transmit complete. ARM, on the other hand, have a “global” interrupt for some of its peripheral. A single interrupt vector that covers UART transmit, UART received, errors, etc for a particular peripheral. You have to check a status register in the ISR to determine which caused the interrupt.

So this interrupt is called when the transmission is done right?

Only if you enable the “Transmit Complete Interrupt Enable” bit.

There’s also the “Received Complete Interrupt Enable”, “CTS”, “RTS”, etc. All of these contribute to the global SERCOM interrupt (if enabled) and will trigger the SERCOM handler. That’s why you have to check a flag to determine which of these interrupt sources triggered the interrupt

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.