<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Unable to send the data over Bluetooth</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104463/unable-to-send-the-data-over-bluetooth</link><description>Hi All, I&amp;#39;m trying to merged 2 codes together so that I can receive the data on the app. the description of the codes are as follows 
 Project Description: 
 I&amp;#39;m capturing the frequency of the input signal and want to send to the bluetooth for further</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Oct 2023 07:50:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104463/unable-to-send-the-data-over-bluetooth" /><item><title>RE: Unable to send the data over Bluetooth</title><link>https://devzone.nordicsemi.com/thread/450455?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2023 07:50:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d713351f-ad39-490a-83f9-ed34cce74812</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You need to take one of our bluetooth examples as templates and build your logic on top of that Khalil.&lt;/p&gt;
&lt;p&gt;If you want to transmit the captured pulse length value over bluetooth then you need to start with&amp;nbsp;E:\Downloads\nRF5_SDK_17.1.0_ddde560\examples\ble_peripheral\ble_app_template example&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to send the data over Bluetooth</title><link>https://devzone.nordicsemi.com/thread/450453?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2023 07:45:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f6a97c2-fc74-45d1-9330-e78d52a53730</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="Khalil Ahmad"]Hi All, I&amp;#39;m connecting my custom board with the NRF52840-SDK for programming. Ther programming part is working fine and I can see its programmed But when I try to see the data on serial port, its show the data of SDK-NRF52840 instead of Custom-NRF52840. Programming is good. I want to ask is there specific configuration to check the data on serial port ?????[/quote]
&lt;p&gt;Sorry fir late reply Khalil, I do not understand what it means by &amp;quot;showing data of SDK-NRF52840 instead of Customer-NRF52840&amp;quot;&lt;/p&gt;
&lt;p&gt;Are you unable to get log data on the serial board for your custom board? Have you checked the pin settings on the .dts file?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to send the data over Bluetooth</title><link>https://devzone.nordicsemi.com/thread/449735?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2023 08:58:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fcdaa58-6bfb-4287-81cb-61fb049ec924</guid><dc:creator>Khalil Ahmad</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/**
 * Copyright (c) 2014 - 2019, Nordic Semiconductor ASA
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification,
 * are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice, this
 *    list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form, except as embedded into a Nordic
 *    Semiconductor ASA integrated circuit in a product or a software update for
 *    such product, must reproduce the above copyright notice, this list of
 *    conditions and the following disclaimer in the documentation and/or other
 *    materials provided with the distribution.
 *
 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
 *    contributors may be used to endorse or promote products derived from this
 *    software without specific prior written permission.
 *
 * 4. This software, with or without modification, must only be used with a
 *    Nordic Semiconductor ASA integrated circuit.
 *
 * 5. Any software provided in binary form under this license must not be reverse
 *    engineered, decompiled, modified and/or disassembled.
 *
 * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA &amp;quot;AS IS&amp;quot; AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
/** @file
* @defgroup temperature_example_main main.c
* @{
* @ingroup temperature_example
* @brief Temperature Example Application main file.
* @details
* This file contains the source code for a sample application using the temperature sensor.
* This contains workaround for PAN_028 rev2.0A anomalies 28, 29,30 and 31. PAN 43 is not covered.
*  - PAN_028 rev2.0A anomaly 28 - TEMP: Negative measured values are not represented correctly
*  - PAN_028 rev2.0A anomaly 29 - TEMP: Stop task clears the TEMP register.
*  - PAN_028 rev2.0A anomaly 30 - TEMP: Temp module analog front end does not power down when DATARDY event occurs.
*  - PAN_028 rev2.0A anomaly 31 - TEMP: Temperature offset value has to be manually loaded to the TEMP module
*  - PAN_028 rev2.0A anomaly 43 - TEMP: Using PPI between DATARDY event and START task is not functional.
*
*/
#include &amp;lt;stdint.h&amp;gt;

#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;

#include &amp;quot;nrf_drv_ppi.h&amp;quot;
#include &amp;quot;nrf_drv_timer.h&amp;quot;

#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;

#include &amp;lt;stdbool.h&amp;gt;
//#include &amp;lt;stdint.h&amp;gt;
#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;nrf_drv_timer.h&amp;quot;
#include &amp;quot;bsp.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;

#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;bsp.h&amp;quot;
#include &amp;quot;nrf_drv_ppi.h&amp;quot;
#include &amp;quot;nrf_drv_timer.h&amp;quot;
#include &amp;quot;nrf_drv_ppi.h&amp;quot;

#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;

const nrf_drv_timer_t capture_timer = NRF_DRV_TIMER_INSTANCE(3);

#define SAMPLE_PIN                      3
#define TIMER_PRESCALER                 NRF_TIMER_FREQ_16MHz
#define GPIOTE_CH_CAPTURE               1
#define GPIOTE_CH_RESTART               1
#define GPIOTE_CH_SELFTEST              2

#define SELF_TEST                       1

/////editing pasting from PPI Example


#define PPI_EXAMPLE_TIMERS_PHASE_SHIFT_DELAY   (1)// (10)    // 1s = 10 * 100ms (Timer 0 interrupt)
#define PPI_EXAMPLE_TIMER0_INTERVAL             (1)//(100)   // Timer interval in milliseconds
#define PPI_EXAMPLE_TIMER3_INTERVAL             (1)//(2000)  // Timer interval in milliseconds
#define PPI_EXAMPLE_TIMER4_INTERVAL             (1)//(2000)  // Timer interval in milliseconds
#define PPI_EXAMPLE_TIMER1_INTERVAL             (1)//(2000)  // Timer interval in milliseconds
#define PPI_EXAMPLE_TIMER2_INTERVAL             (1)//(2000)  // Timer interval in milliseconds


static const nrf_drv_timer_t m_timer0 = NRF_DRV_TIMER_INSTANCE(0);
//static const nrf_drv_timer_t m_timer3 = NRF_DRV_TIMER_INSTANCE(1);
//static const nrf_drv_timer_t m_timer4 = NRF_DRV_TIMER_INSTANCE(2);
static const nrf_drv_timer_t m_timer1 = NRF_DRV_TIMER_INSTANCE(1);
static const nrf_drv_timer_t m_timer2 = NRF_DRV_TIMER_INSTANCE(2);
//static const nrf_drv_timer_t m_timer4 = NRF_DRV_TIMER_INSTANCE(2);
//const nrf_drv_timer_t TIMER_LED = NRF_DRV_TIMER_INSTANCE(0);

static nrf_ppi_channel_t m_ppi_channel1;
static nrf_ppi_channel_t m_ppi_channel2;

static volatile uint32_t m_counter;

static void timer0_event_handler(nrf_timer_event_t event_type, void * p_context)
{
    ++m_counter;
}

/* Timer event handler. Not used since Timer1 and Timer2 are used only for PPI. */
static void empty_timer_handler(nrf_timer_event_t event_type, void * p_context)
{
}


/** @brief Function for initializing the PPI peripheral.
*/
static void ppi_init(void)
{
    uint32_t err_code = NRF_SUCCESS;

    err_code = nrf_drv_ppi_init();
    APP_ERROR_CHECK(err_code);

    /* Configure 1st available PPI channel to stop TIMER0 counter on TIMER1 COMPARE[0] match,
     * which is every even number of seconds.
     */
    err_code = nrf_drv_ppi_channel_alloc(&amp;amp;m_ppi_channel1);
    APP_ERROR_CHECK(err_code);
    err_code = nrf_drv_ppi_channel_assign(m_ppi_channel1,
                                          nrf_drv_timer_event_address_get(&amp;amp;m_timer1,
                                                                          NRF_TIMER_EVENT_COMPARE0),
                                          nrf_drv_timer_task_address_get(&amp;amp;m_timer0,
                                                                         NRF_TIMER_TASK_STOP));
    APP_ERROR_CHECK(err_code);

    /* Configure 2nd available PPI channel to start TIMER0 counter at TIMER2 COMPARE[0] match,
     * which is every odd number of seconds.
     */
    err_code = nrf_drv_ppi_channel_alloc(&amp;amp;m_ppi_channel2);
    APP_ERROR_CHECK(err_code);
    err_code = nrf_drv_ppi_channel_assign(m_ppi_channel2,
                                          nrf_drv_timer_event_address_get(&amp;amp;m_timer2,
                                                                          NRF_TIMER_EVENT_COMPARE0),
                                          nrf_drv_timer_task_address_get(&amp;amp;m_timer0,
                                                                         NRF_TIMER_TASK_START));
    APP_ERROR_CHECK(err_code);

    // Enable both configured PPI channels
    err_code = nrf_drv_ppi_channel_enable(m_ppi_channel1);
    APP_ERROR_CHECK(err_code);
    err_code = nrf_drv_ppi_channel_enable(m_ppi_channel2);
    APP_ERROR_CHECK(err_code);
}



/** @brief Function for Timer 0 initialization.
 *  @details Timer 0 will be stopped and started by Timer 1 and Timer 2 respectively using PPI.
 *           It is configured to generate an interrupt every 100ms.
 */
static void timer0_init(void)
{
    // Check TIMER0 configuration for details.
    nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
    timer_cfg.frequency = NRF_TIMER_FREQ_16MHz;
    ret_code_t err_code = nrf_drv_timer_init(&amp;amp;m_timer0, &amp;amp;timer_cfg, timer0_event_handler);
    APP_ERROR_CHECK(err_code);

    nrf_drv_timer_extended_compare(&amp;amp;m_timer0,
                                   NRF_TIMER_CC_CHANNEL0,
                                   nrf_drv_timer_ms_to_ticks(&amp;amp;m_timer0,
                                                             PPI_EXAMPLE_TIMER0_INTERVAL),
                                   NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK,
                                   true);
}
static void timer1_init(void)
{
    // Check TIMER1 configuration for details.
    nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
    timer_cfg.frequency = NRF_TIMER_FREQ_16MHz;
    ret_code_t err_code = nrf_drv_timer_init(&amp;amp;m_timer1, &amp;amp;timer_cfg, empty_timer_handler);
    APP_ERROR_CHECK(err_code);

    nrf_drv_timer_extended_compare(&amp;amp;m_timer1,
                                   NRF_TIMER_CC_CHANNEL0,
                                   nrfx_timer_ms_to_ticks(&amp;amp;m_timer1,
                                                             PPI_EXAMPLE_TIMER1_INTERVAL ),
                                   NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK,
                                   false);
}


/** @brief Function for Timer 2 initialization.
 *  @details Initializes TIMER2 peripheral to generate an event every 2 seconds. The events are
 *           generated at odd numbers of seconds after starting the example (3, 5, 7 ...) and they
 *           are used to start TIMER0 via PPI: TIMER2-&amp;gt;EVENT_COMPARE[0] triggers TIMER0-&amp;gt;TASK_START.
 */
static void timer2_init(void)
{
    // Check TIMER2 configuration for details.
    nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
    timer_cfg.frequency = NRF_TIMER_FREQ_16MHz;
    ret_code_t err_code = nrf_drv_timer_init(&amp;amp;m_timer2, &amp;amp;timer_cfg, empty_timer_handler);
    APP_ERROR_CHECK(err_code);

    nrf_drv_timer_extended_compare(&amp;amp;m_timer2,
                                   NRF_TIMER_CC_CHANNEL0,
                                   nrfx_timer_ms_to_ticks(&amp;amp;m_timer2,
                                                             PPI_EXAMPLE_TIMER2_INTERVAL),
                                   NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK,
                                   false);
}


/** @brief Function for Timer 1 initialization.
 *  @details Initializes TIMER1 peripheral to generate an event every 2 seconds. The events are
 *           generated at even numbers of seconds after starting the example (2, 4, 6 ...) and they
 *           are used to stop TIMER0 via PPI: TIMER1-&amp;gt;EVENT_COMPARE[0] triggers TIMER0-&amp;gt;TASK_STOP.
 */
 /*
static void timer3_init(void)
{
    // Check TIMER1 configuration for details.
    nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
    timer_cfg.frequency = NRF_TIMER_FREQ_31250Hz;
    ret_code_t err_code = nrf_drv_timer_init(&amp;amp;m_timer3, &amp;amp;timer_cfg, empty_timer_handler);
    APP_ERROR_CHECK(err_code);

    nrf_drv_timer_extended_compare(&amp;amp;m_timer3,
                                   NRF_TIMER_CC_CHANNEL0,
                                   nrf_drv_timer_ms_to_ticks(&amp;amp;m_timer3,
                                                             PPI_EXAMPLE_TIMER3_INTERVAL),
                                   NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK,
                                   false);
}


/** @brief Function for Timer 2 initialization.
 *  @details Initializes TIMER2 peripheral to generate an event every 2 seconds. The events are
 *           generated at odd numbers of seconds after starting the example (3, 5, 7 ...) and they
 *           are used to start TIMER0 via PPI: TIMER2-&amp;gt;EVENT_COMPARE[0] triggers TIMER0-&amp;gt;TASK_START.
 */
 /*
static void timer4_init(void)
{
    // Check TIMER2 configuration for details.
    nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
    timer_cfg.frequency = NRF_TIMER_FREQ_31250Hz;
    ret_code_t err_code = nrf_drv_timer_init(&amp;amp;m_timer4, &amp;amp;timer_cfg, empty_timer_handler);
    APP_ERROR_CHECK(err_code);

    nrf_drv_timer_extended_compare(&amp;amp;m_timer4,
                                   NRF_TIMER_CC_CHANNEL0,
                                   nrf_drv_timer_ms_to_ticks(&amp;amp;m_timer4,
                                                             PPI_EXAMPLE_TIMER4_INTERVAL),
                                   NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK,
                                   false);
}
*/


//////END pasting





#if SELF_TEST
const nrf_drv_timer_t test_timer = NRF_DRV_TIMER_INSTANCE(4);

static void run_self_test_pin(uint32_t pin_no, uint32_t us_on, uint32_t us_off)
{
    uint32_t err_code;
    static nrf_ppi_channel_t ppi_ch_test_pin_run, ppi_ch_test_pin_run2;
    
    nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
    timer_cfg.frequency = NRF_TIMER_FREQ_16MHz;
    timer_cfg.bit_width = NRF_TIMER_BIT_WIDTH_32;
    err_code = nrf_drv_timer_init(&amp;amp;test_timer, &amp;amp;timer_cfg, empty_timer_handler);
    APP_ERROR_CHECK(err_code);
    
    nrf_drv_timer_extended_compare(&amp;amp;test_timer, 0, us_on,          0,                               false);
    nrf_drv_timer_extended_compare(&amp;amp;test_timer, 1, us_on + us_off, TIMER_SHORTS_COMPARE1_CLEAR_Msk, false);
    
    NRF_GPIOTE-&amp;gt;CONFIG[GPIOTE_CH_SELFTEST] = GPIOTE_CONFIG_MODE_Task &amp;lt;&amp;lt; GPIOTE_CONFIG_MODE_Pos |
                                             GPIOTE_CONFIG_POLARITY_Toggle &amp;lt;&amp;lt; GPIOTE_CONFIG_POLARITY_Pos |
                                             pin_no &amp;lt;&amp;lt; GPIOTE_CONFIG_PSEL_Pos;
                                             
    nrfx_ppi_channel_alloc(&amp;amp;ppi_ch_test_pin_run);
    nrfx_ppi_channel_assign(ppi_ch_test_pin_run,
                            nrf_drv_timer_compare_event_address_get(&amp;amp;test_timer, 0),
                            (uint32_t)&amp;amp;NRF_GPIOTE-&amp;gt;TASKS_CLR[GPIOTE_CH_SELFTEST]);
    nrfx_ppi_channel_enable(ppi_ch_test_pin_run);
    
    nrfx_ppi_channel_alloc(&amp;amp;ppi_ch_test_pin_run2);
    nrfx_ppi_channel_assign(ppi_ch_test_pin_run2,
                            nrf_drv_timer_compare_event_address_get(&amp;amp;test_timer, 1),
                            (uint32_t)&amp;amp;NRF_GPIOTE-&amp;gt;TASKS_SET[GPIOTE_CH_SELFTEST]);
    nrfx_ppi_channel_enable(ppi_ch_test_pin_run2);
    
    nrf_drv_timer_clear(&amp;amp;test_timer);
    nrf_drv_timer_resume(&amp;amp;test_timer);
}
#endif


static void gpiote_capture_init(void)
{
    uint32_t err_code;
    static nrf_ppi_channel_t ppi_ch_gpiote_capture;
    static nrf_ppi_channel_t ppi_ch_gpiote_restart;
    
    // Optionally, enable pullup or pulldown on the input pin
    //nrf_gpio_cfg_input(SAMPLE_PIN, NRF_GPIO_PIN_PULLUP);

    // Allocate two PPI channels
    nrfx_ppi_channel_alloc(&amp;amp;ppi_ch_gpiote_capture);
    nrfx_ppi_channel_alloc(&amp;amp;ppi_ch_gpiote_restart);
    
    // Configure the capture timer
    nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
    timer_cfg.frequency = TIMER_PRESCALER;
    timer_cfg.bit_width = NRF_TIMER_BIT_WIDTH_32;
    err_code = nrf_drv_timer_init(&amp;amp;capture_timer, &amp;amp;timer_cfg, empty_timer_handler);
    APP_ERROR_CHECK(err_code);

    // The GPIOTE driver doesn&amp;#39;t support two GPIOTE channels on the same pin, so direct register access is necessary
    NRF_GPIOTE-&amp;gt;CONFIG[GPIOTE_CH_CAPTURE] = GPIOTE_CONFIG_MODE_Event &amp;lt;&amp;lt; GPIOTE_CONFIG_MODE_Pos |
                                            GPIOTE_CONFIG_POLARITY_HiToLo &amp;lt;&amp;lt; GPIOTE_CONFIG_POLARITY_Pos |
                                            SAMPLE_PIN &amp;lt;&amp;lt; GPIOTE_CONFIG_PSEL_Pos;
    NRF_GPIOTE-&amp;gt;CONFIG[GPIOTE_CH_RESTART] = GPIOTE_CONFIG_MODE_Event &amp;lt;&amp;lt; GPIOTE_CONFIG_MODE_Pos |
                                            GPIOTE_CONFIG_POLARITY_LoToHi &amp;lt;&amp;lt; GPIOTE_CONFIG_POLARITY_Pos |
                                            SAMPLE_PIN &amp;lt;&amp;lt; GPIOTE_CONFIG_PSEL_Pos;

    // Assign a PPI channel to capture the current timer state and store it in CC register 0
    nrfx_ppi_channel_assign(ppi_ch_gpiote_capture, 
                            (uint32_t)&amp;amp;NRF_GPIOTE-&amp;gt;EVENTS_IN[GPIOTE_CH_CAPTURE], 
                            nrf_drv_timer_capture_task_address_get(&amp;amp;capture_timer, 0));
    
    // Assign a second PPI channel to restart the timer when a new pulse is detected
    nrfx_ppi_channel_assign(ppi_ch_gpiote_restart, 
                            (uint32_t)&amp;amp;NRF_GPIOTE-&amp;gt;EVENTS_IN[GPIOTE_CH_RESTART], 
                            nrf_drv_timer_task_address_get(&amp;amp;capture_timer, NRF_TIMER_TASK_CLEAR));
    
    // Enable both PPI channels                
    nrfx_ppi_channel_enable(ppi_ch_gpiote_capture);
    nrfx_ppi_channel_enable(ppi_ch_gpiote_restart);

    // Make sure the GPIOTE capture in event is cleared. This will be  used to detect if a capture has occured. 
    NRF_GPIOTE-&amp;gt;EVENTS_IN[GPIOTE_CH_CAPTURE] = 0;
    
    // Start the timer
    nrfx_timer_resume(&amp;amp;capture_timer);
}


static uint32_t timer_capture_value_get(void)
{
    // Make sure the capture event occured before checking the capture register
    if(NRF_GPIOTE-&amp;gt;EVENTS_IN[GPIOTE_CH_CAPTURE] != 0)
    {
        // Clear the capture event
        NRF_GPIOTE-&amp;gt;EVENTS_IN[GPIOTE_CH_CAPTURE] = 0;
        
        // Return the stored capture value in the timer
        return nrf_drv_timer_capture_get(&amp;amp;capture_timer, 0);
    }
    else
    {
        // In case no capture occured, return 0
        return 0;
    }
}

/** @brief Function for main application entry.
 */
int main(void)
{
    APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
    NRF_LOG_DEFAULT_BACKENDS_INIT();
      ppi_init();
    timer0_init(); // Timer used to increase m_counter every 100ms.
    timer1_init(); // Timer to generate events on even number of seconds - stopping Timer 0
    timer2_init();
    //timer3_init(); // Timer to generate events on even number of seconds - stopping Timer 0
   // timer4_init(); // Timer to generate events on odd number of seconds - starting Timer 0
    
    NRF_LOG_INFO(&amp;quot;Pulse capture example started&amp;quot;);


    gpiote_capture_init();
    
#if SELF_TEST
    run_self_test_pin(LED_1, 678, 10);
#endif

    while (true)
    {
        uint32_t captured_pulse_length = timer_capture_value_get();
        
        if(captured_pulse_length &amp;gt; 0)
        {
            NRF_LOG_INFO(&amp;quot;Capture value: %i us&amp;quot;, (captured_pulse_length * (1 &amp;lt;&amp;lt; TIMER_PRESCALER) / 16));
        }
       // else NRF_LOG_INFO(&amp;quot;No capture detected&amp;quot;);
        
       // nrf_delay_ms(500);
        NRF_LOG_FLUSH();
    }
}


/** @} */&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is the code which is taking the data. Now i want to send over bluetooth. Can you please help me to find a way to send this data by bluetooth ?? I want to display the data&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to send the data over Bluetooth</title><link>https://devzone.nordicsemi.com/thread/449692?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2023 05:34:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b707aae-710b-4dcf-99f8-420b2fc941de</guid><dc:creator>Khalil Ahmad</dc:creator><description>&lt;p&gt;BLE Part&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1697002236795v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Pulse Capture Part (Should be merged within BLE Part)&amp;nbsp;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1697002394648v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I have pasted the main portion of the two codes which im not finding a way to merge to each otherActualy Im struggling sometime this part of BLE with the same part of other Pulse Capture Example. Because here there are only initializaton but on the pulse capture it is doing some calculations. these 2 parts im unable to merge.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to send the data over Bluetooth</title><link>https://devzone.nordicsemi.com/thread/449691?ContentTypeID=1</link><pubDate>Wed, 11 Oct 2023 05:11:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26493ef4-9822-4d27-935b-c645ec70e61d</guid><dc:creator>Khalil Ahmad</dc:creator><description>&lt;p&gt;Hi Susheel I see. I will check later, I have one question related to hardware and it should be separate ticket but if you can reply me it will be a great help. Thanks&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Hi All, I&amp;#39;m connecting my custom board with the NRF52840-SDK for programming. Ther programming part is working fine and I can see its programmed But when I try to see the data on serial port, its show the data of SDK-NRF52840 instead of Custom-NRF52840. Programming is good. I want to ask is there specific configuration to check the data on serial port ?????&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to send the data over Bluetooth</title><link>https://devzone.nordicsemi.com/thread/449660?ContentTypeID=1</link><pubDate>Tue, 10 Oct 2023 20:39:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41b2918e-93b1-462d-bd28-40d896b09fca</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Ahmed,&lt;/p&gt;
&lt;p&gt;Merging two logics is not straight forward when there are multiple peripherals involved with different interrupt priorities and contexts.&lt;/p&gt;
&lt;p&gt;You should be able to start the merged application in the debugger and see if the logic of Code-1 and code-2 is running after merged.&lt;/p&gt;
&lt;p&gt;It might be possible that the merge introduced a deadlock or one logic starving the other logic. This can happen if there is conflicting interrupt priorities for peripherals that created a deadlock trying to access same resources.&lt;/p&gt;
&lt;p&gt;I would not be able to do a code review as we do not have resources to do that unfortunately. Since you mentioned that the peripherals are working individually, this is a issue of architecture with merging your application.&lt;/p&gt;
&lt;p&gt;I strongly suggest you to start your application in the debugger and put breakpoints at code path to see step by step if there is a deadlock/loop/starvation somewhere in your logic.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also try to change the interrupt priorities for the peripherals your are using. If you are using app priority high for most of your logic, try to reduce the priority and see if the deadlock is resolved (assuming that there is a deadlock)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to send the data over Bluetooth</title><link>https://devzone.nordicsemi.com/thread/449264?ContentTypeID=1</link><pubDate>Sun, 08 Oct 2023 22:48:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:448c7b7b-24cc-4061-b4db-5394dc03d066</guid><dc:creator>Khalil Ahmad</dc:creator><description>&lt;p&gt;&lt;a href="https://we.tl/t-XBJskeQNqa"&gt;https://we.tl/t-XBJskeQNqa&lt;/a&gt;I have merged both projects succesfully but not able to get the data of pulse capture. Actually I replaced the name of pulse capture with the potentio by thinking that the data of pulse capture will be showed as potentiometer level (to avoid more changes) the ble part is working fine&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>