Hi Support Team
How is the current consumption for GRTC PWM OUT of nRF54L15? Thanks.
Hi Support Team
How is the current consumption for GRTC PWM OUT of nRF54L15? Thanks.
not with the GRTC and PWM combination. Should be able to test it yourself with simple test like with below
#include <zephyr/kernel.h>
#include <hal/nrf_grtc.h>
#include <hal/nrf_pwm.h>
static void grtc_on(void)
{
/* Make sure LF source is ready before starting. */
nrf_grtc_task_trigger(NRF_GRTC, NRF_GRTC_TASK_LFCLKSTART);
while (!nrf_grtc_event_check(NRF_GRTC, NRF_GRTC_EVENT_LFCLKSTARTED)) {
}
nrf_grtc_task_trigger(NRF_GRTC, NRF_GRTC_TASK_START);
}
static void grtc_off(void)
{
nrf_grtc_task_trigger(NRF_GRTC, NRF_GRTC_TASK_STOP);
nrf_grtc_task_trigger(NRF_GRTC, NRF_GRTC_TASK_LFCLKSTOP);
}
static void pwm_on(void)
{
NRF_PWM_Type *pwm = NRF_PWM120; /* pick the instance you want to measure */
nrf_pwm_disable(pwm);
pwm->PRESCALER = PWM_PRESCALER_PRESCALER_DIV_8; /* any value is fine */
pwm->COUNTERTOP = 16000;
pwm->MODE = PWM_MODE_UPDOWN_Up;
pwm->PSEL.OUT[0] = PWM_PSEL_OUT_CONNECT_Disconnected;
pwm->SEQ[0].CNT = 1;
pwm->SEQ[0].REFRESH = 0;
pwm->SEQ[0].ENDDELAY = 0;
pwm->SEQ[0].PTR = (uint32_t)&pwm->COUNTERTOP; /* dummy constant */
pwm->SEQ[0].MAXCNT = 1;
nrf_pwm_enable(pwm);
nrf_pwm_task_trigger(pwm, NRF_PWM_TASK_SEQSTART0);
}
static void pwm_off(void)
{
NRF_PWM_Type *pwm = NRF_PWM120;
nrf_pwm_task_trigger(pwm, NRF_PWM_TASK_STOP);
while (!nrf_pwm_event_check(pwm, NRF_PWM_EVENT_STOPPED)) {
}
nrf_pwm_disable(pwm);
}
void main(void)
{
k_sleep(K_SECONDS(5));
grtc_on();
k_sleep(K_SECONDS(5));
grtc_off();
pwm_on();
k_sleep(K_SECONDS(5));
pwm_off();
/* stay idle so you can measure post-test baseline if needed */
while (true) {
k_sleep(K_SECONDS(1));
}
}