6 years, 10 months ago.

How to improve the performance of a Ticker which is implemented using 16-bit timer?

When running the code below on a NUCLEO-F103RB board I observed occasional pauses in ticks. In addition, the Ticker stopped generating ticks after setting the interval to 100us or less

main.cpp

#include "mbed.h"

DigitalOut  digitalOut(PA_9);
Ticker      ticker;

void flip(void) {
    digitalOut = !digitalOut;
}

int main(void) {
    ticker.attach_us(callback(&flip), 150);

    while(1){}
}

Solved in mbed rev. 145.

1 Answer

6 years, 10 months ago.

Hi,

Thanks for your code.

Please see this PR on github: https://github.com/ARMmbed/mbed-os/pull/4424

Accepted Answer

Thank you for the link.

Good job!

posted by Zoltan Hudak 08 Jun 2017