Preface
Due to some requirements, we now need to disassemble a hex file into C, so the first thing we need to understand is the overview of PIC and assembly language.
1、PIC
In fact, practically speaking, PIC is just a description of MCU, just like C and JAVA are programming languages. We understand PIC through its functions, features and usage scenarios, and then understand the internal structure and overall framework according to our needs.
Here I quote a description of pic by a big guy 1
What are the advantages of PIC? Maybe you will have such questions, so I will briefly talk about my own views here.
(1) The biggest feature of PIC is that it does not simply pile up functions, but starts from reality, attaches importance to the performance and price ratio of products, and relies on the development of multiple models to meet the application requirements of different levels. In practice, different applications have different requirements for the functions and resources of microcontrollers. For example, a motorcycle ignition requires a small microcontroller with fewer I/Os, less RAM and program storage space, and higher reliability. If a 40-pin and powerful microcontroller is used, the investment will be large and it will be inconvenient to use. The PIC series has dozens of models from low to high to meet various needs. Among them, the PIC12C508 microcontroller has only 8 pins and is the smallest microcontroller in the world. NGE Automation Online Network
This model has 512 bytes of ROM, 25 bytes of RAM, an 8-bit timer, an input line, and 5 I/O lines. The market price is 3-6 yuan. Such a single-chip microcomputer is undoubtedly very suitable for applications such as motorcycle ignition. The high-end model of PIC, such as PIC16C74 (not the highest-end model yet), has 40 pins, and its internal resources are 4K ROM, 192 bytes of RAM, 8-way A/D, 3 8-bit timers, 2 CCP modules, three serial ports, 1 parallel port, 11 interrupt sources, and 33 I/O pins. Such a model can be comparable to high-end models of other brands. NGE Automation Online Network
2) Streamlining instructions greatly improves execution efficiency. The PIC series 8-bit CMOS microcontroller has a unique RISC structure, a Harvard bus structure with separate data bus and instruction bus, which makes the instructions have a single word length and allows the number of bits of the instruction code to be more than the number of bits of the data. Compared with the traditional 8-bit microcontroller with CISC structure, it can achieve 2:1 code compression and increase the speed by 4 times. NGE Automation Online Network
3) Zero time to market. Using PIC's low-cost OTP chip allows the microcontroller to launch the product immediately after its application program is developed. NGE Automation Online
4) PIC has a superior development environment. The real-time performance of the OTP microcontroller development system is an important indicator. For example, most of the development systems of ordinary 51 microcontrollers use high-end models to simulate low-end models, and their real-time performance is not ideal. PIC launches the corresponding simulation chip at the same time as launching a new model. All development systems are supported by dedicated simulation chips, and the real-time performance is very good. In my personal experience, there has never been a situation where the simulation results are different from the actual operation results. NGE Automation Online Network
5) Its pins have the ability to prevent transients and can be connected to a 220V AC power supply through a current limiting resistor. It can be directly connected to the relay control circuit without the need for photoelectric coupler isolation, which brings great convenience to the application. NGE Automation Online
6) Complete confidentiality. PIC uses a confidential fuse to protect the code. After the user burns the code, the fuse is blown and others can no longer read it unless the fuse is restored. At present, PIC uses a deep-buried fuse process, and the possibility of restoring the fuse is extremely small. NGE Automation Online Network
7) Built-in watchdog timer can be used to improve the reliability of program operation. NGE Automation Online
8) Sleep and low power mode. Although PIC cannot compare with the new TI-MSP430 in this aspect, it can still meet the needs in most applications. NGE Automation Online
2. Assembly language and disassembly language
Here I would like to explain assembly language in plain language. In fact, we can simply divide language into two categories: high-level language and machine language. The difference is that machines cannot recognize high-level language, and humans find it difficult to understand machine language. In order to make it easier for humans to program, we have the traditional compilation process, which is the process from high-level language to machine language.
For example, the compilation process of C language: C->assembly language->machine language
The corresponding formats are: .c->.asm->.hex
Previous article:PIC16F1823 Development Notes (I) Preparation and Development Environment, Recommended Materials
Next article:PIC16F883 and TLC5615 (DA) digital-to-analog conversion experiment, breathing light
Recommended ReadingLatest update time:2024-11-15 14:33
- 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
- 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
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- KiCad Simplified Chinese Manual
- Automotive electronics technology - hardware, software, system integration and project management
- When the pull-up and pull-down resistors are not turned on, it is in floating mode. What is the principle that may cause high power consumption?
- Power switch design that meets USB specifications
- What is the function of the cross connection of the five tubes in the middle of this comparator?
- Battery Management Chip BQ28Z610 Problem Collection
- From simulation to realization
- 【DFRobot motor driver】+ unboxing and testing
- EEWORLD University ---- Analog Electronic Circuits
- 【GD32450I-EVAL】+ 07 Camera full screen display test