Specifications

Chapter 1 - Introduction to Microprocessors
1.4 Input-output unit
Those locations we've just added are called "ports". There are several types of ports : input,
output or bidiectional ports. When working with ports, first of all it is necessary to choose which
port we need to work with, and then to send data to, or take it from the port.
When working with it the port acts like a memory location. Something is simply being written
into or read from it, and it could be noticed on the pins of the microcontroller.
1.5 Serial communication
Beside stated above we've added to the already existing unit the possibility of communication
with an outside world. However, this way of communicating has its drawbacks. One of the basic
drawbacks is the number of lines which need to be used in order to transfer data. What if it is
being transferred to a distance of several kilometers? The number of lines times number of
kilometers doesn't promise the economy of the project. It leaves us having to reduce the
number of lines in such a way that we don't lessen its functionality. Suppose we are working
with three lines only, and that one line is used for sending data, other for receiving, and the
third one is used as a reference line for both the input and the output side. In order for this to
work, we need to set the rules of exchange of data. These rules are called protocol. Protocol is
therefore defined in advance so there wouldn't be any misunderstanding between the sides that
are communicating with each other. For example, if one man is speaking in French, and the
other in English, it is highly unlikely that they will quickly and effectively understand each other.
Let's suppose we have the following protocol. The logical unit "1" is set up on the transmitting
line until transfer begins. Once the transfer starts, we lower the transmission line to logical "0"
for a period of time (which we will designate as T), so the receiving side will know that it is
receiving data, and so it will activate its mechanism for reception. Let's go back now to the
transmission side and start putting logic zeros and ones onto the transmitter line in the order
from a bit of the lowest value to a bit of the highest value. Let each bit stay on line for a time
period which is equal to T, and in the end, or after the 8th bit, let us bring the logical unit "1"
back on the line which will mark the end of the transmission of one data. The protocol we've
just described is called in professional literature NRZ (Non-Return to Zero).
http://www.mikroelektronika.co.yu/english/product/books/PICbook/1_Poglavlje.htm (5 of 9) [4/2/2003 16:17:33]