hi....
i am using nrf52832 and peripheral device , microcontroller should run continuously , nrf should be in turn off mode and it should turn on when the data need to send in(ble app)
how to do this ?
hi....
i am using nrf52832 and peripheral device , microcontroller should run continuously , nrf should be in turn off mode and it should turn on when the data need to send in(ble app)
how to do this ?
Hi,
The nRF52 series have two sleep modes; system on and system off sleep mode. In System off, the system can only wake up from GPIO event, NFCT field, analog event from LPCOMP, or a reset. It sounds like this mode is not suitable for your requirements? In system on mode, the CPU can wakeup on any event from any peripheral, and is used in almost every example in the SDK (by calling __WFE() or sd_app_evt_wait()).
Best regards,
Jørgen
Hi,
The nRF52 series have two sleep modes; system on and system off sleep mode. In System off, the system can only wake up from GPIO event, NFCT field, analog event from LPCOMP, or a reset. It sounds like this mode is not suitable for your requirements? In system on mode, the CPU can wakeup on any event from any peripheral, and is used in almost every example in the SDK (by calling __WFE() or sd_app_evt_wait()).
Best regards,
Jørgen
Why ? Can't we put nrf in sleep mode
What will be your wakeup source when you know that you have data to transmit? Are you talking about an analog signal threshold?
no , i will assign the threshold value..see the code below for reference
void timer_sensor_event_handler(void)
{
uint32_t threshold = 32;
char str[80];
uint32_t length1;
char pavi;
char event;
switch (event)
{
if(m_sample < threshold)
{
length1 = sprintf(str,"%d", m_sample);
ble_nus_data_send(&m_nus,str,sizeof(m_sample), m_conn_handle);
ret_code_t err_code = nrf_drv_twi_rx(&m_twi, 0x48U, &m_sample, sizeof(m_sample));
NRF_LOG_INFO("SUCCESS1");
}
break;
default:
//Do nothing.
break;
}
}Something in your application have to update the value that you compare against the threshold. In your code it looks like you use a timer to compare the sample with the threshold. The timer will wake the chip when it times out. When there is no more work for the CPU, you put it back to sleep with __WFE() or sd_app_evt_wait() in main loop.