<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Microsecond on Carmine Noviello</title><link>https://www.carminenoviello.com/tags/microsecond/</link><description>Recent content in Microsecond on Carmine Noviello</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sat, 05 Sep 2015 05:08:36 +0000</lastBuildDate><atom:link href="https://www.carminenoviello.com/tags/microsecond/index.xml" rel="self" type="application/rss+xml"/><item><title>How to precisely measure microseconds with STM32</title><link>https://www.carminenoviello.com/2015/09/04/precisely-measure-microseconds-stm32/</link><pubDate>Fri, 04 Sep 2015 09:41:12 +0000</pubDate><guid>https://www.carminenoviello.com/2015/09/04/precisely-measure-microseconds-stm32/</guid><description>&lt;p&gt;I received this apparently simply question from a reader of this blog: how can I delay a fistful of microseconds in STM32? That is, how to measure microseconds precisely in STM32?&lt;/p&gt;&#10;&lt;p&gt;The answer is: there are several ways to do this, but some methods are more accurate and other ones are more versatile among different MCUs and clock configuration.&lt;/p&gt;&#10;&lt;p&gt;Let&amp;rsquo;s consider one member of the STM32F4 family: STM32F401RE, the MCU that equips the STM32Nucleo-F401RE board. This micro is able to run up to 84Mhz using internal RC clock. This means that ever 1µs, the clock cycles 84 times. So, we need a way to count 84 clock cycles to assert that 1µs is elapsed (I&amp;rsquo;m assuming that you can tolerate the internal RC clock 1% accuracy).&lt;/p&gt;</description></item></channel></rss>