当前位置:网站首页>Single chip microcomputer (STC series 8051 core single chip microcomputer)

Single chip microcomputer (STC series 8051 core single chip microcomputer)

2022-06-23 02:00:00 A new doggerel imitating ancient times

1. Number system

  • To better describe and remember the address of the microcomputer , The code is generally hexadecimal .
  • Original code , Inverse and complement
    The inverse code and complement of positive numbers are the same as the original code , The inverse of a negative number is : Keep the original code symbol bit unchanged , The digits of the value are reversed ; The complement of a negative number is : Take the reverse and add one .
    All signed numbers in a computer are represented by complements ( Positive numbers have the same form , It can be thought that the original code is used to express ), The result of the operation is also a complement .

2. Microcomputer principle

  • Von Neumann structure : A computer consists of an arithmetic unit , controller . Memory , Input devices and output devices are made up of .
  • Microcomputer structure : A single chip microcomputer consists of a microprocessor (CPU), Memory , I / O interface (I/O Interface ) And the bus ( Address bus , Data bus and control bus ) form ; In addition, the input and output equipment is the system machine ( Such as PC machine ).
  • programing language
    machine language .
    assembly language : Use English mnemonics to describe instructions ; Need to compile .
    High-level language : Natural language description ; Need to compile .
  • Microcomputer working process
    Fingering , Instruction decoding , Execution instruction .

3. Single chip microcomputer instruction system

  • Assembly language instruction format
    label opcode Operands .
  • Addressing mode
    How to find operands when executing instructions .
  • Transmitted by data ( Instructions ), Arithmetic operation , Logical operations , Shift operation , Bit operation and control transfer constitute .

4. C51 Application framework

  • Pretreatment part
    ( Such as include “stc15.h”# Contains the SCM header file ,include “GPIO.h”# Contains initialization I/O Port header file )
  • Global variable definitions and function declarations
  • The main function
  • Subfunctions and interrupt service functions

5. Important functions of single chip microcomputer / form

  • Memory :RAM,ROM
  • timing / Counter
  • Interrupt the system .
    Task scheduling / Resource sharing / human-computer interaction .
    send CPU It has the ability to deal with external emergencies in real time .
    Interrupt the process : Interrupt request , Interrupt response , Interruption of service , Interrupt return .
  • Serial port .
    asynchronous / Sync ; Simplex / Half duplex / full duplex .
  • A/D Conversion module .
    principle : Step by step .
  • PWM( Pulse width modulation )
    Use the duty ratio of square wave to encode the level of analog signal ,PWM The signal is digital , But as long as the bandwidth is enough , Any analog value can be used PWM Encoding , Can be realized D/A transformation .
    High resolution counter implementation PWM.
  • human-computer interaction
    LED Digital display : Static display , Dynamic scanning display ( Each has its own string / Parallel display mode ).
    LCD Liquid crystal display (LCD) : Digital display pen segment , dot character , Lattice graphics .
  • keyboard
    Independent buttons .
    Matrix keyboard : Scanning ( Query scan , Time scan , Interrupt scan ) And line reversal method .
  • watchdog
    Reliability design , If cpu Fail to visit the watchdog as required within the specified time , The watchdog will force a reset cpu.
原网站

版权声明
本文为[A new doggerel imitating ancient times]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202220505245634.html