Hi guys. I am using nRF52840. Currently, I want to read out an image from a camera. The camera PCLK is toggled at 500Khz, and what I want to do is to trigger an interrupt every time the PCLK goes HIGH or RISING EDGE. However, I noticed that GPIOTE cannot go fast enough. Here is a waveform of PCLK and a test pin I set, test pin will toggle as long as gpiote detects a rising edge.
I need to use this interrupt to assemble the data from the camera D0 -D7, if this is the speed, it will cause me to lose a ton of pixels. Is there a way that I can trigger the interrupt faster?
void gpio_init()
{
ret_code_t err_code; // hold error value
nrf_gpio_cfg_output(TEST_PIN);
nrf_gpio_pin_clear(TEST_PIN);
nrf_drv_gpiote_in_config_t in_line_config = GPIOTE_CONFIG_IN_SENSE_LOTOHI(true);
in_line_config.pull = NRF_GPIO_PIN_NOPULL;
err_code = nrf_drv_gpiote_in_init(LINE_VALID, &in_line_config, input_line_handle); // Initialize the interrupt pin
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_in_event_enable(LINE_VALID, true);
}
void input_line_handle(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
nrf_gpio_pin_toggle(TEST_PIN);
}