Surrounding environment:
System environment: Win7 64 position
Software platform: Multisim 12.0
Objective:
Just graduated, but the mode of knowledge also forgot almost the same, coupled with their own want to engage in hardware design. Let's say it's just a reading book. Do not practice, or eventually feel shallow. As an interest to learn the mode of electrical, simulation simulation.
Multisim MCU less, take 51来 practice practiced hand. Build 51 single-chip computer simulation system, with the knowledge of recording books.
Overview:
Finally, the smallest system built with Multisim 12.0 is seen in Figure 1-1, and the LED1 cycle can be flashed by means of a coding code.
Figure 1-1
Normally speaking. 51 single-chip microcomputer minimum system generally contains single-chip microcomputer, crystal oscillator circuit, reset circuit, I did not join the reset circuit, because it is just the Hello world of the die, first familiar with the simulation process.
Steps:
1, set up a directory Mcudemo. Store the project that you created. My path here is F:\Multisim\MCUDemo
Figure 1-2
2. Open Multisim 12.0 Software
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbxlizwxpzwyzmje=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">
Figure 1-3
The first interface of the software is figure 1-4. You can see the default creation of a multisimproject named Design1 in the project bar on the left.
Figure 1-4
3. Select File/save as or Ctrl+s to save the new project. and change the name to Mcu51demo. stored in the 1th step created by the directory, 1-5 see, select the "Save" button
Figure 1-5
After saving, the software interface such as the following
Figure 1-6
4. Place single chip microcomputer. Select the place/component of the menu bar, pop up the "Select a Component" dialog box, select Group as "MCU", Family "805x" and Component "8051". 1-7 of what you see
Figure 1-7
5, in the Figure 1-7 dialog box, after selecting the device, click on the upper right corner of the "OK" button, the selected 8051 devices can be placed in the schematic. When placed (also click the left mouse button). The MCU wizard is created. 1-8 of what you see
Figure 1-8
6, in Figure 1-8 is seen in the. Select the path where the workspace is stored, the directory F:\Multisim\MCUDemo\ created for the 1th step, the workspace name is MCU51, for example, 1-9
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbxlizwxpzwyzmje=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">
Figure 1-9
After setting up, select Next
7. This step is to set the MCU's project type and compile language, name, project type has standard and External Hex File. The former is the standard type (in fact I do not use the latter), the latter is the import external hex file. In this experiment, I chose "standard"; programming language programming language Select "C". The C language is used, and the compiler Tool Assembler/compiler toolbar selects default; project name is set to "Mcu51debug". Suddenly I felt a lot of names.
Set it up after 1-10 to see
Figure 1-10
After setting up, select "Next"
8. Next, set whether to create an empty project. Here by default, add directly to a MAIN.C file, 1-11 see
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbxlizwxpzwyzmje=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">
Figure 1-11
Select "Finish"
9, at this time MULTISIM project structure 1-11 see
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbxlizwxpzwyzmje=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">
Figure 1-11
10, the next step is to build the minimum system. First, the crystal oscillator is built, the crystal oscillator is added first, the menu bar Place-->component is selected, and the group of Crystal oscillator belongs to Misc in Multisim. Family for crystal,1-12 to see, select Crystal "Hc-49/u_11mhz", I did not find 12M.
Figure 1-12
Click OK in the upper-right corner. Place it in the right place and place it right after. I right-rotated a bit, placed after the 1-13
Figure 1-13
11, and then placed 2 30pf of capacitance, the same place-->component, the capacitor group of basic,family for capacitor, for example, 1-14 see
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbxlizwxpzwyzmje=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">
Figure 1-14
Click "OK", place in the right place, follow the same method and place a 30pF capacitor, 1-15 see
Figure 1-15
12, and then place the ground DGND, the same place-->component,1-16 see
Figure 1-16
Post-placement effect 1-17
Figure 1-17
To this. Crystal oscillator circuit is set up, and now can be used to connect this part with wire, along with the single-chip computer connected to the ground, connected after 1-18 saw
Figure 1-18
13, place the power supply VCC. Placement step no longer verbose, 1-19
Figure 1-19
Place and Connect, 1-20
Figure 1-20,
In fact, the 51 single-chip microcomputer's most minimal system has been set up, note that 31 feet are also connected with VCC, which is due to 31 feet (EA/VPP), when the high-power, the microcontroller after the reset from the internal
Rom 0000H starts running, and when it is low, it is reset directly from the 0000H of the external ROM to start. This is just the beginning of learning people easy to ignore.
Although the minimum system has been set up, but also can not be simulated to see what effect. An LED light is added here to show the simulation results.
14, the same join a led,1-21. Device dialog box. A red LED is selected here.
Figure 1-21
Placed in the appropriate position of the circuit diagram, 1-22
Figure 1-22
15, at this time the LED can not be directly connected, need to add a resistor. Protection diode LED, add a 1K resistor, 1-23
Figure 1-23
Place and Connect, 1-24
Figure 1-24
My LED lamp and the single-chip computer connection PIN is P2.0, PIN can be connected casually.
Next is ctrl+s save it, and then write 51 programs
16. Double-click the main.c you see in Figure 1-25
Figure 1-25
At this point the contents of Main.c 1-26 are seen
Figure 1-26
17, write the code, after the completion of the MAIN.C content such as 1-27
Figure 1-27
Note that the 51 files in Multisim are 8051.h, not reg51.h.
18, save the file, and then select the toolbar Mcu-->mcu 8051 u1-->build, compile the program. 1-28 of what you see
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbxlizwxpzwyzmje=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">
Figure 1-28
The results of the compilation are for example with 1-29.
At this time 0 Errors 0 Warnings
Figure 1-29
19, back to the schematic interface, click on the 1-30 Red line from the Start button.
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbxlizwxpzwyzmje=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">
Figure 1-30
20, at this time, according to common sense, LED1 should keep flashing, but I do not blink.
This is related to the operating current of the LED, the following changes, first stop simulation. That is, the menu bar simulator-->stop. Then double-click LED1 to pop Up the LED1 Properties dialog box, for example, with 1-31
Figure 1-31
The on value of "5" is lower. This is changed to "2", as seen in 1-32
Figure 1-32
Click OK. Then Ctrl+s save, and then click on "Start Emulation" button or Simulator-->start, pop-up such as the following dialog box
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbxlizwxpzwyzmje=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">
Click "Yes". You can see LED1 flashing at this time
watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvbxlizwxpzwyzmje=/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast ">
Figure 1-33 led off 1-34 LED light
Conclusion:
Here, the example of using the Multisim Emulation 51 single-chip computer to light the LED light is almost the same. Some of the details in the middle are going to be written again. But it's time to do some exercise.
Do not like to spray, purely personal notes only. Feel as if back to junior high school to write a blog, ... ╮(╯▽╰)╭ He come to Shanghai is not easy what
Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.
< analog e-Learning 1> MULTISIM 12.0 Structure and simulation 51 smallest single-chip system