This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Data acquisition on a 2MHz clock

Hi folks,

I have a 2MHz clock (call it DRDY) coming into my nRF51 on one of the GPIO pins (call it AFE_DRDY). I need to read an external AFE chip on every falling edge. So, I thought I would use the GPIOTE driver, as such:

// Configure DRDY nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(true); err_code = nrf_drv_gpiote_in_init(AFE_DRDY, &in_config, drdy_handler); APP_ERROR_CHECK(err_code); nrf_drv_gpiote_in_event_enable(AFE_DRDY, true);

I then have a handler:

void drdy_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action) { nrf_gpio_pin_toggle(AFE_SCLK); }

I am toggling another pin AFE_SCLK just to check whether this is handler is being called.

When I run this code, it's clear the nRF51 is reacting to the DRDY signal because the chip seems to be spinning and none of the rest of the code is getting executed. However, I am not seeing the AFE_SCLCK toggling. So, I am not sure the handler is even getting called.

Any ideas? Thanks!

Related