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