intd.
83C152 HARDWARE DESCRIPTION
3.6 GSCOparation
3.6.1 Determining Line Discipline
In norntai operationthe GSCuses full or half duplex
operation.Whenusinga 32-bitCRC (GMOD.3 = 1),
option can onlYbe hrdf duplex. If using a 16-bit
CRC (GMOD.3 = O),fufl duplexis selectedby de-
fault. When using a Id-bit CRC the receiver can be
turned offwhiletransmitting(RSTAT.1= O),and the
transmitter can be turned off during reception
(TSTAT.1= O).This simulateshalf-duplexoperation
whenusinga id-bit CRC.
Normally,HDLCuses a Id-bit CRC, so half duplexis
deterrnined by turning off the receiver or transmitter.
This is so that the receiverwillnot detect its ownad-
dressas transmissiontakes place.This alsoneedsto be
donewhenusingCSMA/CDwitha 16-bitCRCfor the
samereason.
3.6.2 CPWDMA CONTROL OF THE GSC
The dab
for transmissionor receptioncan be handled
byeitherthe CPU(T3TAT.O= O)or DMAcontroller
(T3TAT.O= 1).This allowsthe user twosets offlags
to control the FIFO. Associatedwith these flags are
interrupts,whichmay be enabledby the user software.
Eitheroneor bdh setsof flagsmaybe usedat the same
time.
In CPUcontroimodethe flags(RFNE,TFN~ are gen-
erated by the wndition of the receiveor transmit FI-
FO’S.After loadinga byte into the transmit FIFO,
there is a one machine cycle latency until the TFNF
flag is updated.Becauseof this latency, the status of
TFNF shouldnot be checked immediatelyfollowing
the instructionto load the transmit FIFO. If usingthe
interrupts to service the transmit FIFO,the one ma-
chinecycieof latencymust be consideredif the TFNF
tlag is checkedprior to leavingthe subroutine.
Whenusingthe CPUfor control,transmissionnormal-
Iy is
initiatedby setting the TEN bit (TSTAT.1)and
themwritingto TFIFO. TEN must be set beforeload-
ingthe transmitFIFO, as settingTEN clearsthe trans-
mit FIFO. TCDCNTshould also be
checked by user
aotlwareand clearedif a collisionoccurred on a prior
transmission.
To enablethe receiver,GREN (RSTAT.1)is set.After
GREN is set, the GSCbeginsto lookfor a validBOF.
After detecting a valid BOF the GSC attempts to
match the receivedaddressbyte(s)againstthe address
match registers.When a match occurs
the frame is
loadedinto the GSC.Due to the CRC strip hardware,
there is a 40 or 24 bit time delayfollowingthe BOF
until the first&ta byte is loadedinto RFIFO if the 32
or 16bit CRCis chosen.If the endofframeisdetected
beforedata isloadedintothe receiveFIFO, the receiver
ignoresthat frame.
If the receiver detects a collisionduring reception in
C3MA/CD mode and if any bytes have been loaded
intothe rrseiveFIFO,the RCABTtlagis set. The GSC
hardware then halts receptionand resets GREN. The
usersoftwareneedsto falteranycollisionfragmentdata
whichmayhavebeenreceived.If the collisionoccurred
prior to the data beingioadedinto RFIFO the CPUis
not notifiedand the receiveris leftenabled.At the end
ofa receptionthe RDN bit is setand GREN is cleared.
In HABEN mode this causesan acknowledgementto
betransmitted if the framedid not have a broadcastor
multi-east address. The user software can enable the
interrupt for RDN to determinewhena frame is com-
pleted.
In DMA mode the interrupts are generatedby the in-
ternal “transmit/receive done” (TDN,RDN) condi-
tions. When the CPU responds to TDN or RDN,
checks are performedto am if the tranamr
“t underrun
error has occurred. The underrun condition is only
checkedwhenusingthe DMA channels.
Upon powerup the CPU modeis initkdized.General
DMA control is cmwredin Section4.0. DMA control
ofthe GSCis coveredinSection3.5.4.If DMA is to ix
usedforaervingtheGSC,it mustbecofilgured intothe
aerial channel demand mode and the DMA bit in
TSTAThas to beset.
3.6.3
COLLISIONS AND BACKOFF
The
actions that are taken by the GSC if a collision
occurs while
transmittingdepend on where the colli-
sion occurs. If a collisionoccurs in CSMA/CD mode
followingthe preambleand BOFflag,the TCDTfig is
set and the transmr
“thardwarecompletesa jam. When
this type of collisionOccurs,there willbe no automatic
retry at transmiaa
ion.After thejam, controlis returned
to the CPU and usersoftwaremust then initiate what-
ever actions are necemaryfor a proper recovery.The
posaibditythat data might have been loaded into or
from the GSC deservesspecialconsideration.If these
fragmentsof a messagehave been passed on to other
devi~ usersoftwaremayhaveto performsomeextem-
sive error handling or notification.Before starting a
new message, the tranmu “t and receive FIFOSwillneed
tobecleared.If DMAservicingis beingusedthe point-
ers must also be reinitiabd. It shouldbe notedthat a
collisionshouldneveroecurafterthe BOFflagin a well
designedsystem,sincethe systemslot time will likely
be leas than the preamblelength. The occurrence of
sucha situationisnormallydueto a stationon the link
that is not adheringto proper CSMA/CD protocolor
isnot usingthe sametimingsas the rest ofthe network.
A cdiaion occurringduringthe preambleor BOFflag
is the normal type of collisionthat is expected.When
this type of collisionoccurs the GSC automatically
handles the retransmissionattempts for as many as
eighttries. If on the eighthattempt a collisionoccurs,
7-42