文献翻译.pdf_第1页
文献翻译.pdf_第2页
文献翻译.pdf_第3页
文献翻译.pdf_第4页
文献翻译.pdf_第5页
已阅读5页,还剩3页未读 继续免费阅读

文献翻译.pdf.pdf 免费下载

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

An AT89S52 Microcontroller-Based Single Board Computer for Teaching an Instrumentation System Course KHAIRURRIJAL, MUHAMMAD M. MUNIR, ASEP SUHENDI, HENDRAYANA THAHA, MAMAN BUDIMAN Department of Physics, Institut Teknologi Bandung, Jalan Ganesa 10, Bandung 40132, Indonesia Received 25 July 2005; accepted 2 August 2006 ABSTRACT:A single board computer (SBC) based on the AT89S52 (a member of MCS-51 family) microcontroller with an ADC, serial and parallel communications, and input/output devices such as a pushbutton, a keypad, LEDs, 7-segment displays, and an LCD was developed for teaching an instrumentation system course to the sophomore students. Five micro- controller-related laboratory experiments offered to the students within the 15-week semester are (i) basic programming of the microcontroller, (ii) interfacing the DIP switches, LEDs, and 7-segment displays, (iii) application of the analog multiplexer and the ADC with the LCD, (iv) serial communication and application of the HyperTerminal, and (v) measurement of water temperature, displaying the measurement result, and application of the LabView.?2007 Wiley Periodicals, Inc. Comput Appl Eng Educ 15: 166?173, 2007; Published online in Wiley InterScience (); DOI 10.1002/cae.20107 Keywords:single board computer (SBC); AT89S52; MCS-51 microcontroller; instrumentation system; HyperTerminal; LabView Correspondence to Khairurrijal (krijalfi.itb.ac.id). ?2007 Wiley Periodicals Inc. 166 INTRODUCTION Microcontrollercourseshavetraditionallybeen taught within electrical engineering departments 1. Mechanicalengineeringdepartmentshavealso recognized the important role of the microcontroller in mechatronic systems 2. Few departments that are neither electrical nor mechanical engineering which offer microcontroller courses in their curricula. The Department of Biological and Agricultural Engineering at the University of Georgia, USA, hasintroductoryandadvancedmicrocontroller courses since biological and agricultural engineers face processes becoming increasingly complex with microcontrollers embedded in them 3. An experi- ment using a microcontroller has been tried in the teaching of process control to chemical engineering students at the University of Minnesota Duluth, USA 4 and to students in the Department of Applied Physics, Electronics, and Systems at the University of La Laguna, Spain 5. Many physical quantities such as temperature, pressure, length, mass, time, current, and intensity must be measured. Most modern instruments used in measuring the quantities include microcontrollers. Therefore, the development of expertise in micro- controllers is also important to physicists. In this article, we describe an AT89S52 micro- controller-based single board computer (SBC) that is used for teaching the instrumentation system course to sophomore students in the Department of Physics at the Institut Teknologi Bandung (ITB), Indonesia. Some laboratory works supporting the course are explained. DESCRIPTION OF THE SINGLE BOARD COMPUTER AND ASSOCIATED SOFTWARE PACKAGES For introductory microcontroller courses, 8-bit micro- controllers are widely utilized because they are simpler to describe, easier to use and lower cost than 16-bit or 32-bit microcontrollers. Among of the 8-bit microcontrollers, the MCS-51 family microc- ontrollers were chosen due to its wide-spread popu- larity especially as an industry standard, its simple architecture, and the likelihood that they will remain important for years to come 6. In teaching the instrumentation system course to the sophomore students, we need a SBC that integrates the MCS-51 microcontroller with light emitting diodes (LEDs), 7-segment displays, a liquid crystal display (LCD), a pushbutton, a keypad, and an analog to digital converter (ADC) so that students who take the course can do laboratory works in a more comfortable way. In addition, the SBC has the ability toperformserialandparallelcommunications. Unfortunately, such SBC is not available in the market. We therefore decided to design and develop the SBC as shown in Figures 1 and 2 with the features are as follows: Figure 1(a) Front view of the AT89S52 microcontroller-based single board computer (SBC) with a 220 V AC power supply and cables in the brief case and (b) enlargement of the SBC. Color figure can be viewed in the online issue, which is available at erscience.wiley. com. AN AT89S52 MICROCONTROLLER-BASED SBC167 (a) An AT89S52 8-bit microcontroller (1) with 8 kb of ISP (in-system programmable) fl ash memory (ATMEL AT89S52 at http:/www.at- The microcontroller is compatible with the industry-standard 80C51 instruction set and pinout. The on-chip flash memory allowstheprogrammemorytobe reprogrammedin-system/by a personal computer (PC). In addition, the microcon- troller provides 256 bytes of random access memory (RAM), 32 programmable input/ output (I/O) lines, three 16-bit timer/counters, eight interrupt sources, a full duplex serial port, and a watchdog timer. (b) Various input and output devices such as: an 8-pin dual in-line package (DIP) switches (2), a push button (3), a 4 ? 3 hexadecimal keypad (4), eight LEDs (5), four 7-segment displays (6), and an HD44780 compatible 2 ? 16 alphanumeric LCD (7). The status of the input devices (the DIP switches, push button, and keypad) are read and then sent to the microcontroller through the input ports while data from the microcontroller are sent to theoutputdevices(LEDsanddisplays) through the output ports. (c) A08048-bitmicrocontrollercompatible analog to digital converter (ADC) (8) (National Semiconductor at The conversion type of this ADC is the successive approximation register (SAR) with the conversion time of 100 ms. The ADC appears like memory locations or I/O ports to the microcontroller and therefore no interfac- ing logic is needed. Analog input of the ADC, which is in the range of 0?5 V with single 5 V supply, can be either two potentiometers (9) or from external connected to the connectors (10) in the board. Input selection is done by the CD4051 8-channel analog multiplexer (11).Thepotentiometerssimulateanalog voltage levels to be fed into the multiplexer. (d) A serial communication port that is provided bytheDB9connector(12).Usingthe MAX232 (Dallas Semiconductor MAXIM at http:/www.maxim- communicate serially with another SBC or a PC. (e) A DB25 parallel communication port (13) for downloading/uploading a program onto the microcontroller/PC. (f) A power supply input (14). A dc unregulated voltage in the range of 7?12 V can be used. (g) A button for resetting the microcontroller (15). There are two steps that have to be performed to program the AT89S52 microcontroller. First, a pro- gram is created by development software packages on the PC. The development software package should include an editor and compiler. Many software packages are available for that purposes and some of them are Read51 (Rigel Corp., Gainesville, FL; http:/www. and Proview 32 (Franklin Software, Inc., Campbell, CA; After having edited and compiled the program, a hex file is obtained. Second, the hex file is down- loaded into the microcontroller of the SBC by using, forinstance,theAEC_ISP(AECElectronics Ltd, Christchurch, New Zealand; http:/www.aec- electronics. co.nz/) or M. Asim Khans ISP software (http:/chaokhun.kmitl.ac.th/?kswichit/Pgm89v31_ web/Pgm89v31.html). In doing a serial communication between the PC and the SBC, the HyperTerminal application (Micro- soft Corp., Redmond, WA; http:/www.microsoft. com/) under the Microsoft Windows, which is ready after having installed the Windows, is a good choice because it is easy to use. The SBC is also compatible with the LabView under the Microsoft Windows, a commercial graph- based software from the National Instruments (Austin, TX; that is widely used in industry and instrumentation education. With the Figure 2Block diagram of the AT89S52 microcontroller- based SBC. 168KHAIRURRIJAL ET AL. assistance of this software, various applications using the SBC become easier and more attractive. SOME APPLICATIONS OF THE SBC FOR LABORATORY EXPERIMENTS Measurement is an essential part of the scientifi c processes and the technology of measurement is instrumentation. Figure 3 depicts a signal fl ow in the general block diagram of a microcontroller-based instrument. A sensor is a passive (in some cases an active) electronic device that converts a physical parameter or variable into an analog electrical signal. Since the analog electrical signal is sometimes not in the input range of the ADC, the conditioning circuits are needed to adapt the signal. The conditioned signal is then converted into a digital signal by the ADC tobe processed by the microcontroller. The processed digital signal is fi nally presented by the digital display. In the Department of Physics at the ITB, the instrumentation system course is a three-credit course that meets a 2-h lecture and a 3-h laboratory per week of the 15-week semester. The fi rst 3 weeks are to cover basic operational amplifi ers and basic digital devices. The next 7 weeks are devoted to the concept and integration of sensors, signal amplifi ca- tion, signal processing, data switching, data control, and data readout. The fi nal 5 weeks are reserved for introducing microcontrollers and its role in the instrumentation system. Typical course contents are the following: * Basic operational amplifi ers: characteristics, basic amplifi ers, current to voltage converter, bridge amplifi er, and instrumentation amplifi er. * Basic digital devices: gates, fl ip-fl ops, and counters. * Sensors: temperature, pressure, force, humidity, displacement, and electro-optics. * Signal amplifi cation and processing: fi lters, oscillators, modulation-demodulation, digital to analog and analog to digital conversion, and noise and noise reduction. * Data switching, control, and readout: pulse timers and counters, multiplexing and demulti- plexing, data communication, and display. * Microcontrollers: architecture, instruction set, programming, input-output ports, interrupts, timers, interfaces with peripheral devices, and roles in instruments. Based on the course contents and the SBC features, many possible experiments are provided by the SBC, in which some of them are listed below: (i) Programming the microcontroller. (ii) InterfacingtheDIPswitches,LEDs,7- segment displays, and LCD. (iii) Interfacing the keypad, LEDs, 7-segment displays, and LCD. (iv) Application of the analog multiplexer and ADC with the 7-segment displays or LCD. (v) Application of the serial communication. (vi) An instrumentation system including physical variable (for instance: temperature, pressure, or humidity) measurement, analog to digital conversion, and displaying the measurement results. For the 3-h laboratory per week of the 15-week semester, the course offers fi ve microcontroller- related laboratory experiments: (a) basic program- ming of the microcontroller, (b) interfacing the DIP switches, LEDs, and 7-segment displays, (c) applica- tion of the analog multiplexer and the ADC with the LCD, (d) serial communication, and (e) measurement Figure 3Signal flow in the block diagram of a micro- controller-based instrument. AN AT89S52 MICROCONTROLLER-BASED SBC169 of water temperature and displaying the measurement result. Experiment 1: Basic Programming of the Microcontroller The objectives of the Experiment 1 are to understand the AT89S52 microcontroller architecture and to program the microcontroller. In this experiment, fi rst, the SBC parallel port is connected to the PC printer port (Fig. 4a). Next, the development software packages to edit and compile a program as well as to download the program into the SBC (Fig. 4b) are installed into the PC. Since a microcontroller is a microprocessor (central processing unit) with external units like a RAM, a read-only memory (ROM) and other support units and it functions to control input/output devices as illustrated in Figure 5, created programs in this experiment cover: (i) addressing modes: register, direct, indirect, immediate, relative, absolute, and long indexed, (ii) functional modes: arithmetic, logics, boolean, data transfer, and program branching. Experiment 2: Reading From the DIP Switches and Writing to the LEDs and 7-Segment Displays The objectives of this experiment are to read the DIP switches voltage levels (logics) and to write to the LEDs and 7-segment displays. From the functional block diagram given in Figure 6a,b, it is shown that the inputs (the DIP 8-bit switches) are sent to port 0 of the microcontroller through the 74LS245 buffer chip. By making pin E of the buffer chip to be low, the buffer chip is activated and the 8-bit input data reach the microcontroller. In order to display the input data, port 2 of the microcontroller is connected to the LEDs or the 7-segment displays with the 74LS247 decoder. If pin E of the display is high, then the input data are displayed. In the case of LEDs, each bit of the input data is represented by each LED, in which if the bit is low/high, then the LED will turn on/off. Experiment 3: Application of the Analog Multiplexer and the ADC With the LCD The functional block diagram of the experiment is shown in Figure 7. The objectives of the experiment Figure 4A program is downloaded into the single board computer (SBC) by using parallel communication. Color figure can be viewed in the online issue, which is available at . Figure 5Functional block diagram of a microcontroller. 170KHAIRURRIJAL ET AL. are as follows: (i) to read analog voltage inputs (IN0 and IN7 stand for potentiometers in the SBC, IN1?IN6 are reserved for external inputs which are provided by connectors in the SBC), (ii) to select a channel of the analog multiplexer by pressing a button of the keypad, (iii) to display the selected data input to the LCD. If the keypad button is pressed, an interrupt request is sent to the microcontroller (INT0) and the hexadecimal code reaches port 0 of the microcon- troller after enabling the 74LS245 buffer (P1.4). After the microcontroller processed the hexadecimal code, fi rst 3-bits of port 1 (P1.0?P1.2) will send 3-bit control data to the control inputs of the analog multiplexer to select a channel. The selected analog input sends its analog voltage to the ADC which is enabled by bit 4 of the port 1 (P1.3). The analog voltage is converted into digital data by the ADC. The digital data are then received by the microcontroller through the port 0 to be displayed by the LCD which is connected to the port 2. Experiment 4: Application of Serial Communication By using the functional block diagram in Figure 8, the objectives of this experiment are to become familiar Figure 6Block diagram of reading from the DIP switches and writing to (a) the LEDs and (b) the 7-segment displays. Figure 7Block diagram of application of the analog multiplexer and the ADC with the LCD. Figure 8Block diagram of application of serial commu- nication in the selection of an input channel and displaying the input data to the LCD. AN AT89S52 MICROCONTROLLER-BASED SBC171 with the application of serial communication and the HyperTerminal. A PC is connected to the SBC through its serial port as shown in Figure 9. The PC sends command data to the microcontroller by using the serial communication. The command data ask the microcontroller to select a channel of the analog multiplexer by sending bits of P1.0, P1.1, and P1.2. An input is then selected to send its voltage level to the ADC. Next processes follow those explained in the Experiment 3 with the interrupt request of the keypad button is excluded. Experiment 5: An Instrumentation System for Temperature Measurement Figure 10a gives an instrumentation system for measuring water temperature with the objectives are as follows: (i) to understand characteristics of the temperature sensors, (ii) to apply the knowledge obtained from the previous experiments to the instrumentation system, (iii) to get accustomed to the LabView as a software for simulation, real time measurement, and data processing (Fig. 10b). SUMMARY We have designed and developed the SBC integrating the MCS-51 microcontroller with LEDs, 7-segment displays, an LCD, a pushbutton, a keypad, an ADC, serial and parallel communications. The SBC is used by the sophomore students of the Department of Physics at the Institut Teknologi Bandung (ITB), Indonesia who are taking the three-credit instru- mentation system course to complete their laboratory experiments. There are fi ve microcontroller-related laboratory experiments which are offered to the students within the 15-week semester. The laboratory experiments are (i) basic programming of the micro- controller, (ii) interfacing the DIP switches, LEDs, and 7-segment displays, (iii) application of the analog multiplexer and the ADC with the LCD, (iv) serial communication and application of the Hyper- Terminal, and (v) measurement of water temperature, displaying the measurement result, and application of the LabView. REFERENCES 1 J. S. Mayer, T. N. Jackson, and M. E. Lockley, A new role for microcontroller courses: Integrating EE Figure 9Serial communication between the SBC and the PC and the HyperTerminal display. Figure 10(a) An instrumentation system for measuring temperature of water and (b) Temperature as a function of time is displayed by using the LabView. Color figure can be viewed in the online issue, which is available at . 172KHAIRURRIJAL ET AL. curricula, 25th Annual Conference on Frontiers in Education, Atlanta, GA, 1995, Session 3a4. 2 M. Rabiee, Design, construction, and analysis of a microcontroller system, Comput Educ J 6 (1996), 63?68. 3 T. K. Hamrita, Microcontrollers in the biological and agricultural engineering curriculum at the University of Georgia, Proceedings of the 2002 American Society for Engineering Education Annual Conference, Montreal, Canada, 2002, Ses

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论