Sample code not available for selected part

Hello Team,

We are currently working with the nRF54L05 and using the nRF Connect SDK. We have successfully evaluated basic BLE peripheral samples on the EVK.

For our application, we require sample implementations of the ADC and Timer. However, we found that the existing samples are not compatible with the nRF54L05.

Could you please guide us on how to use the Timer and ADC with this platform?

Thank you.

Parents
  • Hello,

    I am trying to configure the Timer to trigger every 1 millisecond. I referred to the ADC lesson from the course you mentioned above. Code is getting compiled but the timer is not triggered every 1 millisecond as expected. Below is the code snippet. 

    #include <nrfx_timer.h>
    
    #define TIMER_INSTANCE_NUMBER   22
    #define TIME_TO_WAIT_MS         1
    
    const nrfx_timer_t timer_instance = NRFX_TIMER_INSTANCE(TIMER_INSTANCE_NUMBER);
    nrfx_timer_config_t config = NRFX_TIMER_DEFAULT_CONFIG(1000);
    volatile unsigned long sys_tick = 0;
    nrfx_err_t status;
    
    static void timer_handler(nrf_timer_event_t event_type, void * p_context)
    {
        if(event_type == NRF_TIMER_EVENT_COMPARE0)
        {
            sys_tick++;
        }
    }
    
    void init_timer(void)
    {
        printk("tmr_init\r\n");
        status = nrfx_timer_init(&timer_instance, &config, timer_handler);
        NRFX_ASSERT(status == NRFX_SUCCESS);
    
        nrfx_timer_clear(&timer_instance);
    
        /* Creating variable desired_ticks to store the output of nrfx_timer_ms_to_ticks function */
        uint32_t timer_ticks = nrfx_timer_ms_to_ticks(&timer_instance, TIME_TO_WAIT_MS);
    
        nrfx_timer_extended_compare(&timer_instance, NRF_TIMER_CC_CHANNEL0, timer_ticks, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true);
    
        nrfx_timer_enable(&timer_instance);
    }
    
    void get_sysTicks(void)
    {
        printk("%d\r\n",sys_tick);
    }

    As per my understanding if the timer is triggered every 1 millisec value of sys_tick should increase accordingly. I am checking the value of sys_tick continuously, but its value is 0.

    I have created the overlay for the timer.

    &timer22 {
    	status = "okay";
    };

    Please guide me. Am I missing any configuration?

    Thank you.

Reply
  • Hello,

    I am trying to configure the Timer to trigger every 1 millisecond. I referred to the ADC lesson from the course you mentioned above. Code is getting compiled but the timer is not triggered every 1 millisecond as expected. Below is the code snippet. 

    #include <nrfx_timer.h>
    
    #define TIMER_INSTANCE_NUMBER   22
    #define TIME_TO_WAIT_MS         1
    
    const nrfx_timer_t timer_instance = NRFX_TIMER_INSTANCE(TIMER_INSTANCE_NUMBER);
    nrfx_timer_config_t config = NRFX_TIMER_DEFAULT_CONFIG(1000);
    volatile unsigned long sys_tick = 0;
    nrfx_err_t status;
    
    static void timer_handler(nrf_timer_event_t event_type, void * p_context)
    {
        if(event_type == NRF_TIMER_EVENT_COMPARE0)
        {
            sys_tick++;
        }
    }
    
    void init_timer(void)
    {
        printk("tmr_init\r\n");
        status = nrfx_timer_init(&timer_instance, &config, timer_handler);
        NRFX_ASSERT(status == NRFX_SUCCESS);
    
        nrfx_timer_clear(&timer_instance);
    
        /* Creating variable desired_ticks to store the output of nrfx_timer_ms_to_ticks function */
        uint32_t timer_ticks = nrfx_timer_ms_to_ticks(&timer_instance, TIME_TO_WAIT_MS);
    
        nrfx_timer_extended_compare(&timer_instance, NRF_TIMER_CC_CHANNEL0, timer_ticks, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, true);
    
        nrfx_timer_enable(&timer_instance);
    }
    
    void get_sysTicks(void)
    {
        printk("%d\r\n",sys_tick);
    }

    As per my understanding if the timer is triggered every 1 millisec value of sys_tick should increase accordingly. I am checking the value of sys_tick continuously, but its value is 0.

    I have created the overlay for the timer.

    &timer22 {
    	status = "okay";
    };

    Please guide me. Am I missing any configuration?

    Thank you.

Children
No Data
Related