hi ... i am using nRF52832 ,i want to save the battery so i am planning to use system off mode . how to wake up the device from system off mode using threshold value or either system on mode
is it possible ? how to do
Thanks in advance
hi ... i am using nRF52832 ,i want to save the battery so i am planning to use system off mode . how to wake up the device from system off mode using threshold value or either system on mode
is it possible ? how to do
Thanks in advance
In system OFF the chip can wake up by the ANADETECT signal, created by the LPCOMP peripheral: http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=2_1_0_17_1#unique_1707892264
And from the LPCOMP peripheral:
The LPCOMP can wake up the system from System OFF by asserting the ANADETECT signal. The ANADETECT signal can be derived from any of the event sources that generate the UP, DOWN and CROSS events. In case of wakeup from System OFF, no events will be generated, only the ANADETECT signal. See the ANADETECT register (ANADETECT) for more information on how to configure the ANADETECT signal.
And here is an example in the SDK demonstrating the use of LPCOMP: http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/lpcomp_example.html?cp=4_0_0_4_5_17
In system OFF the chip can wake up by the ANADETECT signal, created by the LPCOMP peripheral: http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=2_1_0_17_1#unique_1707892264
And from the LPCOMP peripheral:
The LPCOMP can wake up the system from System OFF by asserting the ANADETECT signal. The ANADETECT signal can be derived from any of the event sources that generate the UP, DOWN and CROSS events. In case of wakeup from System OFF, no events will be generated, only the ANADETECT signal. See the ANADETECT register (ANADETECT) for more information on how to configure the ANADETECT signal.
And here is an example in the SDK demonstrating the use of LPCOMP: http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.2.0/lpcomp_example.html?cp=4_0_0_4_5_17
Can we wake up by using threshold value
1. Please explain what you mean with "threshold value".
2. Please read the links I posted in my previous answer and see if this is useful to you.
threshold mean here i am using temperature sensor , so i am setting the threshold value (manually) and comparing with temperature value . like this
if(m_sample > threshold)
ok, so in order to do a comparison in software like you described you need the CPU to be running. Software is running on the CPU. If the CPU is running the chip is by definition not in sleep mode. If you are checking a temperature value in software the chip is already running.
If you want the chip to sleep and wake up when the sensor reaches a certain temperature level, you have two choices, depending on what type of sensor you have:
1. Either the temperature sensor itself can be programmed with a threshold-value and it can wake the chip up by asserting a GPIO pin on the chip. This method can wake the chip up either from system OFF mode or system ON mode.
2. Or, the temperature sensor needs to be periodically polled, and you can check the threshold value in code. This method requires the RTC clock to be running, and the RTC clock will wake the chip up from system ON mode, create an interrupt, and the interrupt will be handled in software. Like this: if(m_sample > threshold). and then go back to sleep
Thank you sitan . option 2 is good , i can go with this , actually i tried using timer to interrupt the sleep but i couldn't reach . i don't how to write the flow to interrupt the sleep using timer .. i have succeed upto checking the threshold using timer .can you help me