Microcontroller simulation and PCB design based on Proteus software

Publisher:SereneNature7Latest update time:2014-01-21 Source: dzsc Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  1. Introduction

  A single-chip microcomputer is a single-board microcomputer that is composed of a CPU chip, a memory chip, an I/O interface chip, and a simple I/O device assembled on a printed circuit board, and then equipped with a monitoring program stored in ROM. Traditional single-chip microcomputer development uses hardware experiment boxes or experiment boards, and the hardware investment cost is relatively high; this stereotyped environment can easily confine the developer's thinking in a small experiment box, which is not conducive to the realization of innovative thinking, and will also cause cognitive misunderstandings for beginners, that is, the so-called single-chip microcomputer is just a needle thread in a box, which is extremely unfavorable for subsequent development.

  At present, there are many softwares with circuit simulation functions, and the ones with better performance include Multisim, Protel, O r CAD, etc., but these are powerless to simulate single-chip microcomputers. So far, only Proteus software can provide complete simulation of single-chip microcomputer chips and embedded systems.

  2. Experimental configuration required for MCU simulation

  2.1 Select Proteus software as the microcontroller simulation software

  Proteus software is an EDA tool software developed by Lab Center Electronics in the UK. It is not only a design platform for analog circuits, digital circuits, and analog/digital mixed circuits, but also the most advanced and complete design and simulation platform for various types of microprocessor systems in the world. It truly realizes the complete electronic design and development process of completing schematic design, circuit analysis and simulation, microprocessor program design and simulation, system testing and functional verification, and PCB formation on the computer.

  Proteus software consists of two softwares, ISIS and ARES. ISIS is an intelligent schematic input system software that can be used as an electronic system simulation platform, and ARES is an advanced wiring editing software for designing PCB.

  2.2 Use Keil uVision2 software to compile and debug the program

  The MCU chip in the Proteus simulation, like the MCU chip in the MCU hardware test bench, needs to download the compiled machine language file, which requires the compiler of assembly language and C language. KeiluVision2 is a 51 series compatible MCU C language software development system, which uses syntax close to traditional C language for development. It can also embed assembly, which you can embed in key positions. At the same time, it has strong portability, making the program reach the working efficiency close to assembly. In addition, Keil uVision2 software also supports MCU chips from many different companies, integrating editing, compiling and program debugging, and then downloads the generated HEX file to the MCU chip, which completes the solidification of the program.

  3. Simulation and PCB production of water flow lamp containing AT80C51 chip based on Proteus software

  3.1 Experimental process of Proteus microcontroller simulation and PCB production (as shown in Figure 1)

  

  3.2 Use ISIS software to draw the schematic diagram containing the AT80C51 microcontroller chip

  1) Open ISIS Professional software, execute "File" → "New Design", select the default template "DEFAULT" in the pop-up window, click "OK", and then save it and name it "liushuideng.DSN".

  2) "System" → "Set Sheet Sizes...", the "Sheet Size Configuration" dialog box pops up, set the drawing to A4, and click "OK".

  3) Add components.

  See Figure 3 for specific values. Execute the menu command "Library" → "Pick Device/Symbol..." in the toolbar, and a dialog box will pop up. Enter the required components in the "Keywords" column. The right column will display. At this time, just select the components you need, click "OK", and then select the components in the list (the components used are shown in Table 1 below), click the mouse in the appropriate position in the schematic editing window to complete the placement, and add all the components in the list in this way.

       

  4) Place the power supply and ground: click the icon in the toolbox on the left, click "POWER" in the object selector to make a blue bar appear, and then click the mouse at the appropriate position in the schematic editing window to place the "power supply" in the schematic; click "GROUND" and use the same method to place the "ground" in the schematic.

  5) Wiring: There is no dedicated wiring button in the ISIS schematic editing window, but the system defaults to automatic wiring, so you can draw lines directly. The wiring is shown in Figure 2.

  4.C language programming

  4.1 Create project files

  1) Open Keilu Visual 2 software, click "Project" → "New Project", name it "liushuideng", then save it. In the pop-up dialog box, select "Atmel" → "89C51" → "OK" in the "Data base" column; then click "File"

  →“New File”.

  2) Click "Save" → name the file "liushuideng.

  c” → “Save”. This program is written in C language and the suffix must be “.c”.

  3) Click "Target 1" → "Sour Group 1"

  → "Add Files to Group" Sour Group 1 "", select the newly created file in the pop-up dialog box, then click "Add", and click "Close" after adding. The project is now complete. [page]

  4.2 Use C language to write the source code of the water lamp program

  #include #include

  #define uint unsigned int

  #define uchar unsigned char

  uchar temp;void delay(uint);

  void main()

  {temp=0xfe;P0=temp;while(1)

  {temp=_crol_(temp,1); delay(600);

  P0=temp;} }

  void delay(uint z)

  { uintx , y ; for ( x = 1 0 0 ; x > 0 ; x - - )

  for (y=z;y>0;y-);}

  4.3 Debugging Programs

  After debugging this program, the status bar below displays "0Errors, 0 Warning", indicating "0" errors and "0" warnings.

  4.4 Generate .HEX target file

  Select "Target 1" and right-click → "Option for Target \'Target 1'". In the pop-up dialog box, click "Output" → "Create HEX File" and check it. Run the program again to generate the HEX target file.

  5. Schematic Simulation

  (1) In Proteus ISIS, double-click the AT89C51 microcontroller chip and click on the “Edit Component”

  In the "Program File" column of the dialog box, select "liushuideng.hex", and then click "OK".

  (2) Click the play button in the lower left corner of the Proteus ISIS editing window, or select "Execute" under the "Debug" menu. You can see that first P0.0 lights up the LED light, waits for one second and then turns it off. At the same time, P0.1 lights up another LED light, also waits for one second and then turns it off. P0.2 lights up the LED light. When P0.7 lights up the LED light and waits for one second and then turns it off, P0.0 lights up the LED light. This cycle repeats. The interval time can be set in the delay function. The running result is shown in Figure 2.

  

  When the dot on the left side of the LED light is blue, it means it is on, and when it is red, it means it is off.

  6.PCB production

  6.1 Counting the components used in the circuit schematic

  In ISIS, execute the menu command "Tools" → "Bill of Materials" → "2 ASCII Output" to generate a list of components, as shown in Figure 3:

  

  6.2 Importing the Network Table

  In ISIS, double-click the switch "K", and the "Edit Component" dialog box will pop up. Remove the "√" in front of "Exclude from PCB Layout" and click "OK"; execute the menu command "Tools" → "Netlist to ARES", and the system will automatically open the ARES software. In ISIS, some components do not have a specified package form, so the system will automatically pop up the "Package Selector" dialog box. Enter the corresponding package form in the "Package" column. The package form of the light-emitting diode is "LED", and the package form of the button "K" is "SW-PUSH1".

  6.3 Placing components

  After completing the component packaging, enter the ARES operation interface. First, click the icon in the main toolbox. This is the 2DGroaphics frame mode. In the drop-down box in the lower left corner, select the current board layer as "Board Edge" (yellow). Click and hold in the workspace to pull out a yellow frame. Set the size as needed. That is the PCB editing board layer. When there are not many components, in order to achieve the design effect you want, use the method of manually arranging components. Click the component mode icon in the main toolbox, select a component in the component list, and then click the left mouse button in the appropriate position in the editing area to place the component. If there are many components, the combination of automatic component arrangement and manual component arrangement can greatly improve the efficiency of board making. After the components are placed, "No DRC errors" is displayed in the lower right corner, and there are no design rule errors.

  6.4 Wiring

  ARES provides two methods: interactive manual routing and automatic routing. They are usually used in combination to improve efficiency and make the PCB have better electrical characteristics and more beautiful appearance. Execute the menu command "Tools" → "Auto Router", and the "Shape Based Auto Router" dialog box pops up. Set the parameters as needed, then click "OK" to start automatic routing, and then make manual adjustments. The result is shown in Figure 4:

  

  6.5 Rule Check

  CRC check: Click "Tools" → "Connectivity Checker", the system will perform a connectivity check, and the status box below will prompt "0 CRC violations found", indicating no CRC errors and no DRC errors.

  6.6 Copper Plating

  1) Top copper: Click "Tools" → "PowerPlane Generator", the "Power Plane Generator" dialog box pops up, in this dialog box, select "GND=POWRE" in the "Net" column, "Layer"

  Select "Top Copper" in the "Boundary" column and "T10" in the "Boundary" column. After setting, click "OK" to apply the top copper layer.

  2) Bottom copper plating: Just select "Bottom Copper" in the "Layer" column, and the other operations are the same as the top copper plating.

  6.7 3D Effect Display

  Click “Output” → “3D Visualization” to display the 3D effect as shown in Figure 5. Different 3D effects can be displayed through the drop-down menu of “View”.

  

  6.8 Outputting photolithography files

  Click "Output" → "IDF ManufacturingOutput", set the parameters according to the PCB production requirements, and click "Generate" to generate the corresponding photolithography file. Send the exported photolithography file and the corresponding drilling file to the PCB manufacturer for board making. You can also buy the raw materials yourself and make a PCB board of a water lamp, which can deepen your understanding of the development process and working principle of the single-chip microcomputer.

  7. Conclusion

  This paper uses Proteus software as the simulation tool and Keil uVision2 software as the program editor. It discusses the simulation of the microcontroller and the process of making PCB in a relatively complete way. At the same time, the production of the water lamp is also a typical example of the entry of the microcontroller; this will allow the majority of microcontroller beginners to have a general understanding of its development process. Using Proteus software to conduct microcontroller simulation experiments not only reduces the loss of raw materials, but also makes up for the shortcomings caused by the lack of experimental instruments and components. Through simulation experiments, beginners can understand the development methods of the microcontroller system, which is very helpful to cultivate their comprehensive analysis ability, troubleshooting ability, development and innovation ability.

Reference address:Microcontroller simulation and PCB design based on Proteus software

Previous article:Design of intelligent temperature early warning system based on single chip microcomputer
Next article:8051 MCU Timer Overflow Interrupt Error Compensation Example

Latest Microcontroller Articles
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号