Upto 6 frequency measurement through GPIOs

nRF5340Dk with NCS 2.6.1 and toolchain 2.6.1.

I want to measure 6 frequencies for my application, these frequencies would be attached to GPIO pins and needs to be measured. 

Few days ago I had this similar question ( Case ID : 339377 / LINKwhere community supporter   shared his code to measure single frequency using DPPI GPIOTE and 2 TIMERs. Later I tried to duplicate the functionality for TWO INPUT frequencies and I got this result.

*** Booting nRF Connect SDK v3.5.99-ncs1-1 ***
[00:00:00.258,239] <inf> app: gpiote: Channel 6 allocated for INPUT_PIN
[00:00:00.265,258] <inf> app: gpiote: Channel 5 allocated for INPUT_PIN_1
[00:00:00.272,460] <inf> app: gpiote: INPUT_PIN configured
[00:00:00.278,381] <inf> app: gpiote: INPUT_PIN_1 configured
GPIOTE Event for INPUT_PIN: 0x5000d118
GPIOTE Event for INPUT_PIN_1: 0x5000d114
Example start
Freq [0]: 234887 [Hz]
Freq [1]: 234887 [Hz]
--------------------------
Freq [0]: 234887 [Hz]
Freq [1]: 234887 [Hz]
--------------------------
Freq [0]: 235294 [Hz]
Freq [1]: 235294 [Hz]
--------------------------

Meaning, there is only one counter per timer which is my TIMER0  ''NRF_TIMER_TASK_COUNT''. Initially I thought each measurements are incremented in timer capture/compare, so i thought 6 measurements are possible. which is not the case?

My final question would be if its possible how shall I implement 6 of these measurement? Frequency ranges : 1KHz to 500KHz better if 1MHz , note that I already have BLE and 3 I2C devices configured.

Here is my current project :

 pulse_detector_PWM.zip

Related