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

Cutting power to nrf51 after receiving spi bytes and advertising them using BLE

Hi all,

I'm working on a limited power budget system. MSP430 is the master that is supplying power to nrf51882 (slave). Every 2s MSP430 derives a pin high to drive the nrf51's VCC high and send multiple bytes. nrf51 after receiving the bytes through spi , tries to advertise them.  Then MSP430 waits 200 ms(after sending the multiple bytes)  before cutting the nrf51 power off. I choose 200 ms because I set the advertisement interval on nrf51 to 100 ms. The issue I'm facing is cutting the power off on nrf51 , preventing the advertise packet from being discovered / received by a phone. But when I leave the power on (making MSP430 holding the pin high to source power to nrf51 all the time), I received the advertisement packet on my phone. I tried to increase the waiting time before cutting the power on nrf51 up to 1s but without any luck. 

I'm using soft device 110 and SDK v10. 

Is there any way to cut the power safely on nrf51 while insuring the advertisement packet at least advertised once ? 

or what is the best way to minimize the power consumption of using nrf51 as peripheral to broadcast a data that received from a master?

Parents
  • Thank for you informative and fast response. I did some experiments to see if turning on nrf51 to send an advertisement then turn it off would work. It works fine by setting the advertisement interval to 100ms and make the MSP430 (master) wait more than 100ms (about 300ms-500ms) before cutting the power on nrf51 (slave).

    The problem I faced if I enable spis on nrf51 and try to send some data, uninitiate spis to save power,  advertise the received data and then cut the power off, that nrf51 VCC is hinging at 1.5V after cutting the power although the spin and advertisement process are working fine, but this behavior (nrf51 is stuck at 1.4V) is causing a half amp current consumption which is very high for my system. 

    On the other hand, If I don't use spis on nrf51 and just let the BLE advertise fixed data, every 2s when master (MSP430) powering on nrf51, wait 300ms-500ms  then cut power on nrf51, the nrf51 vcc goes low near Zero volt when the power is cut off and there is no high power consumption.

    Here is my code : 

    int main(void)
    {   
        // Enable the constant latency sub power mode to minimize the time it takes
        // for the SPIS peripheral to become active after the CSN line is asserted
        // (when the CPU is in sleep mode).
        NRF_POWER->TASKS_CONSTLAT = 1;
    
        memset(m_tx_buf, 0, BUF_SIZE); // initializing  the TX buffer
    
        APP_ERROR_CHECK(spi_peripheral_init()); // Initialize SPI to receive sensor data from MSP430
    
        memset(m_tx_buf, 0, BUF_SIZE); // initializing  the TX buffer
    
        memset(m_rx_buf, 0, BUF_SIZE); // reset the RX buffer
        receiving_completed = false;
    
    //    //Set buffers.
        APP_ERROR_CHECK(nrf_drv_spis_buffers_set(&m_spis, m_tx_buf, sizeof(m_tx_buf), m_rx_buf, sizeof(m_rx_buf)));
    //
        while(!receiving_completed) // Wait for data from the Central (MSP430)
        {
            __WFE();   //stay in low power mode
        }
        nrf_drv_spis_uninit(&m_spis); // uninit spis to save power
    
        // Initialize BLE
        ble_stack_init();
        advertising_init();
    
        // Start execution.
        advertising_start();
        
        // Main loop.
        while(1)
        {
            
            power_manage();
        }
        
        
    }

    Do you have any idea why using spis preventing nrf51 vcc to shutdown completely (stuck at 1.4V) when the power is off leading to a half Amp consumption?

Reply
  • Thank for you informative and fast response. I did some experiments to see if turning on nrf51 to send an advertisement then turn it off would work. It works fine by setting the advertisement interval to 100ms and make the MSP430 (master) wait more than 100ms (about 300ms-500ms) before cutting the power on nrf51 (slave).

    The problem I faced if I enable spis on nrf51 and try to send some data, uninitiate spis to save power,  advertise the received data and then cut the power off, that nrf51 VCC is hinging at 1.5V after cutting the power although the spin and advertisement process are working fine, but this behavior (nrf51 is stuck at 1.4V) is causing a half amp current consumption which is very high for my system. 

    On the other hand, If I don't use spis on nrf51 and just let the BLE advertise fixed data, every 2s when master (MSP430) powering on nrf51, wait 300ms-500ms  then cut power on nrf51, the nrf51 vcc goes low near Zero volt when the power is cut off and there is no high power consumption.

    Here is my code : 

    int main(void)
    {   
        // Enable the constant latency sub power mode to minimize the time it takes
        // for the SPIS peripheral to become active after the CSN line is asserted
        // (when the CPU is in sleep mode).
        NRF_POWER->TASKS_CONSTLAT = 1;
    
        memset(m_tx_buf, 0, BUF_SIZE); // initializing  the TX buffer
    
        APP_ERROR_CHECK(spi_peripheral_init()); // Initialize SPI to receive sensor data from MSP430
    
        memset(m_tx_buf, 0, BUF_SIZE); // initializing  the TX buffer
    
        memset(m_rx_buf, 0, BUF_SIZE); // reset the RX buffer
        receiving_completed = false;
    
    //    //Set buffers.
        APP_ERROR_CHECK(nrf_drv_spis_buffers_set(&m_spis, m_tx_buf, sizeof(m_tx_buf), m_rx_buf, sizeof(m_rx_buf)));
    //
        while(!receiving_completed) // Wait for data from the Central (MSP430)
        {
            __WFE();   //stay in low power mode
        }
        nrf_drv_spis_uninit(&m_spis); // uninit spis to save power
    
        // Initialize BLE
        ble_stack_init();
        advertising_init();
    
        // Start execution.
        advertising_start();
        
        // Main loop.
        while(1)
        {
            
            power_manage();
        }
        
        
    }

    Do you have any idea why using spis preventing nrf51 vcc to shutdown completely (stuck at 1.4V) when the power is off leading to a half Amp consumption?

Children
No Data
Related