Some understanding of high level effective and low level effective in STM32

Publisher:数据之翼Latest update time:2019-04-10 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In the process of learning STM32, we often encounter words such as "high level is effective" and "low level is effective". When we first see them, we often understand them literally, thinking that high level is effective means the effective level is high level, and low level is effective means the effective level is low level. In fact, this understanding is wrong. Let's take the output comparison channel in the STM32 timer as an example:



This picture is actually a process of generating a PWM wave. Those who don't know much about timers can refer to the relevant manual. Now let's look at the output mode controller labeled 1 in the figure. The mode here refers to the PWM mode, which means that the PWM mode can be selected by configuring the two bits OC1M of the register TIMx_CCMR1. However, regarding mode selection, there is such a sentence in the manual: When counting down, once TIMx_CNT>TIMx_CCR1, channel 1 is an invalid level (OC1REF=0), otherwise it is a valid level (OC1REF=1).


The red font tells us: when OCREF is an invalid level, it is a low level, and when OCREF is a valid level, it is a high level.


Let's look at label 2: Its function is to select the output polarity. If the CC1P bit of TIMx_CCER is 0, the high level is valid, otherwise the low level is valid. What does this high level valid mean? For the selector, the high level is valid. If OCREF is high, the gate of the selector will open, allowing the signal to enter and "activate" the selector. After that, the selector will generate a signal to activate the subsequent output enable circuit to drive OC1, so that it generates a valid level on OC1 (that is, a high level is generated on OC1).


Through the above analysis, we can find that high level valid means that if the signal is at a high level, it is valid for the corresponding controller and can activate the relevant functions of the controller.


Summarize a few key words: Effective level: high level


                         Invalid level: low level


                         High level is valid: high level can enable the corresponding function


                         Low level is effective: Low level can enable the corresponding function


Keywords:STM32 Reference address:Some understanding of high level effective and low level effective in STM32

Previous article:Solution to the problem that the STM32 I/O port cannot output high and low levels normally
Next article:STM32-External Interrupt Study Notes

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号