The minimum duration to wake up is around 10 msec, because the DA14580 needs around 5.7ms to wake up. Thε 10msec is not an ideal option, it is just being shown as a reference of the minimum value of a periodic wake-up. But why you would like to wake up every 1msec? If the DA14585 is configured in any of sleep mode, it will go into sleep between advertising or connection intervals. Please check the ble_app_peripheral example of the SDK. This example is using the extended sleep mode, please check app_default_sleep_mode in user_config header file. Also check the advertise_configuration in the same file and you will see that the advertising interval is 100msec, so the device will go into extended sleep mode between the advertising intervals. Regarding the app_easy_timer, you are correct, the 10ms is the minimum allowed value.
Timer0 has an interrupt functionality and you will be able to sync the ADC read using that interrupt feature. Regarding how to set up the timer0 interrupt function, you can use the timer0_general example. You can configure the timer0 for 1ms delay to generate an interrupt with that period. So, every timer that the interrupt is generated, you should sample the ADC. Regarding the sleep, all the peripherals are shut down including the timers and the adc.
There is no way to wake-up every 1ms. When the device goes into sleep all the peripheral blocks are shut down including the timers and the ADC. You can wake up only with the next two ways:
Synchronously, via the BLE timer which can be programmed to wake up the system,
Asynchronously, via an external interrupt (wake up controller).
Please check theTutorial 4: Sleep modes current measurementfor getting more information about the sleep modes. If you don’t use any of sleep modes (no low pawer consumption), you could use timer0 for 1ms ADC sampling.
Hi Roie DAHAN,
The minimum duration to wake up is around 10 msec, because the DA14580 needs around 5.7ms to wake up. Thε 10msec is not an ideal option, it is just being shown as a reference of the minimum value of a periodic wake-up. But why you would like to wake up every 1msec? If the DA14585 is configured in any of sleep mode, it will go into sleep between advertising or connection intervals. Please check the ble_app_peripheral example of the SDK. This example is using the extended sleep mode, please check app_default_sleep_mode in user_config header file. Also check the advertise_configuration in the same file and you will see that the advertising interval is 100msec, so the device will go into extended sleep mode between the advertising intervals. Regarding the app_easy_timer, you are correct, the 10ms is the minimum allowed value.
Thanks, PM_Dialog
Hi,
My product requirement are do mesure ADC every 1ms while maintain minium battary power, any idea how to do it with DA14585?
Regards,
Roie
Hi Roie DAHAN,
Timer0 has an interrupt functionality and you will be able to sync the ADC read using that interrupt feature. Regarding how to set up the timer0 interrupt function, you can use the timer0_general example. You can configure the timer0 for 1ms delay to generate an interrupt with that period. So, every timer that the interrupt is generated, you should sample the ADC. Regarding the sleep, all the peripherals are shut down including the timers and the adc.
Thanks, PM_Dialog
Hi,
So, per my understanding the timer0 is disabled when going to sleep therefor it will not collect data every 1ms?
Is there any other way to wakeup every 1ms ?
Regards,
Roie
Hi Roie DAHAN,
There is no way to wake-up every 1ms. When the device goes into sleep all the peripheral blocks are shut down including the timers and the ADC. You can wake up only with the next two ways:
Please check theTutorial 4: Sleep modes current measurementfor getting more information about the sleep modes. If you don’t use any of sleep modes (no low pawer consumption), you could use timer0 for 1ms ADC sampling.
Thanks, PM_Dialog