2023-08-14 06:07 AM - edited 2023-08-15 01:59 AM
Hi,
I was able to get a frame(result attached below) from Nucleo-WB55RG by controlling HSYNC and VSYNC with the help of EXTI. However, I have faced some pixel loss(pixels from the white color) at the beginning of each HSYNC. I suspected that the issue is due to "void EXTI2_IRQHandler(void)"'s CPU execution time(~5.5us) and it seems to be unavoidable. Thus, I want to solve this without using "External Interrupt Mode". Can I solve this with “External Event Mode” or do I have fast and advantageous (hardware-wise) other peripherals that I solve this issue? Basically, I want to detect an edge signal and do manipulations through Status registers without intervening CPU.
My Interrupt code: (PD1 pin dedicated for Vsync, both rising/falling edge detection. Structure is similar for HSYNC as well))
void EXTI1_IRQHandler(void)
{
if((__HAL_GPIO_EXTI_GET_FLAG(GPIO_PIN_1))&&(HAL_GPIO_ReadPin(GPIOD, GPIO_PIN_1)==GPIO_PIN_SET))
{
HAL_NVIC_EnableIRQ(EXTI2_IRQn);
// vsyncCount++;
__HAL_GPIO_EXTI_CLEAR_FLAG(GPIO_PIN_1);
}
else if((__HAL_GPIO_EXTI_GET_FLAG(GPIO_PIN_1))&&(HAL_GPIO_ReadPin(GPIOD, GPIO_PIN_1)==GPIO_PIN_RESET))
{
HAL_NVIC_DisableIRQ(EXTI2_IRQn);
__HAL_GPIO_EXTI_CLEAR_FLAG(GPIO_PIN_1);
}
}