SAM4 USART interrupt code example

donald01vukovic wrote on Monday, April 22, 2013:

Is there a sample code for using USARTx with interrupts in FreeRTOS ?

Thank you

rtel wrote on Monday, April 22, 2013:

Yes - there are numerous examples in the Atmel ASF (Atmel Software Framework).  Look of “FreeRTOS Peripheral Control” examples in the ASF download (  See


magpiesw wrote on Monday, April 22, 2013:

I am sorry, but I have looked at that for a week now and nothing I do works.

My code is stuck repeating the same USART1_handler() over and over again.

I tried to follow the SYS_TICK interrupt as a model, but that did not work.

I would guess that I am not actually clearing the USART1 interrupt, but I just do not see why I can not do it.

As soon as I enable that interrupt, it starts and does not end.

If pasting the code here would help, I will. ( I know its frowned upon)

Thank you (again)

edwards3 wrote on Tuesday, April 23, 2013:

I don’t think the example uses USART1_handler() because it uses the DMA interrupts instead. I could be wrong though.