You are on page 1of 6

Concepts for transmitting data from a PC to a microcontroller:

Technical Topic Report


Ryan Kittredge
20, November 2003

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 it
with 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.
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 is
to 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 a
common ground between the two devices.

The draw backs to using RS232 are that it uses negative logic where a ‘1’ is -3V to -12V
and 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 the
system 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
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 the
RS232 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.
This is a sample of RS232 data transmission.

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

I 2 C 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. It
appeals 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 we
would 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 I 2 C system that won’t have all of the
features of the I 2 C specification, and will only perform the tasks that we will require.
Some debugging will probably be required, but after talking to some people it seemed
like this was very possible and might be our best solution to the problem.
This is a table of terminology associated with I 2 C data transmission.

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

For more information on any of these concepts look at these references:

Ball, Stuart R, P.E., Embedded Microprocessor Systems: Real World Design Third
Edition. Elsevier Science (USA), 2002.

Held, Gilbert, The Complete Modem Reference Third Edition.


John Wiley & Sons, Inc., 1997.
Morton, Todd D., Embedded Microcontrollers.
Upper Saddle River, New Jersey, 2001.

Paret, Dominique, The I 2 C Bus From Theory to Practice.


West Sussex, England, 1997.

Internet References:

www.semiconductors.phillips.com

www.beyondlogic.org

www.fairchildsemi.com

www.kmitl.ac.th/~kswichit/MAX232/MAX232.htm

www.logix4u.net/parallelport1.htm

You might also like