Hi @Manuel_Salas ,
Thank you for your support!
As per your suggestion, I implemented it using RTOS, but some hard delays still remain.
I am attaching a code snippet and a logic analyzer capture for your reference.
Channel-1: Output GPIO
Channel-2: PWM signal fed to input GPIO.
I am still confused about these hard delays. The clock root for the GPIO is around 133 MHz, yet register access still takes a significant amount of time.
static void hello_task(void *pvParameters)
{
for (;;)
{
// PRINTF("Hello world.\r\n");
taskENTER_CRITICAL();
state = GPIO_PinRead(INPUT_GPIO,INPUT_GPIO_PIN);
GPIO_PinWrite(EXAMPLE_LED_GPIO,EXAMPLE_LED_GPIO_PIN,state);
taskEXIT_CRITICAL();
// vTaskSuspend(NULL);
}
}