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

Always high current consumption

Hi!!

I am measuring the current consumption of nRF 52832.

However, it shows a very high average consumption current value of 9 mA at all times.

I think that it is probably not caused by not putting it to sleep state.

I'd like to wake up from sleep when the external pin goes down.

How should it be handled?

The following line shows my data transmission and loop statement.

void SPITxDummy1(unsigned char Data)
{
	uint16_t length = 8;
	nrf_gpio_pin_clear(22);  //CS pin low
	static uint8_t       m_rx_buf[16];
	nrf_drv_spi_transfer(&spi, &Data, 1, m_rx_buf, 2);
	m_rx_buf[buf_count] = *m_rx_buf;
	buf_count++;
	nrf_delay_us(100);
					if(buf_count >= 8){
					ble_nus_string_send(&m_nus, m_rx_buf, &length);
					
					for(int i = 0;i>buf_count;i++){
						m_rx_buf[i] = 0;
					}
					buf_count = 0;				
				}

code1 data transmition

    for (;;)
    {
			if(0 == nrf_gpio_pin_read(30)){
			
				SPITxDummy(0x01); //Dummy_Data LOFFSTAT
				SPITxDummy(0x00); //Dummy_Data LOFFSTAT
				SPITxDummy(0x00); //Dummy_Data CH1
				SPITxDummy1(0x00); //Dummy_Data CH2
				//buf_count++;
				SPITxDummy(0x00); //Dummy_Data CH2
                power_manage();
			}
		}

code2 loop statement

thank you in advanced!!

  • Hi,

    Constant current consumption of 9 mA is very high.

    Are you measuring in our nRF52 DK or in a custom board? Do you use the PPK to measure or another tool? Could you test the current consumption when you run the ble_app_hrs example from the SDK to see if the board is working as it should? (The power consumption of ble_app_hrs example should be in the range of <100uA).

    You can also put the MCU to system off mode with the following code:

    int main(void){
        NRF_POWER->SYSTEMOFF = 1;
        for(;;){}
    }

    Check the current consumption then, it should be ~1uA.

    PS. Always power-reset the nRF52 after flashing the firmware and before measuring current, so you are sure you are not in debugger mode. Debugger mode will draw a lot of current.

    Best Regards,

    Marjeris

  • thank you for your reply!

    It seems that I was not in sleep mode.

    If you add the system off mode at the end of the main sentence, it will not start from sleep and data transmission will not be possible.

    I'd like to wake up the nrf 52832 from sleep as a trigger a certain pin and want to go to sleep when data transmission is over.

    in that case,how should i modify my code?

    best regards!!

     

  • Hi!!

    I am using the example of ble_app_uart of SDK 14.0.0.

    and i am using nrf52832 DK.

    I would like to use a external interrupt of gpio, send data when 30th pin goes to 0, then sleep and 30th pin got 1.

    However,   nrf52832 DK became sleep mode, but there is no interrupt.

    Therefore, we can not confirm the transmission of data.

    my code is shown in below.

     

    static void gpio_init(void)
    {
    	ret_code_t err_code;
    	err_code = nrf_drv_gpiote_init();
    	APP_ERROR_CHECK(err_code);
    	
    	nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_TOGGLE(true);
      in_config.pull = NRF_GPIO_PIN_PULLUP;
    	
    	err_code = nrf_drv_gpiote_in_init(30, &in_config, in_pin_handler);
      APP_ERROR_CHECK(err_code);
    
     nrf_drv_gpiote_in_event_enable(30, true);
    }

    void in_pin_handler(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
    {
       		static uint8_t       m_tx_buf[1];
    		uint16_t length = 16;
    		static uint8_t       m_rx_buf[16];
    	
    		m_tx_buf[0] = 0x00;
    		nrf_drv_spi_transfer(&spi, m_tx_buf, 1, NULL, NULL);
    		nrf_delay_us(100);
    		nrf_drv_spi_transfer(&spi, m_tx_buf, 1, NULL, NULL);
    		nrf_delay_us(100);
    		nrf_drv_spi_transfer(&spi, m_tx_buf, 1, NULL, NULL);
    		nrf_delay_us(100);
    		nrf_drv_spi_transfer(&spi, m_tx_buf, 1, m_rx_buf, 2);
    		m_rx_buf[buf_count] = *m_rx_buf;
    		buf_count++;
    		nrf_delay_us(100);
    					if(buf_count >= 16){
    						ble_nus_string_send(&m_nus, m_rx_buf, &length);
    					
    						for(int i = 0;i>buf_count;i++){
    							m_rx_buf[i] = 0;
    						}
    						buf_count = 0;				
    					}
    		nrf_delay_us(100);
    		nrf_drv_spi_transfer(&spi, m_tx_buf, 1, NULL, NULL);
    		nrf_delay_us(100);
    }

     

    int main(void)
    {        
        uart_init();    
        log_init();    
        ble_stack_init();
        gap_params_init();
        gatt_init();
        services_init();
        advertising_init();
        conn_params_init();
        err_code = ble_advertising_start(&m_advertising, BLE_ADV_MODE_FAST);
        APP_ERROR_CHECK(err_code);
        gpio_init();
    	spi_init();
    	InitADS119x();
    	nrf_delay_us(200);			//4tclock
    	SPITxCommand(0x11);
    	nrf_delay_us(200);  
    	ADS1x9x_Reg_Init();		//ads register initialization
    	ADS119x_Enable_start();
    	SPITxCommand(0x1a);  //Channel Offset Calibration
    	SPITxCommand(0x10);  //0x10 = RDATAC(Read Data Command)(Enable Read Data Continuous mode)
    	nrf_delay_us(8);
    
    	sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE); //DC-DC mode enabled
    	//	sd_ble_gap_tx_power_set(0); 									 //Tx power 0dBm
        // Enter main loop.
    		
        for (;;)
        {
            power_manage();
    	}
    }

    If you find a mistake in this code, please let me know.

    best regards!!!

  • Hi!!

    I decided to send data with a timer.

    I forgot to enable TIMER in sdk_config.

    thank you !!

Related