{"id":3077,"date":"2024-12-07T16:31:57","date_gmt":"2024-12-07T16:31:57","guid":{"rendered":"https:\/\/blog.embeddedexpert.io\/?p=3077"},"modified":"2024-12-07T16:33:16","modified_gmt":"2024-12-07T16:33:16","slug":"getting-started-with-stm32h5-arm-cortex-m33-timer-in-output-compare-mode","status":"publish","type":"post","link":"https:\/\/blog.embeddedexpert.io\/?p=3077","title":{"rendered":"Getting Started with STM32H5 ARM Cortex M33: Timer in Output Compare Mode"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"725\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/STM32-u5-1-1-1-1024x725.webp\" alt=\"\" class=\"wp-image-3078\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/STM32-u5-1-1-1-1024x725.webp 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/STM32-u5-1-1-1-300x212.webp 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/STM32-u5-1-1-1-768x544.webp 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/STM32-u5-1-1-1-750x531.webp 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/STM32-u5-1-1-1-400x283.webp 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/STM32-u5-1-1-1-250x177.webp 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/STM32-u5-1-1-1.webp 1141w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>In the second part of timer series on STM32H5, we shall use timer in output compare to blink the LED using hardware level rather than software.<\/p>\n\n\n\n<p>In this guide, we shall cover the following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>What is Output Compare Mode.<\/li>\n\n\n\n<li>STM32CubeMX setup.<\/li>\n\n\n\n<li>Firmware Development.<\/li>\n\n\n\n<li>Results.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">1. What is Output Compare Mode:<\/h2>\n\n\n\n<p>The&nbsp;<strong>Output Compare<\/strong>&nbsp;concept in STM32 is based on comparing the timer\u2019s counter value with a predefined value (stored in a capture\/compare register) to trigger an event or perform an action. It\u2019s used for precise timing, periodic signals, and PWM generation.<\/p>\n\n\n\n<p><strong>Core Concept:<\/strong><\/p>\n\n\n\n<p>1. <strong>Timer Counting<\/strong>:<\/p>\n\n\n\n<p>\u2022 A timer counts up, down, or both (depending on the mode).<\/p>\n\n\n\n<p>\u2022 The current count value is stored in the&nbsp;<strong>Counter Register (<\/strong>CNT<strong>)<\/strong>.<\/p>\n\n\n\n<p>2. <strong>Comparison<\/strong>:<\/p>\n\n\n\n<p>\u2022 A predefined value is stored in a&nbsp;<strong>Compare Register (<\/strong>CCR<strong>)<\/strong>.<\/p>\n\n\n\n<p>\u2022 The timer continuously compares the&nbsp;CNT&nbsp;value with&nbsp;CCR.<\/p>\n\n\n\n<p>3. <strong>Match Event<\/strong>:<\/p>\n\n\n\n<p>\u2022 When&nbsp;CNT == CCR, the timer generates a match event.<\/p>\n\n\n\n<p>\u2022 The event can trigger an action (e.g., toggling a pin, generating an interrupt, or updating a PWM signal).<\/p>\n\n\n\n<p><strong>Use Cases:<\/strong><\/p>\n\n\n\n<p>\u2022 <strong>Generating Periodic Signals<\/strong>: Toggle a GPIO pin at regular intervals.<\/p>\n\n\n\n<p>\u2022 <strong>PWM Signal Generation<\/strong>: Control duty cycles for motor drivers or LED dimming.<\/p>\n\n\n\n<p>\u2022 <strong>Input Capture Synchronization<\/strong>: Measure or synchronize external signal timing.<\/p>\n\n\n\n<p>\u2022 <strong>Event Timing<\/strong>: Trigger specific actions at predefined time intervals.<\/p>\n\n\n\n<p><strong>Output Compare Modes:<\/strong><\/p>\n\n\n\n<p>1. <strong>Toggle Mode<\/strong>: Changes the GPIO pin state (high\/low) on each match.<\/p>\n\n\n\n<p>2. <strong>Set Mode<\/strong>: Forces the GPIO pin high when a match occurs.<\/p>\n\n\n\n<p>3. <strong>Reset Mode<\/strong>: Forces the GPIO pin low when a match occurs.<\/p>\n\n\n\n<p>4. <strong>PWM Mode<\/strong>: Outputs a pulse-width-modulated signal, varying the on\/off times.<\/p>\n\n\n\n<p><strong>Key Features:<\/strong><\/p>\n\n\n\n<p>\u2022 <strong>Resolution<\/strong>: Depends on the timer\u2019s bit width (16-bit or 32-bit).<\/p>\n\n\n\n<p>\u2022 <strong>Precision<\/strong>: Achieved using the timer\u2019s prescaler to adjust clock speed.<\/p>\n\n\n\n<p>\u2022 <strong>Flexibility<\/strong>: Multiple channels per timer for simultaneous compare events.<\/p>\n\n\n\n<p>\u2022 <strong>Interrupts<\/strong>: Can trigger interrupts on compare match for software-driven actions.<\/p>\n\n\n\n<p><strong>Example in Words:<\/strong><\/p>\n\n\n\n<p>\u2022 A timer is configured to count from 0 to 1000 (auto-reload value).<\/p>\n\n\n\n<p>\u2022 A compare value of 500 is set in&nbsp;CCR1.<\/p>\n\n\n\n<p>\u2022 When the timer reaches 500, it toggles a GPIO pin (or triggers an interrupt).<\/p>\n\n\n\n<p>\u2022 The process repeats as the timer resets and counts again.<\/p>\n\n\n\n<p>By using Output Compare, you can control real-time events with high precision, critical in embedded systems like motor control, signal generation, or sensor sampling.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"503\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/IMG_0089-1024x503.jpg\" alt=\"\" class=\"wp-image-3079\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/IMG_0089-1024x503.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/IMG_0089-300x147.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/IMG_0089-768x377.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/IMG_0089-1536x754.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/IMG_0089-2048x1006.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/IMG_0089-1150x565.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/IMG_0089-750x368.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/IMG_0089-400x196.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/IMG_0089-250x123.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>We shall use toggle Mode to blink an LED.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2. STM32CubeMX:<\/h2>\n\n\n\n<p>We start off by creating new project with name of OutputCompare. For how to create new project, please refer to <a href=\"https:\/\/blog.embeddedexpert.io\/?p=2789\" data-type=\"link\" data-id=\"https:\/\/blog.embeddedexpert.io\/?p=2789\" target=\"_blank\" rel=\"noreferrer noopener\">this guide<\/a>.<\/p>\n\n\n\n<p>Since STM32H563Zi Nucleo-144 has arduino pinout, we can use that.<\/p>\n\n\n\n<p>From the user guide of STM32H563ZI Nucleo-144 we can find that A0 of Arduino pin is connected to PA6 as following:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"973\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-41-44-1024x973.jpg\" alt=\"\" class=\"wp-image-3068\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-41-44-1024x973.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-41-44-300x285.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-41-44-768x730.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-41-44-1536x1459.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-41-44-1150x1093.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-41-44-750x713.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-41-44-400x380.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-41-44-250x238.jpg 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-41-44.jpg 1922w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Hence we shall connect external LED through 220Ohm resistor to limit the current as following:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"532\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-05_17-06-29-1024x532.jpg\" alt=\"\" class=\"wp-image-3069\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-05_17-06-29-1024x532.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-05_17-06-29-300x156.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-05_17-06-29-768x399.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-05_17-06-29-1536x798.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-05_17-06-29-2048x1064.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-05_17-06-29-1150x598.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-05_17-06-29-750x390.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-05_17-06-29-400x208.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-05_17-06-29-250x130.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>From STM32CubeIDE enable PA6 as TIM3_CH1 as following:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"465\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-44-18-1024x465.jpg\" alt=\"\" class=\"wp-image-3070\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-44-18-1024x465.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-44-18-300x136.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-44-18-768x349.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-44-18-1536x698.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-44-18-2048x931.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-44-18-1150x523.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-44-18-750x341.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-44-18-400x182.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-06_06-44-18-250x114.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Next, from timers section, enable TIM3 as following:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set the clock source to be internal.<\/li>\n\n\n\n<li>Enable Channel 1 to be in PWM mode as following:<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"936\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-18-17-1024x936.jpg\" alt=\"\" class=\"wp-image-3080\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-18-17-1024x936.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-18-17-300x274.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-18-17-768x702.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-18-17-1536x1404.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-18-17-2048x1872.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-18-17-1150x1051.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-18-17-750x686.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-18-17-400x366.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-18-17-250x229.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Next from clock configuration, we need to find the frequencies of the timers:<\/p>\n\n\n\n<p>By default, STM32H563Zi is running at 32MHz. Hence, the timers are 32MHz in speed.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"502\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/11\/2024-11-17_06-25-54-1024x502.jpg\" alt=\"\" class=\"wp-image-3011\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/11\/2024-11-17_06-25-54-1024x502.jpg 1024w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/11\/2024-11-17_06-25-54-300x147.jpg 300w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/11\/2024-11-17_06-25-54-768x376.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/11\/2024-11-17_06-25-54-1536x753.jpg 1536w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/11\/2024-11-17_06-25-54-2048x1004.jpg 2048w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/11\/2024-11-17_06-25-54-1150x564.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/11\/2024-11-17_06-25-54-750x368.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/11\/2024-11-17_06-25-54-400x196.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/11\/2024-11-17_06-25-54-250x123.jpg 250w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Hence, we can configure the timer with the following parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Prescaler to 32000-1 which this will reduce the timer frequency to 1KHz.<\/li>\n\n\n\n<li>ARR to 1000-1, this will let timer counts to 1000 (0-999) which will provide 1Hz output.<\/li>\n\n\n\n<li>Set the mode to toggle on match for the output compare channel 1.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"978\" height=\"1024\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-22-16-978x1024.jpg\" alt=\"\" class=\"wp-image-3081\" srcset=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-22-16-978x1024.jpg 978w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-22-16-287x300.jpg 287w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-22-16-768x804.jpg 768w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-22-16-1150x1204.jpg 1150w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-22-16-750x785.jpg 750w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-22-16-400x419.jpg 400w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-22-16-250x262.jpg 250w, https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/12\/2024-12-07_19-22-16.jpg 1318w\" sizes=\"(max-width: 978px) 100vw, 978px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Thats all for STM32CubeMX configuration.<\/p>\n\n\n\n<p>Save the project and this shall generate the project.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3. Firmware Development:<\/h2>\n\n\n\n<p>After the code has been generated, the main.c file shall be open.<\/p>\n\n\n\n<p>In user code begin 2 of the main function, we shall start the timer in the output compare mode as following:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text\/x-csrc&quot;,&quot;theme&quot;:&quot;dracula&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;c&quot;}\">HAL_TIM_OC_Start(&amp;htim3, TIM_CHANNEL_1);<\/pre><\/div>\n\n\n\n<p>HAL_TIM_OC_Start takes the following parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Instant to the timer which is timer3 in this case.<\/li>\n\n\n\n<li>Timer channel which is channel1 in this case.<\/li>\n<\/ul>\n\n\n\n<p>Thats all for the firmware.<\/p>\n\n\n\n<p>Save the project, build it and run it on your STM32H563Zi board.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/blog.embeddedexpert.io\/wp-content\/uploads\/2024\/07\/2024-07-12_15-03-3.jpg\" alt=\"\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4. Results:<\/h2>\n\n\n\n<p>After the running the code, you should get the following:<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Output Compare Mode of Timer in STM32H5\" width=\"1170\" height=\"658\" src=\"https:\/\/www.youtube.com\/embed\/HWAx3J7b05Y?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Happy coding \ud83d\ude09<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the second part of timer series on STM32H5, we shall use timer in output compare to blink the LED using hardware level rather than software. In this guide, we shall cover the following: 1. What is Output Compare Mode: The&nbsp;Output Compare&nbsp;concept in STM32 is based on comparing the timer\u2019s counter value with a predefined [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,11,12],"tags":[],"class_list":["post-3077","post","type-post","status-publish","format-standard","hentry","category-embedded-systems","category-peripheral-drivers","category-stm32"],"_links":{"self":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/3077"}],"collection":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3077"}],"version-history":[{"count":3,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/3077\/revisions"}],"predecessor-version":[{"id":3085,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=\/wp\/v2\/posts\/3077\/revisions\/3085"}],"wp:attachment":[{"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.embeddedexpert.io\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}