There are two concepts that I personally think are the core of MCU learning:
timer
interrupt
If we delve a little deeper into the study of microcontrollers, we can't get rid of these two concepts.
Among them, the timer is the basis of interrupts, so the timer is still confused. It can be said that MCU programming and MCU learning have not yet been introduced.
The other way around can be said:
Once you understand the timer, you have completed 90% of the introductory learning of microcontrollers. No matter how much time you spend on the timer, it is worth it. It is the core breakthrough point for getting twice the result with half the effort.
What is a timer: a stopwatch, an hourglass.
From the name, we can know that the timer is an instrument that determines time.
To realize this function, several key conditions need to be established:
container
Initial value, initial setting
Trigger mechanism
end instruction
In fact, the above four conditions are not unique to timers. They need to be set as basic conditions for each component of the microcontroller to realize their functions.
Let’s first use an hourglass as an example to illustrate these four basic conditions:
Container: glass bottle filled with sand
Initial value: After the hourglass is turned upside down, half of the glass bottle contains the amount of sand. The hourglass usually contains all the sand.
Trigger: We turn the hourglass over with our hands
Ending indication: Our visual observation was that all the sand flowed into the lower half of the glass bottle.
Key conditions for timer implementation function:
Container: timer unit of microcontroller (timer 0, 1, 2 in the picture above)
Initial value, initial setting: fill in the initial value of each timer register
Trigger mechanism: software trigger, hardware trigger (the hourglass man triggers, as I said many times before, you can also think of the microcontroller as a person)
End indication: the initial value is cleared (becomes 0) or the initial value reaches the set value
In fact, timers generally turn off interrupts when initially set, enable interrupts when running, and trigger interrupts when the timer is completed. The term "interruption" will be discussed later, but I will mention it for now.
Previous article:The simplest single-chip state machine model (X-state machine)
Next article:E2.2 Microcontroller open source framework--time slice polling--ideas
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- ESP32-Cam Programmer
- NXP Rapid IoT Review] + ⑤ Full Interpretation of NXP Rapid IoT Code, Finding Traces of RTC
- Boosting the electric era, explore the three major product technologies of electric vehicles with Infineon
- Getting Started with Using TouchGFX to Develop STM32 Interface Applications (Part 2) - Button and Message Response Routines
- Request: Recommend a PHY chip for stm32f407!
- 【EasyARM-RT1052 Review】+ Unboxing Experience
- Practical RF training course sharing 2
- Looking for books that explain basic circuits?
- 10-TCP protocol (MSS)
- 60W Sensorless BLDC Motor Driver Reference Design