Tutorials to .com

Tutorials to .com » Mechine » Mcu » A simple microcontroller suitable for classroom teaching experiment DEVELOPER

A simple microcontroller suitable for classroom teaching experiment DEVELOPER

Print View , by: iSee ,Total views: 26 ,Word Count: 1944 ,Date: Tue, 25 Aug 2009 Time: 10:04 AM

Microcomputer application system program is the backbone of the professional classes of Electricity, one of its operational very strong, for college students, classroom instruction alone is not adequate, except in the classroom requires students to master basic concepts, understanding of mcu extension interface circuit design method and the process of programming, the only through extra-curricular a lot of practice to master the MCU application system design steps, learn to develop microcontroller applications, the basic method.

Based on the AT89S52 microcontroller with in-system programming capabilities, integrating a set of low-cost, easily drawn, making quick, easy to operate experimental microcontroller development system. The system is very suitable for the classroom or outside the classroom to use.

Hardware Circuit

Hardware circuit is divided into the smallest microcontroller system and downloader two parts.

Minimum System Principle: there is no minimum system peripheral devices and expansion peripheral interface microcontroller system. It is the MCU application system design basis, including the minimum system architecture options, reset the clock system design and system design. Under normal circumstances, three types of MCU Minimum System Sub-Structure: ① Bus-Bus applications, minimum system structure, the structure consists of bus-based MCU, reset circuit, clock circuit, I / O port and the parallel expansion of the total lines. ② bus-type non-bus applications, the minimum system structure, only the microcontroller reset circuit consisting of simple circuits, parallel bus is not used for external expansion, the application system can be used as I / O port to use. ③ the smallest non-bus-based microcontroller system architecture.

The minimum system introduced here belong to the first ② kinds, from MCU AT89S52 and ISP programming interface composition, its principles shown in Figure 1. Figure P0 ~ P3 mouth and CN104 left when the experiment or practical training as I / O port or connection with the expansion of the circuit. CON101 is to download or read the chip when the internal procedures used by ISP programming interface, operation, you need to remove the jumper J101. (ISP that is, English In-System Programmable, intended for in-system programming.)

A simple microcontroller suitable for classroom teaching experiment DEVELOPER

Downloader: Download is controlled by interface board and connecting cable. Interface board schematic diagram shown in Figure 2 (a). Figure 8 in U201 is a 74HC244 buffer circuits for the computer parallel port and single-chip buffer isolation. The connector CN202 is a common DB25 pin-shaped plug, with the host computer connected to communicate; of these 4,5-pin control U201 chip, in its normal low level that allow data transmission, high when the output was high-impedance state 74HC244; 6 pin output data to the microcontroller; 7 feet is the clock signal; 9-pin is an output reset signal; 10 feet is required to receive from the microcontroller to read out data. The connector CN201 is a standard 10-pin IDC socket, its various functions shown in Figure 2 (b).

A simple microcontroller suitable for classroom teaching experiment DEVELOPER

A simple microcontroller suitable for classroom teaching experiment DEVELOPER

Download a 10-pin flat cable cables, two embossed with IDC plug. Download a termination device, the other end of the ISP port Minimum System board.

software Operation

In this experiment development system, software and procedures used in keil c download software SLISP. Interested readers can use proteus simulation software. As the application circuit and procedures in the simulation environment and real environment to run, and in some cases, there are some differences, so here are not recommended (2 software can be used to the appropriate Web site to download and install).

keil C++ basic operations: Install keil c software, computer icon on the desktop will be displayed. Double-click the icon with the left mouse button are allowed to enter the work keil c interface, as shown in Figure 3. The interface with the Word interface is similar to above is a menu bar, followed by quick button on fences. Used here, some of the menu and the shortcut button on the meaning of the Chinese have been marked in Figure 3 on; use only function is to create a project or open an existing project, create or open a source text and so on, finally compile it into a need for hex file.

Its steps are as follows:

* New project or open an existing project

* A new file or open an existing file

* The destination file option set

* The establishment of the destination file, to obtain. HEX file

Program to read and download: You have installed a computer Ssangyong electronic download software in their desktop has icons. The same with the left mouse button double-click the icon can be downloaded into the MCU's work program interface, as shown in Figure 4. The interface is in Chinese, and more clear.

A simple microcontroller suitable for classroom teaching experiment DEVELOPER

First use of "communications device parameter settings, and select" set as shown in the figure, that is, communication port set to parallel communication port "LPT1", rates set "TURBO" speed up, the device select "AT89S52".

Pulling minimum system board jumpers J101, J102, J103, plug in the AT89S52 chip; will download the line interface board into the computer's parallel port, and with the connecting cable to the minimum system and interface board with a good, and then pick the smallest system on the +9 V power supply. Note that "+" and "-" can not be wrong. Open the power of the minimum system power supply, you can read and write chip-based program.

If an error in the download process and will be the following. In the text box when prompted. Then be rewritten to find the reasons, you need to chip should first wipe to get rid of the original message, and then write.

If the original program has been modified, then to re-compile, or point of rebuilding the destination file "Rebuild alI target files" button to generate a new. HEX file; downloads would also like to re-load the same file name just generate a new . HEX file. So as to ensure that this download is a modified procedure.

The completion of the above operations, close the +9 V power supply, unplug the connecting cable, plug in the jumper J101, connected to the extension interface circuit, you can check the operation of programs to carry out experiments or developed.

Training case of

Control relay with two buttons together and release the suction.

The basic requirements: Click on the switch S1, relay pull-J; click of a button S2, relay J release. If S2 is not closed, then even if S1, relay J will not pull-in.

Circuit implementation: Using MCU 89S52 of P3.6 and P3.7 port P1.7 to control the state, so that the relay pull-in or release; when P3.6 to P1.7 are also low, low, Relay Pick-up; when the P3.7 to P1.7 are high when the high, the relay releases. The principle shown in Figure 5, the circuit board structures can be made universal.

A simple microcontroller suitable for classroom teaching experiment DEVELOPER

Programming ideas: First, take P3.7, determine whether it is "1." Yes, the P1.7 set "1", return; not a "1", then it P3.6. Take P3.6, determine whether it is "0." Yes, the P1.7 set "0"; not a "0" is returned. The process shown in Figure 6.

A simple microcontroller suitable for classroom teaching experiment DEVELOPER

Programming: According to the flow chart is not difficult to compile programs. Procedures available "Notepad" or "KEIL C" in the entry, and use the file name "rlcontrol.asm" to save. The specific meaning of Directive See the books.

A simple microcontroller suitable for classroom teaching experiment DEVELOPER

Program debugging: specific steps are as follows:

① with "Notepad" or "KEIL C" in the entry or programming, and use a file name, such as "rlcontrol.asm" preservation;

② Open the "KEIL C" software to create a new project. Project name may also wish to "rlcontrol";

③ Open the file has been established "rlcontrol.asm", and that the file is added to the "Source Group 1" in;

④ In the "Options for Target'Target 1 '" in the "Output" tab on the settings;

⑤ point compile and build the target file, to be "rlcontrol.hex" documents;

⑥ pulling minimum system board jumpers J101, J102, J103, plug in the AT89S52 chip, will download the line interface board into the computer's parallel port on the connecting cable to the minimum system and interface board with a good, and then the smallest system connected to the +9 V power supply;

⑦ open download software and set up the parameters, load the file to be written "rlcontrol.hex", point "program" button to download the program (if necessary, should first of the chips to "erase");

⑧ completion of the above operations, close the +9 V power supply, unplug the connecting cable, plug in the jumper J101, connected to the extension interface circuit;

⑨ supply verification process, the two buttons whether the action meets the requirements, does not meet the requirements will be modified;

⑩ Repeat the above steps until you achieve the required functionality.


Micro Controller Unit Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.