This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

PWM Power Consumption NRF52840

Hello

I need to setup the the PWM peripheral@ 8MHz with one selectet Channel in DMA mode. For development, I am using the NRF52840 Preview Dev Kit PCA10056 (Q1AAAA). I did not find the electrical specifications according current consumption especially for the pwm module. Do you have any?

I've done some measurements according to Nordic documentation (http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52%2Fdita%2Fnrf52%2Fdevelopment%2Fnrf52840_pdk%2Fhw_measure_current.html )

For the setup, I took the code from the product specification V1.0 (page 238)

#include <nrf.h>
#define PWM_TOP (392)
#define SOFTHART_TX_PIN_NUMBER 11
 
uint16_t buf[] = {(1 << 15) | 196}; // Inverse polarity (bit 15), 50% dutyCycle
 
int main(void)
{
 
    nrf_pwr_mgmt_init();
 
    NRF_GPIO->DIRSET = (1 << SOFTHART_TX_PIN_NUMBER);
    NRF_GPIO->OUTCLR = (1 << SOFTHART_TX_PIN_NUMBER);
 
    NRF_PWM0->PRESCALER   = PWM_PRESCALER_PRESCALER_DIV_2; // 16MHz / 2 = 8MHz
    NRF_PWM0->PSEL.OUT[0] = SOFTHART_TX_PIN_NUMBER;
    NRF_PWM0->MODE        = (PWM_MODE_UPDOWN_Up << PWM_MODE_UPDOWN_Pos);
    NRF_PWM0->DECODER     = (PWM_DECODER_LOAD_Common       << PWM_DECODER_LOAD_Pos) |
                            (PWM_DECODER_MODE_RefreshCount << PWM_DECODER_MODE_Pos);
    NRF_PWM0->LOOP        = (PWM_LOOP_CNT_Disabled << PWM_LOOP_CNT_Pos);
    NRF_PWM0->COUNTERTOP = PWM_TOP;
    
    NRF_PWM0->SEQ[0].CNT = (1u << PWM_SEQ_CNT_CNT_Pos);
    NRF_PWM0->SEQ[0].ENDDELAY = 0;
    NRF_PWM0->SEQ[0].PTR = (uint32_t)&buf[0];
    NRF_PWM0->SEQ[0].REFRESH = 0;
    NRF_PWM0->SHORTS = 0;
 
    NRF_PWM0->ENABLE = 1;
    NRF_PWM0->TASKS_SEQSTART[0] = 1;
 
    nrf_delay_ms(100);
 
 
    while (1)
    {
        nrf_pwr_mgmt_run();
    }
}

For the PWM peripherial (without DMA),  I've measured a  current consumption of the PWM peripheralwithout DMA of ca. 1.2 mA with a running PWM and 0.5mA with a disabled PWM.

For the PWM peripherial (with DMA),  I've measured a  current consumption of the PWM peripheraland DMA of ca. 1.7 mA with a running PWM and 0.5mA with a disabled PWM.

Can you verify that the current consumption ot the PWM module is ca. 0.7mA that DMA takes around 0.5mA? Are there some additional information which i've missed during searching?

Regards

Parents
  • Hi,

    Can you verify that the current consumption ot the PWM module is ca. 0.7mA that DMA takes around 0.5mA? Are there some additional information which i've missed during searching?

    Yes, that is approximately in the correct range, maybe in the higher end of the range. But, it will depend on what PWM_CLK frequency that is used(e.g. 125 kHz uses less than 16 MHz), if it's a fixed or a varying duty cycle, and if HFXO or HFINT is used as clock source(HFXO is more accurate, but uses slightly more current).

     

    0.5mA with a disabled PWM.

    If you properly disable the PWM, (and maybe also turn off logging, NRF_LOG_ENABLED in sdk_config.h), and don't have anything else enabled, it should only draw around 1 µA (System ON, no RAM retention, wake on any event)

Reply
  • Hi,

    Can you verify that the current consumption ot the PWM module is ca. 0.7mA that DMA takes around 0.5mA? Are there some additional information which i've missed during searching?

    Yes, that is approximately in the correct range, maybe in the higher end of the range. But, it will depend on what PWM_CLK frequency that is used(e.g. 125 kHz uses less than 16 MHz), if it's a fixed or a varying duty cycle, and if HFXO or HFINT is used as clock source(HFXO is more accurate, but uses slightly more current).

     

    0.5mA with a disabled PWM.

    If you properly disable the PWM, (and maybe also turn off logging, NRF_LOG_ENABLED in sdk_config.h), and don't have anything else enabled, it should only draw around 1 µA (System ON, no RAM retention, wake on any event)

Children
No Data
Related