Você está na página 1de 3

Multiprocessor Communication using 8051 Microcontroller and RS-232 Interface

Mohsin Murad, Uzair Kamal 2006-CISE-499, 2006-CISE-4 Department of Computer Systems Engineering NWFP University of Engineering and Technology Peshawar, Pakistan Abstract----Embedded systems are the brains of todays most digital and industrial control systems. In systems where more than one processor is incorporated, the need for multiprocessor communication often arises. Products that might exploit this feature include data terminals which receive updates from a central control system, sensor systems which are interrogated by a monitoring station and multi-axis robots with each axis under the control of its own processor, to name a few. In this paper, we are discussing a simplified prototype of industrial multiprocessor communication systems using ATMEL 89C51 (8051) microcontroller, via serial communication RS-232 protocol. Weve constructed and simulated such a model for experimental purposes. The experimental results and the problems faced by the group in the way to get the task done are discussed. The interfacing of LM35 Temperature Sensor using ADC0804 and Simple one way DC fan to this microcontroller, and the operation of three microcontrollers in master-slave configuration is elaborated. The communication protocol developed in this paper may be extended to meet the data transfer requirements in any kind of hardware configuration. 1 2 I. INTRODUCTION There has been a great shift of trend towards fabrication and industrial use of embedded systems during the last three decades owing to manifold increase in their applications. In an industrial setting where there are to be two or more inter-related processing systems, the need for multiprocessor communications is indispensable. The microprocessors or microcontrollers may communicate via serial or parallel mode. Serial communication can be accomplished via many protocols e.g. RS232, RS-422 and RS-485. Among them, RS232 is the most common in terms of its simplicity and the maximum number of communicating processors supported. 8-bit microcontrollers are widely used mainly because they are simpler and easier to use than 16-bit or 32-bit microcontrollers, and also due to their low cost. Among them, Motorola 68HC11, Microchip PIC family, and the industry standard 8051 are prevalent. To interface these devices to the outside world, input and output devices, like Keypad and LCDs respectively, are generally used. In this paper the serial RS-232 mode of communication using 8051 is the main concern, with an emphasis on interfacing 8051 with LM35. An approach towards interfacing simple one way dc motor to 8051, without use of any driver IC is also discussed.

Even though many simulators are available for the 8051 family, most of them do not support multi-microcontroller operation, nor do they simulate all the embedded peripherals, and only a few can simulate external peripherals. So, programming, simulation and debugging couldnt be done using KEIL simulator. We have used two slaves (1 and 2) and a master controller, with nothing attached to the master, a DC motor to Slave 1, and a temperature sensor to Slave 2. The serial communication is performed via RS-232 standard. 1 II. RS-232 PROTOCOL

rules have been set, and 2-way communication is established while abiding by these rules. A visual display of the communication scheme is shown in Fig. 1.

The RS232 is a serial communication protocol that uses ground-referenced Fig.1. Signal flow diagram of system signals. A minimal 3-wire RS-232 connection consisting only of transmits 1 One of the Slave has been assigned an data, receives data and ground, is address as in our configuration we are only commonly used when the full facilities of receiving data from slave 2. The two slaves RS-232 are not required. Even a two-wire are assigned addresses 1 and 2. In Master to connection (data and ground) can be used if Slave communication, the slave 8051 has to the data flow is one way (for example, a wait for the address sent by the master 8051 digital postal scale that periodically sends a serially, and on receiving the address it weight reading, or a GPS receiver that periodically sends position, if no 2 configuration via RS-232 is necessary). Since RS232 is not compatible with todays micro controllers, we need a line driver or a voltage converter to convert the RS232 signals to TTL voltage levels which will be acceptable to the 8051 TxD and RxD. The MAX232 converts from RS232 voltage levels to TTL voltage levels and vice versa. 8051 transmits and receives data serially at multiple baud rates, we will be configuring our controllers with baud rate of 9600. 1 III. GOALS 0 Fig.2. Fan Controller Of Slave 1 To establish a multiprocessor 3 verifies the address and perform the task of communication system in a master-slave turning on or off the fan, the second slave configuration, three 8051 controllers in should receive the temperature data from adc master-slave configuration are connected. and upon reception it checks a particular The aim is to perform master to slave bit;if on it tranmits a particular data to the communication and vice versa. A set of master microcontroller which will compare

this data and then send a particular set of bits containing the information of turning on or off the fan to the 1st slave. At the time of address reception the first slave will turn on the TB8 bit and once the address is received it will continuously receive the data 4 Part Of The Document Removed For Complete Code And Presentation visit www.intcube.com/forum and request in the projects section

[8]. Circuit Cellar INK, the Computer Applications Journal, Issue 107, June 1999. [9].www.pjrc.com/tech/8051/autobaud.ht ml. [10]. multiprocessor communication
www.8051projects.net/forumt6680.html

REFERENCES [1]. Nunnally, C.E., "Teaching Microcontrollers," Proc. of the 26th Frontiers in Education Annual Conference, Vol. 1, Nov. 1996, pp. 434436. [2]. http://www.8052.com/tutser.phtml [3]. The 8051 microcontroller and Embedded systems using assembly and C Muhammad Ali Mazidi, Janice Gillespie Mazidi http://www.avocetsystems.com/. [4]. Keil Software, dScope Debugger, http://www.keil.com/. [5]. Virtual Micro Design, Universal microprocessor Program Simulator (UMPS), http://www.vmdesign.com/. [6]. Alfredo del Ro and Juan Jos Rodrguez Andina, UVI51: a simulation tool for teaching/learning the 8051 Microcontroller, 30th ASEE/IEEE Frontiers in Education Conference, Kansas City, 2000. [7]. J. Axelson, Serial Port Complete: Programming and Circuits for RS232 and RS-485 Links and Networks, Lakeview Research, Madison, WI, 1998.

[11]. Scott Mckenzie, The 8051 Microcontroller, Third edition, pp 218. [12]. www.google.com/ ADC interfacing reference page. [13].www.8052.com/Tutorial: Introduction to LM35 Interfacing [14]. NAtional LM35 datasheet available at http:// nationalsemiconductor.com/ [15]. MAX232 datasheet available at http://www.maxim-ic.com

Você também pode gostar