DA14681 timer for pxp_reporter example

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
kvenkatraman
Offline
Last seen:3 years 11 months ago
Joined:2017-05-03 22:26
DA14681 timer for pxp_reporter example

I am using DA14681 devkit PRO board and pxp_reporter example. I want to add hw_timer0 to this project and want to toggle an i/O line in timer0_isr. I noticed that this toggle is synchronous to the blue LED flashing (fast or slow advertising) on the board.

Where can I find the source code for this blinking LED?

Is hw_timer0 being used anywhere in this example? How do I know what peripherals are being used by the different sdk examples? From the forums, I realize that timer1 is used by the FreeRTOS. Can you list different peripherals that are used by this example?

This is my test code in periph_init function:

hw_timer0_init(NULL);
hw_timer0_set_clock_source (HW_TIMER0_CLK_SRC_SLOW);
hw_timer0_set_t0_reload(32767, 32767);
hw_timer0_set_on_reload(200);
hw_timer0_register_int(timer0_interrupt_cb);
hw_timer0_enable();

Device:
MT_dialog
Offline
Last seen:2 months 3 weeks ago
Staff
Joined:2015-06-08 11:34
Hi kvenkatraman,

Hi kvenkatraman,

You mean the blue led that keeps on blinking ? that led is not driven via sw but from the hw itself, actually its a led that indicates that the device is sleeping or not, and that is why you see it light up when your sw driven LED is toggling, since in order for the peripherals to be active, the device should be active as well.

Most of the peripherals are used in the peripherals_demo project and there are a couple readme files in the bottom of the eclipse tree (every SDK project has this readme file with instructions how to set up the demo), so you can check there for the peripherals that are used for each demo. Yes the tick for the Free RTOS is provided by timer 1 which also is the only peripheral that is not shut down during sleep, and its also adviced not to mess with that timer. Please check the peripherals_demo, there is a timer especially for timer 0.

Thanks MT_dialog