Internal and external structure of single chip microcomputer

Publisher:chinapxfLatest update time:2013-01-09 Source: 21IC Keywords:MCU  Programmer Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

External structure of single chip microcomputer

If you want to use a chip, you must first know how to connect it. We use a chip called 89C51. Let's take a look at how to connect it. 1. Power supply: This is of course essential. The microcontroller uses a 5V power supply, of which the positive pole is connected to pin 40 and the negative pole (ground) is connected to pin 20. 2. Oscillator circuit: The microcontroller is a timing circuit that must provide a pulse signal to work properly. The oscillator has been integrated inside the microcontroller. A crystal oscillator is used, connected to pins 18 and 19. Just buy a crystal oscillator and a capacitor and connect them. Just connect them according to Figure 1. 3. Reset pin: Connect according to the method in Figure 1. As for what reset means and why it is necessary to reset, it is introduced in the microcontroller function. 4. EA pin: The EA pin is connected to the positive power supply terminal. At this point, a microcontroller is connected, and the microcontroller starts working after power is turned on.

Our first task is to use the microcontroller to light up a light-emitting diode (LED). Obviously, this LED must be connected to a pin of the microcontroller, otherwise the microcontroller cannot control it. So which pin should it be connected to? In addition to the 5 pins just used, there are 35 pins on the microcontroller. We connect this LED to pin 1. (See Figure 1, where R1 is the current limiting resistor)

According to the connection method in this diagram, when pin 1 is at a high level, the LED will not light up, and only when pin 1 is at a low level, the LED will light up. Therefore, we need to be able to control pin 1, that is, we need to be able to make pin 1 change to a high or low level as required. Since we want to control pin 1, we have to give it a name. We can't just call it pin 1, right? What should we call it? INTEL, the company that designed the 51 chip, has already named it P1.0. This is a rule and cannot be changed by us.

Internal and external structure of single chip microcomputer
Figure 1

Now that we have a name, how do we make it go "high" or "low"? To tell someone to do something, we just need to say it, which is called issuing a command. To tell a computer to do something, we also need to send a command to the computer. The command that the computer can understand is called a computer instruction. The instruction to make a pin output a high level is SETB, and the instruction to make a pin output a low level is CLR. Therefore, if we want P1.0 to output a high level, we just need to write SETB P1.0, and if we want P1.0 to output a low level, we just need to write CLR P1.0. [page]

Now we have a way to let the computer output P10 high or low, but how can we make the computer execute this instruction? We can't just tell the computer and leave it at that. To solve this problem, there are still several steps to go. First, the computer can't understand instructions such as SETB CLR. We have to translate the instructions into a way that the computer can understand, and then let the computer read it. What can the computer understand? It only understands one thing - numbers. Therefore, we have to change SETB P1.0 to (D2H, 90H) and CLR P1.0 to (C2H, 90H). As for why these two numbers are used, this is also stipulated by the designer of the 51 chip - INTEL, and we will not study it. The second step is, after obtaining these two numbers, how to let these two numbers enter the internal of the microcontroller? This requires the help of a hardware tool "programmer".

We connect the programmer to the computer, run the programmer software, and then write (D2H, 90H) in the editing area (see Figure 2). Write... OK, take the chip, insert the chip into the finished circuit board, and turn on the power... What? The light is not on? That's right, because the command we wrote in is to make

14.jpg
Figure 2

P10 outputs a high level, so of course the light won't light up. If it does, it's wrong. Now we unplug this chip, put it back on the programmer, change the content in the editing area to (C2H, 90H), which is CLR P1.0, write the chip, take it off, insert it into the circuit board, connect the power, and the light will light up. Because the () we wrote is the instruction to make P10 output a low level. In this way, we can see that the connection of the hardware circuit has not been changed. As long as the content written into the microcontroller is changed, the output effect of the circuit can be changed.

Analysis of the Internal Structure of a Single Chip Microcomputer

Let's think about a question. When we write an instruction into the microcontroller in the programmer, and then remove the microcontroller, the microcontroller can execute the instruction. Then the instruction must be saved somewhere in the microcontroller, and this place can still keep the instruction from being lost after the microcontroller loses power. What is this place? This place is the read-only memory inside the microcontroller, namely ROM (READ ONLY MEMORY). Why is it called read-only memory? Didn't we just write two numbers in it? It turns out that the ROM in 89C51 is an electrically erasable ROM, called FLASH ROM. We just used a programmer to write to the ROM under special conditions by an external device. Under normal working conditions of the microcontroller, it can only be read from that side, and data cannot be written in, so we still call it ROM.

Keywords:MCU  Programmer Reference address:Internal and external structure of single chip microcomputer

Previous article:Features of MSP430 MCU
Next article:Microcontroller Overview - What is a Microcontroller

Recommended ReadingLatest update time:2024-11-16 20:33

ATmega8 MCU Control and Status Register - MCUCSR
The MCU Control and Status Register provides information about the reset source that caused the MCU to reset. • Bit 7..4 – Res: Reserved These bits are reserved and are always read as “0”. • Bit 3 – WDRF: Watchdog Reset Flag This bit is set when a watchdog reset occurs. It is cleared by a power-on reset and can be c
[Microcontroller]
ATmega8 MCU Control and Status Register - MCUCSR
Mass production released! National Technology's first automotive-grade MCU N32A455 is launched
On February 20, 2023, National Technology officially launched the N32A455 series automotive-grade MCU in Shenzhen, which has the advantages of versatility, hardware security and automotive-grade high reliability, and announced mass production. This is the first mainstream automotive-grade MCU product released by Nat
[Automotive Electronics]
Mass production released! National Technology's first automotive-grade MCU N32A455 is launched
51 single chip microcomputer digital tube display digital clock
This is a digital clock program based on 51 single chip microcomputer, which uses digital tube to display data. Schematic source code and simulation file download address: http://www.51hei.com/bbs/dpj-20407-1.html The following is the source code: #include AT89X51.H   unsigned char code dispcode ={0x3f,0x
[Microcontroller]
51 single chip microcomputer digital tube display digital clock
Multi-cycle Fully Synchronous Frequency Measurement Technology Based on Single Chip Microcomputer
Frequency measurement is a common problem in electronic measurement. How to improve the accuracy of frequency measurement is the key. Commonly used methods include low-frequency end measurement, high-frequency end measurement, and multi-cycle synchronous frequency measurement. When using low-frequency end measurement,
[Microcontroller]
Multi-cycle Fully Synchronous Frequency Measurement Technology Based on Single Chip Microcomputer
31-Design of digital multimeter based on 51 single chip microcomputer
Specific implementation functions The system is composed of AT89S52 single chip microcomputer + AT24C02 data storage module + key module + LCD1602 display + alarm module etc. Specific functions: The multimeter can switch to measure voltage, current and resistance values, and display them in four digits. It will alar
[Microcontroller]
31-Design of digital multimeter based on 51 single chip microcomputer
Single chip computer two machine communication (C51 program)
/* Send program Connection: Two MCUs are connected with 3 wires, they should share the same ground, rxd and txd should be cross-connected Program effect: Send through the host, receive from the slave In the host, the number of times the button is pressed is recorded, and the host displays the last
[Microcontroller]
Application of single chip microcomputer in spectrometer control and detection system
introduction This article introduces the use of a single-chip microcomputer to control the operation of a spectrometer and detect the output signal light of the spectrometer. The spectrometer uses a stepper motor to drive the grating to rotate, thereby achieving the measurement of the full-band signal light. As long a
[Microcontroller]
Application of single chip microcomputer in spectrometer control and detection system
51 MCU interrupt response and cancellation
Interrupt Response Interrupt response is the acceptance of the interrupt request from the interrupt source by the single-chip CPU. After the interrupt request is responded, it goes through a series of operations and then turns to the interrupt service routine to complete the processing task required by the interrupt
[Microcontroller]
51 MCU interrupt response and cancellation
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号