heinbali01 wrote on Friday, March 27, 2015:
Same thoughts as Dave: you might want to compare different ways of setting an event from your ISR:
BaseType_t xTaskNotifyFromISR( TaskHandle_t xTaskToNotify, uint32_t ulValue,
eNotifyAction eAction, BaseType_t *pxHigherPriorityTaskWoken );
BaseType_t xSemaphoreGiveFromISR( SemaphoreHandle_t xSemaphore,
BaseType_t *pxHigherPriorityTaskWoken );
Dave is right that event’s are less useful/efficient when used from an interrupt:
BaseType_t xEventGroupSetBitsFromISR( EventGroupHandle_t xEventGroup,
const EventBits_t uxBitsToSet, BaseType_t *pxHigherPriorityTaskWoken );
Event-groups are very efficient and handy when used among different tasks. Like Queue’s, they can have many “givers” and many “takers”, each with different priorities.
FreeRTOS+TCP uses Event-groups to implement API calls (and more). As soon as an API call has been handled by the library, an event bit will be set to wake-up the caller.
And of course, you’ll have to avoid long-lasting critical sections, during which your ISR is disabled (and thus delayed).
Is your task always in a blocked state? Or is it doing other things as well?
Flash versus SRAM: The LPC1769 has a fast internal flash. I don’t know if moving the ISR code to SRAM would still make it faster. You could give it a try.
I think that you will get the latency down to below 1 uS.