First, let's talk about variables. As the name implies, a variable is a variable that can be changed, similar to the unknown number (X, Y, Z) in a mathematical equation. From the perspective of computer hardware, a variable is actually a symbolic abstraction of a RAM unit. In C language, a variable must be defined with a data type before it can be used.
Keywords:MCU
Reference address:Commonly used data types in microcontroller application design
As we all know, C language data types are divided into basic data types, bits, pointers, and constructed data types (arrays, structures, unions). MCU applications are composed of a collection of variables defined by these data types.
In a single-chip program system, we often use a file called typedef.h to display the required data types. In specific program design, we need to define various types of variables according to different functional needs. Commonly used ones include data temporary storage class, flag class, etc. For example, it is used to display cache, data collected after analog-to-digital conversion, etc. We will define different types of variables according to different uses, different value ranges, and different scopes.
Basic data types are the types we often use. In a specific MCU program, we use basic data types to define some flags, temporary storage, and scattered quantities. For example, in an RTC system, we can define (typedef unsigned char u8), u8 hour, u8 minute, u8 second. Basic data types are the simplest, most basic, and most commonly used data types. They are also the most frequently used in operations.
Commonly used basic data types include char, int, float, double, etc. There are signed and unsigned types.
Previous article:Methods for Finding Causes of MCU Program Crash
Next article:Understanding of MCU address space stack
- Popular Resources
- Popular amplifiers
Recommended Content
Latest Microcontroller Articles
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
MoreDaily News
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
Guess you like
- Detailed explanation of MSP430F149 serial port receiving and sending program
- Those power supply test issues we ignore
- [Activity] Thank you for being here, thank you for the courtesy!
- Heat Transfer: Thermal Management of Power Electronics
- Domestic HGI ultra-low power MCU is here!
- New OBD device with intelligent brake light control system
- [Attley AT32WB415 series Bluetooth BLE 5.0 MCU] After changing to ATLINK, the first program finally ran
- CircuitPython Diamond
- Headlight test equipment
- [Jihai APM32E103VET6S MINI development board review] Part 2: Timer PWM lighting