Intel MCS 51 User Manual page 301

Table of Contents

Advertisement

intel.
83C152 HARDWARE DESCRIPTION
This simplifiesthe maintenance of the GSC and can
make the implementation of an external buffer for
packetizedinformationautomatic.
An externalbuffercan be used as the sourceof data for
transmission,or the destinationof data from the receiv-
er. In this arrangement, the messagesize is limitedto
the W
size or 64K, whicheveris smaller. By using
an external butTer,the data carsbe aweased by otha
deviceswhich may want accessto the aerial data. The
amount of time required for the external data moves
will also decrease. Under CPU contro~ a "MOVX"
cmmnandwouldtake 24 oscillatorperiodsto complete.
Under DMA control,externalto internal, or internalto
external, data movestake only 12oscillatorperiods.
3.5.4 BAUD
RATE
The GSC
baud rate is determinedby the contentsofthe
SFR, BAUD, or the external clock. The formulaused
to determine the baud rate when using the internal
clock is:
(fosc)/((BAUD+
1)"8)
For example if a 12 MHz oscillator is used the baud
rate can vary from:
12,000,000/((0+ 1 )"8)= 1.5
MBPS
to:
12,000,000/((255 +1)"8) = 5.859 KBPS
There are certain requirementsthat the external clcck
will need to meet. Theae requirementsare specifkd in
the data sheet. For a descriptionof the use of the GSC
with external clock please read Section3.5.11.
3.5.5 INITIALIZATION
Initializationcan be broken downinto two major com-
ponents, 1) initialization of the componentso that its
serial port is capableof proper comnmnication;and 2)
initializationof the systemor a station so that intelligi-
ble communicationcan take place.
Most of the initializationof the componenthas already
been discussedin the previoussections.Thoseitemsnot
coveredare the parameters required for the component
to effectively communicate with other components.
These typea of issuesare commonto both systemand
componentinitializationand will be coveredin the fol-
lowingtext.
Initialization of the system can be broken down into
several steps. First, are the assumptionsof each net-
work station.
The tirst assumptionis that the type of data encoding
rmined for the system and that
to be used is prcdete
each station willadhereto the samebasicrules detining
that encoding.The secondassumptionis that the basic
protocol and line discipline is predetermined and
known.This
means
that all
s tations are using CSMA/
CD or SDLC or whatever, and that all stations are
either Ml or half duplez. The third assumptionis that
the baud rate is preset for the wholesystem. Although
the baud rate could probablybe determin ed by the mi-
croprocessorjust by monitoringthe link,it will make it
much simpler if the baud rate is knownin advance.
One of the ftrst things that will be requiredduring sys-
tem initializationis the assignmentof uniqueaddresses
for each station. In a two-stationonlyenvironmentthis
is not necessaryand can be ignored.However,keep in
mind, that all systems should be constructed for easy
future expansions. ' l%erefo%evenin onlya two station
system, addresses should be assigned.There are three
basic ways in which addresses can be assigned. The
tirat, and most common is preassignedaddresaeathat
are loaded into the station by the user. This could be
done with a DIP-switch,through a keybcard.The sec-
ond method of assigningaddressesis to randomly as-
sign an address and then check for its uniqueness
throughout the system, and the third method is to
make an inquiry to the systemfor the assignmentof a
uniqueaddress.Oncethe methodof addreaaassignment
is deterrmn " ed, the method should become part of the
specificationsfor the systemto whichall additionawill
have to adhere. l%is, then, is the final assumption.
The negotiation process may not be clear for some
readers. The followingtwo procedure are given as a
guidelinefor dynamicaddress assignment.
In the fimt procedure,a station assumesa random ad-
dress and then checksfor its uniquenessthroughout the
system. As a station is inidalized into the system it
sends out a message containing its assumed addreaa.
The format of the message should be such that any
station decodingthe address recognizesit as a request
for initialization. If that address is shady used, the
receivingstation returns a mssaage,with its own ad-
dress stating that the addressin questionis already tak-
en. The initiahzingstation then picks another address.
When the initiahzing station sends its inquiry for the
address check, a timer is also started If the timer ex-
pires before the inquiry is respondedto, then that sta-
tion assumesthe address chosenis okay.
7-37

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents