Sunteți pe pagina 1din 15

CHAPTER 3

Theoretical Considerations

3.1. Serial Data Communication

Serial transmission refers to the way each character is transferred. Characters

transmitted serially are sent one bit at a time and received one bit at a time in the order of

transmission. This is in contrast to parallel transmission schemes which transmit more

than one bit at a time. In a long transmission line it will be more economical when serial

data communication is used between terminal device and peripheral devices, since fewer

data lines and control lines are used (“Serial communication”, taltech.com).

3.1.1. Asynchronous Serial Communication

Asynchronous Serial Communications (ASC) is the term used to describe

the specific manner in which communications take place between a computer and

its associated terminals and serial printers. In asynchronous communication, data

is preceded with a start bit which indicates to the receiver that a word (a chunk of

data broken up into individual bits) is about to begin. To avoid confusion with

other bits, the start bit is twice the size of any other bit in the transmission. The

end of a word is followed by a stop bit, which tells the receiver that the word has

come to an end, that it should begin looking for the next start bit, and that any bits

it receives before getting the start bit should be ignored. To insure data integrity, a

parity bit is often added between the last bit of data and the stop bit. The parity bit
makes sure that the data received is composed of the same number of bits in the

same order in which they were sent. Because this scheme allows data to be sent

intermittently and does not require elaborate timing mechanisms, the

asynchronous method is particularly useful for reading characters entered through

a keyboard, where the time interval between the entries of two characters can vary

greatly (Huang, 2005).

3.1.2. Synchronous Serial Communication

Synchronous communication takes place between a transmitter and a

receiver operating on synchronized clocks. In a synchronous system, the

communication partners have a short conversation before data exchange begins.

In this conversation, they align their clocks and agree upon the parameters of the

data transfer, including the time interval between bits of data. Any data that falls

outside these parameters will be assumed to be either in error or a placeholder

used to maintain synchronization. Synchronous lines must remain constantly

active in order to maintain synchronization, thus the need for placeholders

between valid data. Once each side knows what to expect of the other, and knows

how to indicate to the other whether what was expected was received, then

communication of any length can commence (Huang, 2005).

3.1.3. Clock Synchronization

In a synchronous link, it is imperative that all the hardware operate

together with a common clock. There are three clocking methods by which to

achieve synchronization: internal, external, and recovered clocking. All three


methods derive the clock signal for the reception line from the incoming data. The

clock signal for the transmission line will always be generated by the devices

internal oscillator, but the phase reference used by the internal oscillator differs

for each of the clocking methods. When internal clocking is used, the transmit

clock is phase locked to the device's own internal oscillator. For external clocking,

the transmit clock is phase locked to the phase of the oscillator belonging to

another device in the network. For recovered clocking, the transmit clock phase is

locked to the clock derived from the incoming data.

In general, the DCE device (such as a modem) uses internal clocking,

while the DTE device (such as a PC) uses external clocking and synchronizes

around the DCE device. In cases where DTE-DTE or DCE-DCE connections are

necessary, one device must be configured atypically, or a device such as a

modem-eliminator or tail-circuit buffer must be placed between the two.

However, in large networks with multiple devices this is not always possible. One

solution for such networks is to have all devices synchronize around a single

modem's clock source. However, this solution has the tendency to result in clock

drift, and thus can potentially corrupt data. The other solution is to use recovered

clocking so that a modem can derive the clock from data on its reception line then

send that information out on its transmit line to be used by the next modem in

line, etc.

There are three clocking methods by which to achieve synchronization:

internal, external, and recovered clocking. All three methods derive the clock
signal for the reception line from the incoming data. The clock signal for the

transmission line will always be generated by the devices internal oscillator, but

the phase reference used by the internal oscillator differs for each of the clocking

methods. When internal clocking is used, the transmit clock is phase locked to the

device's own internal oscillator. For external clocking, the transmit clock is phase

locked to the phase of the oscillator belonging to another device in the network.

For recovered clocking, the transmit clock phase is locked to the clock derived

from the incoming data.

In general, the DCE device (such as a modem) uses internal clocking,

while the DTE device (such as a PC) uses external clocking and synchronizes

around the DCE device. In cases where DTE-DTE or DCE-DCE connections are

necessary, one device must be configured atypically, or a device such as a

modem-eliminator or tail-circuit buffer must be placed between the two.

However, in large networks with multiple devices this is not always possible. One

solution for such networks is to have all devices synchronize around a single

modem's clock source. However, this solution has the tendency to result in clock

drift, and thus can potentially corrupt data. The other solution is to use recovered

clocking so that a modem can derive the clock from data on its reception line then

send that information out on its transmit line to be used by the next modem in

line, etc (Huang, 2005).


3.2. UART or USART

UART stands for universal asynchronous receiver transmitter. At the heart of

every asynchronous serial system is the Universal Asynchronous Receiver/Transmitter or

UART. The UART is responsible for implementing the asynchronous communication

process described in asynchronous data communication as both a transmitter and a

receiver (both encoding and decoding data frames). The UART not only controls the

transfer of data, but the speed at which communication takes place. However, the first

UARTs could only handle one byte of information at a time, which meant that the

computer needed to immediately process any transmission or risk losing data as the next

byte of information pushed its way onto the UART. Not only does this makes for

unreliable and slow communication, it can slow down the entire system. It is used for

serial communication interface which translates data between parallel and serial

interfaces. This is hardware which is already integrated in some microcontroller used for

serial communications over a computer or peripheral device serial port. Software UART

can also be established by means of a program. The USART is just like the UART with

an additional synchronous mode rather than asynchronous mode only. USART module

can be configured in three different modes, as a full-duplex asynchronous system that can

communicate with peripheral devices, such as CRT terminals and personal computers. It

can also be a master/slave half-duplex synchronous system that can communicate with

peripheral devices such as A/D or D/A integrated circuits and serial EEPROMS.

Depending on the microcontroller model, it can have more than 1 USART module on one

chip (Huang, 2005).


3.2.1. USART-Related Registers

USART module uses the following registers to control its operation are:

Transmit status register (TXSTA), receive status register (RCSTA), baud rate

generate register (SPBRG), transmit register (TXREG), and receive register

(RCREG). To those microcontroller devices with two USART modules a suffix is

added to the names of the register. For example the transmit status register for

USART1 will be TXSTA1 (Huang, 2005).

3.2.2. USART structure

A UART usually contains the following components:

• A clock generator, usually a multiple of the bit rate to improve sampling in

the middle of a bit period.

• input and output shift registers

• transmit/receive control

• read/write control logic

• optional transmit/receive buffers

• optional parallel data bus buffer

3.3. LCD module

Liquid Crystal Display (LCD) is a display device which is widely used for various

electronic applications that has human interface in it. It is made out of glass substrate

with electrode film (ITO), twisted nematic liquid crystals, vertical and horizontal filter
films. There are two types of LCD an active-matrix and a passive-matrix. Active-matrix

displays are the modern colored LCD display like thin-film transistors (TFT) and the

active-matrix LCDs. These displays are not only colored but they also have higher

resolution and refresh rate. The passive-matrix is the monochrome display LCDs, their

resolution are smaller and refresh rate does not match the active-matrix.

The LCD display module is a 2x16 matrix display. It is a thin, lightweight, low

power LCD display with a STN fluid for high contrast and wide viewing angle. Also, it

has a built in controller installed therefore no LCD display driver is needed to run this

device. Just plug in its inputs to the outputs of the microcontroller and its set to go

assuming that the right signals are being received by the LCD display (LCD, e-

gizmo.com).

Figure 4. LCD module

3.4. Keypad module

The keypad used is a BCD output decoded keypad module with security output.

These keypads outputs a 4 bit BCD code corresponding to a key pressed. The built in

controller mimics the operation of the popular 74C922 keypad encoder. In addition, it has

one output that activates only when a correct 4-digit security code is pressed.
Keypads are responsible for the input of the user to the PC or in our case a

microcontroller. It is the only means of communication of instruction from the outside

world to the microcontroller (DIY/KIT, e-gizmo.com).

Figure 5. Keypad module

3.4. Protocols

In order for electronic devices to communicate with each other they must conform

to well defined sets of rules which govern factors ranging from hardware configurations

to the actual process of data transfer.

Such a set of rules is called a protocol. Data communications protocols are

conventions set up to assure the orderly exchange of information between two or more

data processing entities (“Data transmission”, wikipedia.org) .

3.5. Hardware Protocols

The lowest level protocols deal with the hardware connection between two pieces

of data processing equipment. The cables used to connect asynchronous devices to the

Data communications and Terminal Controller conforms to protocols defined by the

Electronic Industries Association (EIA). These protocols, RS-232-C and RS-422, were

developed and updated in conjunction with the Bell System and independent equipment

manufacturers.
3.6. DTE and DCE devices

DTE and DCE are vital elements in data communication. The DTE device is

responsible for the termination or end of the communication line, whereas the DCE

provides path for communication (“Serial communication”, taltech.com).

3.6.1. Data Terminal Equipment (DTE)

This refers to an end instrument that converts user information into signals

that are ready for transmission. It also reconverts the received signals back to user

information. A general rule is that DCE devices provide the clock (internal

clocking) and that the DTE device synchronizes on the provided clock (external

clocking). This may be just a single piece of equipment or it can be an

interconnected subsystem of multiple equipment that performs all the required

functions necessary to permit users to communicate.

Figure 6. Parallel port assignment


Figure 7. Serial port assignment

The TD (transmit data) wire is the one through which data from a DTE

device is transmitted to a DCE device. This name can be deceiving, because this

wire is used by a DCE device to receive its data. The TD line is kept in a mark

condition by the DTE device when it is idle. The RD (receive data) wire is the one

on which data is received by a DTE device, and the DCE device keeps this line in

a mark condition when idle.

RTS stands for Request To Send. This line and the CTS line are used

when "hardware flow control" is enabled in both the DTE and DCE devices. The

DTE device puts this line in a mark condition to tell the remote device that it is

ready and able to receive data. If the DTE device is not able to receive data

(typically because its receive buffer is almost full), it will put this line in the space

condition as a signal to the DCE to stop sending data. When the DTE device is

ready to receive more data (i.e. after data has been removed from its receive

buffer), it will place this line back in the mark condition. The complement of the

RTS wire is CTS, which stands for Clear To Send. The DCE device puts this line
in a mark condition to tell the DTE device that it is ready to receive the data.

Likewise, if the DCE device is unable to receive data, it will place this line in the

space condition. Together, these two lines make up what is called RTS/CTS or

"hardware" flow control. The Software Wedge supports this type of flow control,

as well as Xon/XOff or "software" flow control. Software flow control uses

special control characters transmitted from one device to another to tell the other

device to stop or start sending data. With software flow control the RTS and CTS

lines are not used.

DTR stands for Data Terminal Ready. Its intended function is very

similar to the RTS line. DSR (Data Set Ready) is the companion to DTR in the

same way that CTS is to RTS. Some serial devices use DTR and DSR as signals

to simply confirm that a device is connected and is turned on. The Software

Wedge sets DTR to the mark state when the serial port is opened and leaves it in

that state until the port is closed. The DTR and DSR lines were originally

designed to provide an alternate method of hardware handshaking. It would be

pointless to use both RTS/CTS and DTR/DSR for flow control signals at the same

time. Because of this, DTR and DSR are rarely used for flow control.

CD stands for Carrier Detect. Carrier Detect is used by a modem to

signal that it has a made a connection with another modem, or has detected a

carrier tone.

The last remaining line is RI or Ring Indicator. A modem toggles the

state of this line when an incoming call rings your phone.


The Carrier Detect (CD) and the Ring Indicator (RI) lines are only

available in connections to a modem. Because most modems transmit status

information to a PC when either a carrier signal is detected (i.e. when a

connection is made to another modem) or when the line is ringing, these two lines

are rarely used (“Serial communication”, taltech.com).

3.6.2. DCE (Data Circuit-Terminating Equipment)

DCE which is also synonymous to Data Communications Equipment is an

equipment that performs functions such as signal conversion and coding, at the

networl end of the line between the data terminal equipment (DTE) and the line.

There are different types of interfaces between the DCE and DTE, but the

most commonly used interface is the RS-232. Usually, the DTE device is the

terminal (or a computer), and the DCE is a modem (“Data”, wikipedia.org).

3.7. Baud Rate

The baud unit is named after Jean Maurice Emile Baudot, who was an officer in

the French Telegraph Service. He is credited with devising the first uniform-length 5-bit

code for characters of the alphabet in the late 19th century. Baud is a measure of the

symbol rate; that is, the number of distinct symbolic changes (signalling event) made to

the transmission medium per second in a digitally modulated signal. Simply baud really

refers to is modulation rate or the number of times per second that a line changes state.

This is not always the same as bits per second (BPS). If you connect two serial devices

together using direct cables then baud and BPS are in fact the same. Thus, if you are
running at 19200 BPS, then the line is also changing states 19200 times per second

(“Serial communication”, taltech.com).

3.8. Nokia 6210

Nokia 6210 is a mobile phone with a high speed data communication speed that

could reach up to 43.2kbps data rates using HSCSD (High Speed Circuit Switched Data).

Its data supports 9.6 & 14.4 kbps single slot or HSCSD (2+2, 3+1, non transparent) via

IrDA or cable. It is coupled with a built-in WAP 1.1 browser which provides access to

mobile internet services. This phone can also be used as a high-speed wireless modem

with a compatible PC.

With Nokia 6210, wireless communication between phone and compatible PC or

printer can be made using its Infrared feature. This feature makes it also possible to

transfer names, phone numbers and calendar notes between compatible phones.

The reason behind the usage of this phone is that; it is cheap, high battery life, and

it has the basic functions needed in our study, a high-speed data communication, and a

built-in modem which makes data communication (PC-to-GSM, MCU-to-GSM and vice

versa using DLR-3 connector) possible (Nokia 6210, Nokia.com).

Figure 8. Nokia 6210


3.9. Protocol Data Unit (PDU)

Information that is delivered as a unit or units among peer entities of a network

and that may contain control information, address information, or data. In layered

systems, a unit of data that is specified in a protocol of a given layer and that consists of

protocol-control information of the given layer and possibly user data of that layer

(“Protocol data unit”, Wikipedia.org).


Reference:

Introduction to Serial Communications (2005). Retrieved on October 3, 2006. from


http://www.taltech.com/resources/intro-sc.html.

Data circuit-terminating equipment. (2006, September 23). In Wikipedia, The Free


Encyclopedia. Retrieved 15:52, October 3, 2006, from
http://en.wikipedia.org/w/index.php?title=Data_circuit-
terminating_equipment&oldid=77401370.

Huang, Han-Way. (2005). PIC microcontroller: an introduction to software and hardware


interfacing. Clifton Park, NY: Thomson.Delmar Learning.

Predko, M. (2002). Programming and customizing PIC micro microcontrollers. New


York: McGraw-Hill.

Protocol data unit. (2006, October 3). In Wikipedia, The Free Encyclopedia. Retrieved
05:49, October 1, 2006, from
http://en.wikipedia.org/w/index.php?title=Protocol_data_unit&oldid=79222260

Nokia 6210. (n.d.). Retrieved on September 24, 2006 from


http://www.nokia.co.uk/nokia/0,8764,18180,00.html

DIY/KIT. (n.d.). Retrieved on September 28, 2006 from http://www.e-gizmo.com/kit.htm

Data transmission. (2006, August 7). In Wikipedia, The Free Encyclopedia. Retrieved
05:49, September 28, 2006, from
http://en.wikipedia.org/w/index.php?title=Data_transmission&oldid=79222260.

LCD display panel. (n.d.). Retrieved on Septermber 28, 2006 from http://www.e-
gizmo.com/PRODUCT/OPTO.htm

S-ar putea să vă placă și