How long does it take to call the interrupt function of comparator?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-05-22 8:04 PM
I tested with NUCLEO-F303ZE (72Mhz clock).
I checked the time when comparator makes interrupt as below
------------------------------------------------------------------------------------
void COMP7_IRQHandler(void)
{
DRV_GPIO_Port->BSRR = (uint32_t)DRV_Pin;
DRV_GPIO_Port->BRR = (uint32_t)DRV_Pin;
HAL_COMP_IRQHandler(&hcomp7);
}
------------------------------------------------------------------------------------
I found that it almost takes 600ns.
Did I have a mistake or Its is normal ?
- Labels:
-
COMP
-
STM32F3 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-05-30 4:08 PM
Doesn't sound much out of ordinary. Interrupts in 32-bit mcu have significant overhead. In Cortex-M4 the minimum ISR entry is 12 cycles, plus there is the C function prologue (which may be worsened by FLASH and RAM latency) and any setup needed to perform the GPIO writes.
Have you tried to play with compiler optimizations?
JW
