This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

using RTC in nRF51822

hi all,

I am using the following example:

"..\nRF5_SDK_12.3.0_d7731ad\examples\ble_peripheral\ble_app_uart_adc_scan_mode" to send via bluetooth data coming from ADC.

I have a question. Could it possibile to introduce an RTC in that example? If answer is yes, could you explain me how can I do it? (i.e. what function is necessary?, what is the right place to put the function? and so on.)

Thanks a lot and best regards

Angelo

Parents Reply
  • I see. Then you want to use the app_timer library, which is already used in the example you use. This is a library that is designed to create an arbitrary number of timers using a single RTC instance and is used all over the SDK for such purposes.

    You should create a repeated app timer, and do your periodic work there. I suggest you refer to the app_timer documentation. You may also find the app_timer tutorial useful, though it is no longer 100% accurate for SDK 12.3.

    As the example already initialize the app timer, you essentially just need to add a few pieces of code for your timer. One simple example can be found in <SDK 12.3>\examples\peripheral\wdt\main.c, where the app timer is used to regularly feed the WDT. Your application already initializes the app timer module, but you should refer to this example to see how to create and start an app timer instance.

Children
No Data
Related