For a sensor design I want to use timers with the UART service. I got it somehow working for the S110 version 7. The only problem I have with version 7 is that I can't use the UART like it should. However when I try to port the software to get it working with version 8 of S110, the UART will work. But now the timers don't work. I tried several timer examples, but they work the same way I already use and don't solve my problem or the work not at all. I use several timers, but because of the problems I only use the battery measurement at this moment.
I'm using the following code for my timers. in S110 v8.
// Initialize timer module.
APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false);
// Create BATTERY timer.
err_code = app_timer_create(&m_battery_timer_id, APP_TIMER_MODE_REPEATED, battery_level_meas_timeout_handler);
In the code I use the next function to start my timer.
static void battery_timer_start(void)
{
uint32_t err_code;
uint32_t battery_meas_timer_ticks;
battery_meas_timer_ticks = APP_TIMER_TICKS(BATTERY_LEVEL_MEAS_INTERVAL, APP_TIMER_PRESCALER);
err_code = app_timer_start(m_battery_timer_id, battery_meas_timer_ticks, NULL);
APP_ERROR_CHECK(err_code);
}
When I start the battery timer, the device is resetting.
Does somebody know what I'm doing wrong. Or which timer example can I use and will work with the NUS on the latest version of S110.