Hi,
I have a custom board in which i am using nRF52840 with SDK version is 16.0.0.
I have tested app_uart library its working Ok and current consumption is 6 uA in deep sleep. but i cant use two serial port in app_uart library so i have to go for nrf_serial.h
i am using following two Function for uart init and uninit.
void usart0_init()
{
NRF_SERIAL_DRV_UART_CONFIG_DEF(m_uarte0_drv_config,UART0RX_PIN,UART0TX_PIN,RTS_PIN_NUMBER,CTS_PIN_NUMBER,NRF_UART_HWFC_DISABLED,NRF_UART_PARITY_EXCLUDED,NRF_UART_BAUDRATE_9600,UART_DEFAULT_CONFIG_IRQ_PRIORITY);
ret_code_t ret;
ret = nrf_serial_init(&serial0_uarte, &m_uarte0_drv_config, &serial0_config);
NRF_LOG_INFO("usart0_init_err_code = %d",ret);
APP_ERROR_CHECK(ret);
}
void usart0_uninit()
{
ret_code_t err_code=0;
nrf_serial_tx_abort(&serial0_uarte);
nrf_serial_rx_drain(&serial0_uarte);
err_code = nrf_serial_uninit(&serial0_uarte);
NRF_LOG_INFO("usart0_uninit err_code = %d",err_code);
APP_ERROR_CHECK(err_code);
nrf_delay_ms(50);
}
without use of Uart init and uninit function Power consumption is 6 micro amps.
but when i use usart0_init() and once the work completion with uart peripheral, i make device into deep sleep and before go into sleep i am using usart0_uninit().
but power consumption in deep sleep is remains high upto 1200 micro amps.
So without usart0_init() and usart0_uninit() in code power consumption is 6 micro amps in deep sleep and with usart0_init() and usart0_uninit() in code power consumption is 1200 micro amps.
So Please help me to how i can reduce power consumption using init and uninit function of nrf_serial library.
Thanks in advance for your kind support.