max232 imp information

5
Concepts for transmitting data from a PC to a microcontroller: 1. Parallel Port Interface: The parallel port is a 25 pin connector on your computer that is commonly known as the  printer port, LPT1 or LPT2. This port is nice because it is relatively easy t o manipulate it with software and the data i s transmitted using standard TTL 0 – 5V signals. Another pro to using this port is there is no nee d for additional hardware to put the signal back together so that it can be loaded into the microcontroller. The one major drawback for our project is that the parallel port hog s up a lot of pins and that can be a problem when you’re dealing with a 16 pin micr ocontroller. To utilize the  parallel interface we would need 8 pins for the data transmission, 1 pin is an IRQ which signals that the data is ready and clocks it through, 1 pin to signal whether the data transmission was an address or actual data becau se we are employing multiple microcontrollers, and 1 pin to send a signal back to the PC telling it that the current task has been accomplished and it is ready for the next instruction.  Now just to transmit data to the microcontroller we need 11 pins and 2 pins are power and ground, so that only leaves 3 pins on port A to control our motor, which is enough for now, but cuts down on capability for future expansion. This is a pin out diagram of the DB25 parallel port connector. The following table lists the function of each pin in the DB25 con nector as they pertain to a printer connection. The most useful part i s the direction of si gnal flow for our application, as well as knowing whether the bit is inverted or not.

Upload: ananth-shenoy

Post on 08-Apr-2018

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Max232 Imp Information

8/7/2019 Max232 Imp Information

http://slidepdf.com/reader/full/max232-imp-information 1/5

Concepts for transmitting data from a PC to a microcontroller:

1. Parallel Port Interface:

The parallel port is a 25 pin connector on your computer that is commonly known as the

 printer port, LPT1 or LPT2. This port is nice because it is relatively easy to manipulate itwith software and the data is transmitted using standard TTL 0 – 5V signals. Another pro

to using this port is there is no need for additional hardware to put the signal back 

together so that it can be loaded into the microcontroller.

The one major drawback for our project is that the parallel port hogs up a lot of pins and

that can be a problem when you’re dealing with a 16 pin microcontroller. To utilize the parallel interface we would need 8 pins for the data transmission, 1 pin is an IRQ which

signals that the data is ready and clocks it through, 1 pin to signal whether the data

transmission was an address or actual data because we are employing multiple

microcontrollers, and 1 pin to send a signal back to the PC telling it that the current task 

has been accomplished and it is ready for the next instruction.

 Now just to transmit data to the microcontroller we need 11 pins and 2 pins are power and ground, so that only leaves 3 pins on port A to control our motor, which is enough for 

now, but cuts down on capability for future expansion.

This is a pin out diagram of the DB25 parallel port connector.

The following table lists the function of each pin in the DB25 connector as they pertain to

a printer connection. The most useful part is the direction of signal flow for our application, as well as knowing whether the bit is inverted or not.

Page 2: Max232 Imp Information

8/7/2019 Max232 Imp Information

http://slidepdf.com/reader/full/max232-imp-information 2/5

This next table lists the base addresses for the status, control and data registers of LPT1

and LPT2.

 

2. Serial Port Interface:

The RS232 serial port is another option for transmitting data between the PC and the

microcontroller. One of the major functions of the serial port is to put data into a serial

format so that it can be transmitted via modem. One of the functions that we use it for isto download programs that have been compiled on a PC to run on a microcontroller. The

one good feature is that the RS232 would only need three wires between the PC and the

microcontroller. One line is data transmit, one line is data receive, and the last line is acommon ground between the two devices.

The draw backs to using RS232 are that it uses negative logic where a ‘1’ is -3V to -12Vand a ‘0’ is +3V to +12V and the region from -3V to 3V is undefined. The

microcontroller uses standard TTL logic so the RS232 signal has to be sent through

another device to convert the negative logic back to TTL. This adds hardware to thesystem which adds difficulty to production. Two choices for hardware would be a

MAX232 chip which converts the negative logic to TTL and keeps the data in a serial

format. This requires you to run a RS232 program in the microcontroller to decode the

serial transmission back into bytes that the microcontroller to manipulate and to do this

Page 3: Max232 Imp Information

8/7/2019 Max232 Imp Information

http://slidepdf.com/reader/full/max232-imp-information 3/5

the software utilizes the timer, so anytime data is sent the microcontroller has to stop

using the timer for other functions. The other choice would be a chip called an UART

which stands for Universal Asynchronous Receiver / Transmitter. This chip receives theRS232 transmission and reformats it into TTL 8-bit words and then transfers the data to

the microcontroller by parallel transmission. Now we are hogging the pins on the

microcontroller again.

This is a picture of the pin out of the RS232 connector.

 

This next table lists the addresses of the RS232 COM ports.

Page 4: Max232 Imp Information

8/7/2019 Max232 Imp Information

http://slidepdf.com/reader/full/max232-imp-information 4/5

This is a sample of RS232 data transmission.

3. C  I 2 Data Communication – Inter- Integrated Circuit

C  I 2 is a type of serial communication that was developed by Phillips in the late ‘70’s as

a means of communication between different devices within an appliance that they

 produced. This technology is widely used today in items such as automobiles,

televisions, telephones, cell phones and all kinds of different electronic devices. Itappeals to people because it is a two wire bus that allows data transmission between

multiple devices. One wire is the SCL which stands for Serial CLock line and the other 

is the SDA or Serial DAta line. This would be good for our application because wewould use the PC as the master controller of the data bus which basically means that it

will supply the clock signal to clock the data into the microcontroller. This system uses

standard TTL signals and the microcontroller wouldn’t be bogged down performing other functions trying to retrieve data.

The only real problem with this system is that software would have to be written for the

PC to handle these functions of clocking one line and putting data on the other. The

software would utilize two pins from the parallel port for transmission. This is a risk for us because we’ll kind of be making our own C  I 

2 system that won’t have all of the

features of the C  I 2 specification, and will only perform the tasks that we will require.

Some debugging will probably be required, but after talking to some people it seemedlike this was very possible and might be our best solution to the problem.

This is a table of terminology associated with C  I 2 data transmission.

Page 5: Max232 Imp Information

8/7/2019 Max232 Imp Information

http://slidepdf.com/reader/full/max232-imp-information 5/5

The following is a sample of data transfer on the C  I 2 bus.

: