Good evening,
I determined the numbers of clocks necessery to fire up an interrupt from an GPIOTE event.
My debugger reports 1373 clocks ticks to go into and go back from the interrupt.
In the Cortex-M4F technical documentation, I found that to enter in the interrupt only 12 clocks ticks is needed to go into the interrupt and 10 to return from it. Even if I count the number of clock executed in the interrupt the value reported is very different.
So, where does the difference come from ?
Here's the code :
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdbool.h>
#include "nrf.h"
#include "nrf_drv_gpiote.h"
#include "app_error.h"
#include "boards.h"
#include "nrf_drv_timer.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#include "app_util_platform.h"
#define PIN_IN 33 //BUTTON_1
#define PIN_OUT BSP_LED_0
const nrf_drv_timer_t TIMER = NRF_DRV_TIMER_INSTANCE(1);
uint8_t state = 0, state_prev=0;
uint8_t ready = 0;
uint16_t captured_value,captured_prev = 0;
float frequency = 0.0;
Sincerely,
Sylvain.