You are on page 1of 13

Serial Communication Using RS-232 Connector and Microcontroller 89c51

The MAX232 from Maxim was the first IC which in one package contains the necessary drivers (two) and receivers (also two), to adapt the RS-232 signal voltage levels to TTL logic. It became popular, because it just needs one voltage (+5V) and generates the necessary RS-232 voltage levels (approx. -10V and +10V) internally. This greatly simplified the design of circuitry. Circuitry designers no longer need to design and build a power supply with three voltages (e.g. -12V, +5V, and +12V), but could just provide one +5V power supply, e.g. with the help of a simple 78x05 voltage converter. FUNCTION:They. have two internal charge-pumps that convert +5V to 10V (unloaded) for RS-232 driver operation. The first converter uses capacitor C1 to double the +5V input to +10V on C3 at the V+ output. The second converter uses capacitor C2 to invert +10V to -10V on C4 at the V- output .A small amount of power may be drawn from the +10V (V+) and -10V (V-) outputs to power external circuitry (see the Typical Operating Characteristics section),except on the MAX225 and MAX245MAX247, where these pins are not available. V+ and V- are not regulated, so the output voltage drops with increasing load current. Do not load V+ and V- to a point that violates the minimum 5V EIA/TIA-232E driver output voltage when sourcing current from V+ and V- to external circuitry.

Serial Communication Using RS-232 Connector and Microcontroller 89c51

Microcontroller circuits diagram


The Universal Asynchronous Receiver/Transmitter (UART) controller is the key component of the serial communications subsystem of a computer. The UART takes bytes of data and transmits the individual bits in a sequential fashion. At the destination, a second UART re-assembles the bits into complete bytes. Serial transmission is commonly used with modems and for non-networked communication between computers, terminals and other devices. There are two primary forms of serial transmission: Synchronous and Asynchronous. Depending on the modes that are supported by the hardware, the name of the communication sub-system will usually include a A if it supports Asynchronous communications, and a S if it supports Synchronous communications. Both forms are described below.

Adc circuits diagram

Control of the ADC0804


Make sure that the parallel port is in the bidirectional mode and stays like this during the measurements. Voltages at pin 2 and pin 3 (on the ADC) must be +5V before the conversion. To start a new conversion, we must make WR (pin 3 on the ADC) 0 V and then return it to +5 V state. The conversion starts when pin 3 goes high (rising edge triggered) Wait until INTR (pin 5 on the ADC) goes to 0 V. (When the conversion process is done, this pin goes to 0.) When pin 5 goes low, we must make RD (pin 2 on the ADC) go to 0 V to load the new value to the digital outputs (pin 11 to 18 on the ADC) Read the values on the digital outputs into the parallel port Lastly, return RD (pin 2 on the ADC) to the +5 V state

Interfacing the ADC0804 to the 2051 The AT89C2051 is a general purpose microcontroller. It is a 20 pin version of the 8051 and uses t language. See below for more information about programming the chip. To control the ADC0804, we will use 3 lines from the Connect pin 2 (Read) from the ADC0804 to pin 7 (P3.3) of the 2051. Connect pin 3 (Write) to pin 8 (P3.4). Connect pin 5 (Interrupt) to pin 9 (P3.5). The 8 bit Output Data from the ADC0804 will be connected to Port 1 of the 2051. Connect pin 18 (D0) of the ADC0804 to pin 12 of the 2051 (P1.0). Connect pin 17 (D1) to pin 13 (P1.1). Connect pin 16 (D2) to pin 14 (P1.2). Connect pin 15 (D3) to pin 15 (P1.3). Connect pin 14 (D4) to pin 16 (P1.4). Connect pin 13 (D5) to pin 17 (P1.5). Connect pin 12 (D6) to pin 18 (P1.6). Connect pin 11 (D7) to pin 19 (P1.7).

ADC0804
Analog to Digital Conversion - The ADC0804 IC The easiest way to do analog to digital conversion is to use an IC

uch as the ADC0804 that does the work for you. The analog voltage is applied to pin 6 and the result is available at pins 11 through 18. We will connect pin 1 (Chip Select) to ground so that the chip is always enabled. (If you wanted to use more than one ADC you could use this pin to control which chip is currently enabled). Connect pin 7 (Vin - ) to ground. The ADC0804 includes an internal oscillator which requires an external capacitor and resistor to operate. Connect the 150 pF capacitor from pin 4 to ground and the 10k ohm resistor from pin 4 to pin 19. Also for power, Connect pin 20 to 5 volts. Connect Pin 8 to ground. Connect pin 10 to ground.

Interfacing the ADC0804 to the 2051 The AT89C2051 is a general purpose microcontroller. It is a 20 pin version of the 8051 and uses t language. See below for more information about programming the chip. To control the ADC0804, we will use 3 lines from the Connect pin 2 (Read) from the ADC0804 to pin 7 (P3.3) of the 2051. Connect pin 3 (Write) to pin 8 (P3.4). Connect pin 5 (Interrupt) to pin 9 (P3.5). The 8 bit Output Data from the ADC0804 will be connected to Port 1 of the 2051. Connect pin 18 (D0) of the ADC0804 to pin 12 of the 2051 (P1.0). Connect pin 17 (D1) to pin 13 (P1.1). Connect pin 16 (D2) to pin 14 (P1.2). Connect pin 15 (D3) to pin 15 (P1.3). Connect pin 14 (D4) to pin 16 (P1.4). Connect pin 13 (D5) to pin 17 (P1.5). Connect pin 12 (D6) to pin 18 (P1.6). Connect pin 11 (D7) to pin 19 (P1.7).

Planning the System


Before developing any software packages first of all it is necessary to do a proper planning. Planning means chalking out the out line of style of working, which reduces complexity. So before starting this project we had planned a style of working by dividing jobs within each and every member of the project. Before starting any project all the necessary information should be gathered so that a proper line of action can be chosen. Hardware requirement Software requirement

power supply
1

TRANSFORMER STEPDOWN SW1 1 2 8 T1

+12v U6 +2 1 U11 IC1 7812 VIN


AD J

ON / OFF SWITCH 230 V AC 50 HZ

4 4IN 4007 1 C5 470 UF


3

U11 IC1 7805 3 1 VIN


AD J

VOUT

VOUT

+5v 3 U6

CONECTOR

EXPLANATION OF SCHEMATIC DIAGRAM: The circuit is given the power supply, using the Transformer. It is given 230 V AC supply. Four diodes are connected to the transformer. Voltage Regulators are used to regulate the voltage. The following voltage regulators are used to generate various outputs: 7812 regulator generates a +12V supply. 7912 regulator generates a 12V supply. 7809 regulator generates +9V supply. 7805 regulator generates +5V vcc supply. 12V is given to the relay.

You might also like