Hi,
I designed a pcb using nrf51 chip with some sensors, this pcb should read ,every minutes, all values from sensors and saves them into the flash memory beside that it should update the value of the characteristic that represent the sensors data. Theses characteristics have to notify the phone every minute about the new characteristics values.
The one minutes routine is done thanks to an external PCF that trigger the nrf through the input interrupt.
All this work are done and work perfectly, but what I want to do is to put the nrf51 into sleep mode the most of the time and only wake him up each minutes only to read the sensors values, save them and update the characteristic to notify the phone about the new values.
My questions are :
1- Is that possible for the nrf and the phone to keep connection while the nrf go to sleep mode for a minute?
2- in case I separate the PCB and the phone form each other for 30 minutes and them I bring them back close together. Will the connection will be kept or should I open the phone and make the connection again ? I don't want to establish manually the connection every time I separate both of device.
3- I read when nrf51 is wake up after a sleep is like restaring it, so it gonna normally start executing the code from the beginning and execute the init function of different periphal ? How can I avoid that and let the nrf exceute only a portion of the code that I want for him to execute and not restaring the whole system.
4- if the nrf is during the sleep mode and I want to wake him up with my phone through Bluetooth, is that possible? This like the input pin interrupt which can wake up the nrf from the sleep mode.
little resume of what i want : turn on the PCB and open phone APP and establish connection, the PCB go to sleep mode and wake up every minute to read and update the characteristic so the phone can be notified and then go back to sleep mode. the connection should be kept even if separate the NRF PCB from the phone for a long time.
FI :the code that i'm using for the nrf I took it from the tutorial : devzone.nordicsemi.com/.../
regards,