I am looking for ways to reduce interrupt latency when using uCOS-II. I am working with an AT91SAM7S running at 24 MHz.
The background: My application needs to respond to a received UART byte within 12.5 us, which includes some (minor) processing of the received byte and sending out an answer.
Right now, I am using the SAM7S port v. 1.84. and enable interrupt nesting by using the sequence
in OS_CPU_ExceptHndlr. The UART interrupt has the priority AT91C_AIC_PRIOR_HIGHEST, the other active interrupts (PIT and SPI) use lower priorities. The firmware uses three tasks, two mailboxes to communicty between ISRs and tasks, and one mutex for communication between two tasks.
Code: Select all
OS_CPU_SR_IRQ_En(); (*pfnct)(); /* Execute the ISR for the interrupting device */ OS_CPU_SR_IRQ_Dis();
On average, the latency (end of parity bit of received byte to start bit of transmitted byte) is about 12.3 us, however, the latency varies between 6.4 us and 20.4 us.
Any advice on how to reduce the maximum latency?