It is a very normal step-by-step learning method to learn the entire computer system from the microcontroller. Because until today, the computer system has not escaped this most basic architecture. Unfortunately, I skipped this process and started directly from Intel 486. At that time, I was struggling forward with countless questions every day.
You don't have to learn 51 microcontrollers. In fact, any one you choose is the same. From a practical point of view, you should choose a cheap one with fewer peripheral devices and more functions, so I chose STM8L for you.
STM8L is an 8-bit microcontroller. I did see some friends in the forum asking what is 8-bit? I am at least glad that this brother is really thinking about it. Usually, when I say 8-bit, I mean the ability of the CPU to calculate, or more specifically, to add, two 8-bit binary numbers. Similarly, 32-bit means the addition of 32-bit binary numbers.
In addition, and this is the most difficult part, the address range of this 8-bit microcontroller is not necessarily 8 bits, so you should pay attention to this. Address range, don't understand? It's better to say address range. Imagine that there are 8 address lines, and each line uses high or low voltage to represent 1 and 0. Then how many numbers can these 8 lines represent in total? You can count them one by one, of course, it is best to calculate 2 to the 8th power combinations. That is 256 numbers, each number represents an address to access one byte of data, so you can only access 256 bytes. This space is too small. So STMicroelectronics will not design it this way, so increase the address lines to 16 address lines, 2 to the 16th power, equals 65536 addresses. I remember a course called "Computer Principles", which is a very practical book, but unfortunately the teacher's teaching is too bad and unattractive.
65536 is 64KB. For STM8L151K4T6, 16KB flash and 2KB ram are enough for addressing. The entire address space of a microcontroller is usually very simple, which is a continuous linear space 0x0000~0xFFFF. It's just that there are pieces of memory scattered in it, some are flash, some are ram, some are register sets, and some are ROM. That's all, don't think it's complicated.
Flash and Ram are used to store code and data, including the stack.
Registers are the only interface for software to control peripherals. Writing a driver program is dealing with these registers. The design of registers for each chip is different, and you need to read a lot of information from the manufacturer, usually in English.
Fortunately, ST has released standard peripheral library functions, so you no longer need to care about register details. But if you are a MCU beginner, I recommend reading the standard peripheral library code and the chip manual. After you read a certain amount, you will find the commonalities of all chips on the market and understand the advantages and disadvantages of their designs. If you have a clear idea in mind, you can guess the register design of any chip without even reading the manual. This is the highest level of driver program.
Previous article:STM8L minimum system board transplanted Atomthreads successfully
Next article:Playing with STM8 microcontroller (Part 2)
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- 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
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- BP3286H Buck-Boost Closed-Loop SCR Dimming LED Driver IC
- [National Technology N32G457 Review] ADC Data Collection
- Why does TI's official website classify C2000 as MCUs?
- [TI Live] The latest innovative DLP automotive application solutions, dynamic ground lights, augmented reality head-up display "pat" you
- Winding inductance of electrolytic capacitor
- A beginner's tutorial on TCP server development in Linux using C language
- iQOO 200W and 120W GaN ultra-fast flash charging
- Hardware Design of STM32 USB Interface
- [GigaDevice GD32F310 Review] +RTC Usage
- [TI recommended course] #Live replay: TI's new generation C2000 microcontroller#