Hi!!
I changed the example of SDK14.0.0's ble_app_uart and I am doing low power consumption.
I used timer interruption and now I am driving with power consumption of 1.2 ~ 1.4 mA.
But my goal is to drive the sensor at around 300 μA.
Consumed current was reduced by referring to the technology part below that reduces current consumption.
①DC-DC enabled②use of timers③turnning connection parameters④Put power_manager in for statement and enter system on mode at all times
https://devzone.nordicsemi.com/tutorials/b/hardware-and-layout/posts/nrf51-current-consumption-guide
Data is transmitted every 8 ms by SPI.
I enabled SPI on SPI when sending data and disabled SPI when I was not sending data.
static void timer_timeout_handler(void * p_context)
{
static uint8_t m_tx_buf[1];
uint16_t length = 16;
static uint8_t m_rx_buf[16];
m_tx_buf[0] = 0x00;
if(0 == nrf_gpio_pin_read(30)){
// NRF_SPI1->ENABLE = 1;
// nrf_delay_ms(2);
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, 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);
//nrf_delay_ms(2);
//NRF_SPI1->ENABLE = 0;
}
}
Also, I will buffer the data with SPI and send data by ble. Should UART be overcome for low power consumption?
However, data transmission was not completed.
①Where should I fix to solve this problem?
②What else should we do to lower the average current consumption to 300 μA other than this?
If you have something to know, please let me know!!!
thank you in advanced!!!