I. Single-chip microcomputer three major resources 1.flash--program storage space
- Equivalent to the computer's hard disk, you can achieve power loss after the data is not lost.
2.ram--Data storage space
- Equivalent to the memory of the computer, used to store the data generated and required during the operation of the program, data loss after power outage, the advantage is fast reading speed, can be written indefinitely.
3.sfr--Special Function Register
- MCU each function corresponds to a plurality of SFR, the user through the SFR read and write to realize the function of single-chip microcomputer.
Two. Microcontroller minimum system 1. Power supply
- The mainstream MCU uses 5V and 3.3V voltage, the power supply circuit 40 pin to the V, usually also become VCC or VDD, representing the power positive, 20 pin to GND, representing the power of the negative, but also the meaning of grounding.
2. Crystal Oscillator
- Crystal oscillator, the role of a single-chip system to provide a reference clock signal, has been constantly oscillating, followed by a capacitor, the role is to help the crystal oscillation, maintain the stability of the oscillation signal.
3. Reset Circuit
- On the single-chip 9-pin RST reset PIN, the reset is generally divided into: power-on reset, manual reset and program automatic reset. When the program is running and the crash can be interrupted by pressing the Reset key to allow the program to re-initialize the operation.
Three. Binary conversion
decimal |
| Binary
hexadecimal |
0 |
0b0 |
0x00 |
1 |
0b1 |
0x01 |
2 |
0b10 |
0x02 |
3 |
0b11 |
0x03 |
4 |
0b100 |
0x04 |
... |
... |
... |
9 |
0b1001 |
0x09 |
10 |
0b1010 |
0x0A |
11 |
0b1011 |
0x0B |
... |
... |
... |
15 |
0b1111 |
0x0F |
16 |
Xb10000 |
0x10 |
17 |
0b10001 |
0x11 |
... |
... |
... |
For binary, 8-bit binary is a byte, write to prefix 0b, can only be 0 or 1, the expression range is 0b00000000~0b11111111.
Hexadecimal ranges are write-only decimal and hexadecimal in the 0X00~0XFF.C language. Binary 4-bit a group follows the law of 8/4/2/1, such as 0b1010, starting from the highest bit, the number size is 8*1+4*0+2*1+1*0=10, then the binary is 10, hexadecimal is 0x0a.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
51 Single chip Microcomputer learning note "0"--basic knowledge