Wait_us not go below 1ms

24 May 2017

Hi all,

I use STM32F103C8 device and I need waiting some us in my code bit but the wait never goes below 1ms.

With this stupid example :

heartbeat

#include "stm32f103c8t6.h"
#include "mbed.h"

DigitalOut heartbeat(PB_12);

 int main() {
	 confSysClock();     //Configure system clock (72MHz HSE clock, 48MHz USB clock)
     while (1) 
     {
	 heartbeat = 1;
         wait_us(50);
         heartbeat = 0;
	  wait_us(50);
     }
 }

I can see on my scope that wait_us time is in fact 1 ms. Wait_ms and wait seems working without problem.

Do you have any idea?

Thanks