Due to the fake STM32F103C8T6 module in the market, the delayMicroseconds function is working qucker than expected, when I expect a delay of 1000 us , I get a delay of 500 us. Is there a better method, like to create separate module for counting in microseconds using micros timer? Or there are other proper bootloaders than this one . I use Arduino IDE for programming STM32F103C8T6
-
Being off by a factor of 2 seems to be way too much. I have no experience with ARM processors, but I've seen such problems with AVR based microcontrollers, when the frequency set by the fuses was different, that what was set in the Arduino IDE. So the microcontroller ran on a different frequency. Are you sure, that you run on the right frequency?chrisl– chrisl03/11/2020 19:31:47Commented Mar 11, 2020 at 19:31
1 Answer 1
Have you considered using a RTC? Something like a DS1307 breakout with I2C communications will provide you with accurate timing. https://www.bobmixon.com/2020/03/real-time-clock-and-arduino/
-
1How would you do a 1,000 µs delay with a DS1307?Edgar Bonet– Edgar Bonet03/11/2020 16:08:06Commented Mar 11, 2020 at 16:08
-
Good point... the OP wrote "µs" and I read "ms". lolBob– Bob03/12/2020 17:21:42Commented Mar 12, 2020 at 17:21