home *** CD-ROM | disk | FTP | other *** search
- 06601030305800
- F0110030
- 9[...................................................]001
- êTheZ8530SCCdriverfortheAtariSTandPCClonesÇ
-
- ByR.E.Janssen,PE1CHL.
-
-
- AdriverhasbeenwrittentosupportanumberofZ8530SCCchips
- connectedtoanAtariSTcomputer.Thedriverisconfigurable
- fordifferenthardwareconfigurations,andanexampleschematic
- supportingupto7SCC's(14channels)hasbeenincluded.
- ThedrivernowalsorunsonPCClones,althoughtheinterrupt
- handlingcapabilitiesofthistypeofcomputerlimitsthemaximum
- speedandnumberofchannelstoalowervaluethanontheAtari.
- (dependingonthespeedofyourmachine)
-
- Eachchannelmaybeindepentlyprogrammedtosupport:
-
- -AnasynchronousSLIPline
- -AnasynchronousinterfacetoaKISSTNC
- -DirectAX.25(HDLC)
-
- Thesoftwarehasbeenwritteninsuchawaythataportto
- anotherenvironmentwhereZ8530SCC'sareavailableshouldbe
- relativelystraightforward.Addressesofthechipsare
- completelyconfigurable,andmostprobablyonlythefirst-level
- interrupthandler(writteninassemblylanguage)hastobe
- adaptedtothespecificconfigurationoftheinterrupt
- acknowledgelogicinthesystem.
- ThePCversionsupportsafewspecialtypesofinterfaceboard,
- thatusespecificIOportstocontrolcertainon-boardfeatures
- likeMODEMsandinterruptconfiguration.
-
- êInitializationandattachmentofthechannelsÇ
-
- Tousethedriver,2stepsmustbeperformed:
-
- 1.Globalinitializationofthedriver
- 2.Attachmentofeachchannel,specifyingmodeandoptions
-
- TheglobalinitializationisneededtoresetallSCCsandto
- installacommoninterrupthandler.Also,thehardwareaddresses
- ofthechipsaredefinedinthisstep.Inthesecondstep,each
- channelissetupfortheintendeduse.
-
-
- ♪≡ê1.InitializationÇ
-
- Initializationisperformedusingthe"attachsccinit"command,
- usingthefollowingsyntax:
-
- attachscc<numberofchips>init<baseaddress>
- <spacingbetweenchips><offsettochannelActrl>
- <offsettochannelBctrl><offsetfromctrltodata>
- <addressofINTACKlatch>|0<interruptnumber>
- p<PCLKfrequency>|r<RTxCfrequency>
- [<specialinterfacetype><interfaceparameter>]
-
- Toinitializeaboardwith2SCCsusingmyschematic,the
- followingcommandwouldbeused:
-
- attach scc 2 init fffd00 8 3 7 -2 fffd3f 3 p4915200
-
- Thisspecifiesinterruptnumber3,anormallyunusedinterruptin
- 520STand1040STmachines.InthenewerMega-STthisinterrupt
- isusedfortheBlitter.Inthiscase,itispossibletousethe
- "ringindicator"inputoftheRS232interfaceasaninterrupt
- source.Ithasinterruptnumber14.
-
- TheINTACKlatch(write,thenreadtogettheinterruptvector)
- islocatedat0xfffd3f.Itisalsopossibletospecify0for
- thisaddress.Inthatcase,INTACKisnotusedandthedriver
- findstheinterruptingchipbypollingeachRR3Aregister.This
- allowsamoresimplehardwaredesign,especiallyforPCs.
-
- Thecrystalclockisspecifiedas4.9152MHz.Otherfrequencies
- canbeused,andthisparametershouldbeadjustedaccordingly.
- TheclockusedforbaudrategenerationisconnectedtoPCLK.It
- wouldalsobepossibletosupplyabaudrateclocktoRTxC,anda
- clockofadifferentfrequencytoPCLK(liketheprocessor
- clock).Thisoptionisselectedbyprefixingtheclockfrequency
- withan"r"insteadofa"p".
-
- The"specialinterfacetype"and"interfaceparameter"fieldscan
- beusedtospecifysomespecialtypeofinterfaceboardtobe
- used.Thisrequiresmodificationtothedriversoftware.
- Currently,thefollowingspecialtypesaresupportedonthePC:
-
- -type1:EAGLE
- -type2:PC-100
- -type4:PRIMUS
- -type8:DRSIPC*Packet
-
- ThePC-100andthePRIMUSacceptaninterfaceparameter,thatis
- usedtocontroltheon-boardMODEM.Itmustbespecifiedasa
- hexadecimalvaluetobesenttotheoutputportontheboard.
- ♪∙ÇPossibleinitialisationcommandsare:
-
- EAGLE:attach scc 1 init 2e8 8 2 0 1 0 2 p36864001
-
- PC-100:attach scc 1 init 2e816 6 4 1 0 2 p4915200222
-
- PRIMUS:attach scc 1 init 2e8 4 2 0 1 0 2 r2457600402
-
- DRSI:attach scc 1 init 300 16 2 0 1 0 2 p49152008
-
- WhenusinganAT-typemachine(withtwo8259interrupt
- controllers),andusingthe"interrupt2"lineontheBUS,
- specifyinterruptnumber9insteadof2.Thisbetterreflects
- theactualconfiguration.TheBIOSwillattempttheredirection
- ofinterruptvector#9to#2,butitdoesnotcompletelydothe
- job.
-
-
- TheSCCdriverusesthe"buffers"featurethatpre-allocatesa
- numberofreceiverbufferstobeusedbythedriversatinterrupt
- time.Besuretoissuea"buffers<n>"commandbeforeyouattach
- anyoftheSCC'schannels(seebelow).The<n>parameterofthe
- bufferscommandspecifiesthenumberofbufferstopre-allocate,
- thisisafunctionofthenumberofchannelsyouwillattach,the
- baudrateofthechannels,theactivityoneachofthesechannels,
- andthetimethecomputercanspendwithoutre-allocatingnew
- buffers.Agoodnumberofreceiverbufferstotryis32.Ifyou
- seeanon-zeronumberinthe"Space"columnintheSCCSTAToutput
- (seebelow)youcanincreasethisnumber.Itspecifiesthe
- numberof128-bytebuffersthatarepre-allocatedforthe
- receiverbuffersofallchannelsattached.Sointhiscase,
- 4Kbytesareallocated.
- Itisalsopossibletosetthesizeofthebufferstobe
- allocated,usingthe2ndand3rdargumentofthe"buffers"
- command.Thesesetaminimalandmaximalsizeofeachbuffer.
- ThePCversionwillonlyallocatebuffersofthemaximumsize
- (andignoresthesecondargument),buttheAtariSTversions
- minimizesthethrashingofthememoryfreelistbyallocating
- buffersbetweentheminimalandmaximalsize,thatcanbecarved
- outofthefreelistwithoutfurthersplittingblocksofmemory.
- Example:buffers6410128
-
- ê2.AttachcommandsÇ
-
- WhentheSCCdriverhasbeeninitialized,youcanattachthe
- channels.Thisisdoneusingoneof3formsofthe"attachscc"
- command:
-
- attachscc<channel>slip<mtu><baudrate>
- attachscc<channel>kiss<mtu><baudrate><callsign>
- attachscc<channel>ax25<mtu><baudrate><callsign>
-
- Thesewillberefferredtoas"slip","kiss"and"ax25"mode.
-
- ÇThe<channel>parameterspecifieswhichhalfofwhichSCCwillbe
- programmed,asfollows:
-
- channel0:"A"sideoffirstSCC
- channel1:"B"sideoffirstSCC
- channel2:"A"sideofsecondSCC
- channel3:"B"sideofsecondSCC
-
- etcetera.Thechannelnumberrangesfrom0to(2*nchips)-1,
- wherenchipsisthenumberofchipsspecifiedinthe
- "attachsccinit"command.
-
-
- ♪⑥êSLIPmodeÇ
-
- Thiscanbeusedforalinktoanothermachine,whenthechannel
- hasanRS232interface.Example:
-
- attachscc0slipsl02569600
-
- ♪⑤Thisattachesthe"A"sideofthefirstSCCasinterface"sl0",
- withanMTUof256andaninitialbaudrateof9600.Thebaudrate
- canbechangedlaterby:
-
- paramsl0<baudrate>
-
- Enteringjust"paramsl0"willdisplaythecurrentbaudrate.
-
- êKISSmodeÇ
-
- KISSmodecanbeusedtotalktoaKISSTNC.Itcanalsobeused
- onanasynchronouslinktoanothercomputerrunningNET.
- ThedifferencewithSLIPisthattheinterfacewillbeAX.25
- type,andcanthereforebeusedforAX.25connections.A
- callsignmustbegivenasaparameter,thiswillbeusedforIP
- andNET/ROMpurposesontheinterface.Example:
-
- attach scc 2 kiss 430 256 4800 pe1chl-7
-
- Intheexamplethe"A"sideofthesecondSCCwillbeattachedas
- interface"430"usinganMTUof256,abaudrateof4800andthe
- callsignPE1CHL-7.
-
- Thecommand"param430<paramnum><decimalvalue>"canbeusedto
- settheparametersoftheKISSTNC.Itisnotpossibleto
- displaythecurrentsettings.
-
-
- êAX.25modeÇ
-
- Thisisprobablythemostinterestingmodetousewiththis
- interface.ItallowsAX.25communicationwithoutaTNC.Onlya
- MODEMisneeded.Example:
-
- Çattach scc 2 ax25 430 256 1200 pe1chl-7
-
- TheparametershavethesamemeaningasinKISSmode.Infact,
- theAX.25modeisemulatinganextendedKISSTNC,sothesame
- commandscanbeusedtosettheparametersoftheinterface(see
- below).
-
- TobeabletorunfullduplexusinganSCCinAX.25mode,an
- externaldividermustbeavailable,thatdividesthebaudrate
- generatorclockavailableontheTRxCpinby32,andputsthe
- resultingsignalontheRTxCpinofthesamechanneloftheSCC.
- SuchadividerisnotnecessaryfornormalCSMApacketradio
- operation,butinterruptoverheadisslightlyreducedifyou
- stillinstallit.Ifyouhaveinstalledthedivider,prefixthe
- baudratewithaletter"d",asin:
-
- attach scc 2 ax25 430 256 d1200 pe1chl-7
-
- NotethatwhenusingtheRTxCinputasthebaudrategenerator
- clocksource,youwillhavetofeedtheexactrateofthe
- transmittertoTRxCtobeabletousefullduplex.Forthis
- reason,itisbettertousePCLKastheclocksourcewhenever
- possible.
- TheDRSIPC*PacketadapterusestheZ8536CIOontheboardasa
- divider,soyoucan(andshould)specifythe"d"optionforthat
- board.
-
- Anotheroptionistouseexternalclocking,suppliedbythe
- MODEM.Thisisspecifiedusingthekeyword"ext",asin:
-
- attach scc 2 ax25 430 256 ext pe1chl-7
-
- ThereceiveclockwillbetakenfromtheRTxCpin,thetransmit
- clockfromtheTRxCpin.Watchthephaserelationshipbetween
- theclockandthedata!
-
- ThesettingofparametersoftheemulatedKISSTNCisdoneinthe
- samewayasintheKISSmodeoftheSCCdriver:
-
- param430<paramnum><decimalvalue>
-
- InAX.25modehowever,itisalsopossibletodisplaythe
- currentsettingsusing"param430".Thiswilldisplayaline
- like:speed=1200div=ygroup=0001=362=503=304=35=06=07=50
- 8=79=310=30.
-
- The"clocktick"unitmentionedinthedescriptionsbelowdepends
- onthecomputertype.OntheAtariST,eachclocktickis10ms.
- OnthePCClones,aclocktickisusually55ms,buttheactual
- valueisprintedduringexecutionofthe"attachsccinit".
- Considerthattheexacttimeofeachdelaymaybeupto1
- clockticktimelessthanthespecifiedtime.Itistherefore
- unwisetospecifyavaluelessthan2foradelay(exceptwhen
- thespecialcase0isselected).
- Ç
- Theparametershavethefollowingmeaning:
-
- 1:Thedelay(inunitsofclocktick)afterkeyingofthe
- transmitter,untilthefirstbyteissent.Thisisusually
- called"TXDELAY"inaTNC.When0isspecified,thedriver
- willjustwaituntiltheCTSsignalisasserted.This
- assumesthepresenceofatimerorothercircuitryinthe
- MODEMand/ortransmitter,thatassertsCTSwhenthetrans⑨
- mitterisreadyfordata.
- Thedefaultvalueofthisparameteris360ms.
-
- 2:Thisistheprobabilitythatthetransmitterwillbekeyed
- whenthechannelisfoundtobefree.Itisavaluefrom0
- to255,andtheprobabilityis(value+1)/256.Thevalue
- shouldbesomewherenear20-60,andshouldbeloweredwhen
- thechannelisusedmoreheavily.
- Thedefaultvalueis25(10%persistence).
-
- ♪⑤3:Thisisthetimebetweensamplesofthechannel.Itis
- expressedinunitsofclocktick.About100-300msseemsto
- beagoodvalue.
- Thisparametershouldneverbe0.Thechannelwillnot
- transmitwhen0isused!
- Thedefaultvalueis160ms.
-
- ♪⑦4:Thetimethetransmitterwillremainkeyedafterthelast
- byteofapackethasbeentransferredtotheSCC.Thisis
- necessarybecausetheCRCandaflagstillhavetoleavethe
- SCCbeforethetransmitteriskeyeddown.Thevaluedepends
- onthebaudrateselected.Afewcharactertimesshouldbe
- sufficient,e.g.30msat1200baud.
- Thevalueofthisparameterisinclocktickunits,the
- defaultis30ms(oratleast2clockticks).
-
- ♪5:Thefull-duplexmodeswitch.Thiscanbeoneofthefolowing
- values:
- 0:TheinterfacewilloperateinCSMAmode(thenormal
- half-duplexpacketradiooperation)
- 1:Fullduplexmode,i.e.thetransmitterwillbekeyedat
- anytime,withoutcheckingthereceivedcarrier.It
- willbeunkeyedwhentherearenopacketstobesent.
- 2:Like1,butthetransmitterwillremainkeyed,also
- whentherearenopacketstobesent.Flagswillbe
- sentinthatcase,untilatimeout(parameter10)
- occurs.
- Thedefaultvalueis0,CSMAoperation.
-
- 6:ControloftheDTRoutputoftheSCC.DTRwillbesetwhen
- thisvalueisnonzero,itwillberesetwhenthevalueis0.
- AfterinitializationDTRwillbesetbydefault.TheDTR
- outputcanbeusedasageneral-purposeoutput,e.g.to
- changebetween2transceiverfrequenciesoroutputpower
- levels.
- ÇThedefaultvalueofthisparameteris1,DTRSET.
-
- 7:Theinitialwaittimebeforeanytransmitattempt,afterthe
- framehasbeenqueuedfortransmit.Thisisthelengthof
- thefirstslotinCSMAmode.Infullduplexmodesitcanbe
- setto1formaximumperformance,ortoahighervalueto
- giveNETachancetocombineseveralpacketsinasingle
- transmission.
- Thevalueofthisparameterisinclocktickunits.Itshould
- neverbesetto0.(Thechannelwillnottransmitinthat
- case)
- Thedefaultvalueis500ms.
-
- 8:Themaximaltimethetransmitterwillbekeyedtosend
- packets,inseconds.ThiscanbeusefulonbusyCSMA
- channels,toavoid"gettingabadreputation"whenyouare
- generatingalotoftraffic.Afterthespecifiedtimehas
- elapsed,nonewframewillbestarted.Instead,thetrans⑨
- mitterwillbeswitchedoffforaspecifiedtime(parameter
- 9),andthentheselectedalgorithmforkeyupwillbe
- startedagain.
- Thevalue0willdisablethisfeature,andallowinfinite
- transmissiontime.
- Thedefaultvalueis7seconds.
-
- 9:Thisisthetimethetransmitterwillbeswitchedoffwhen
- themaximumtransmissiontimeisexceeded.Thisparameter
- isinseconds,andshouldneverbe0.
- Thedefaultvalueis3seconds.
-
- ♪!10:InCSMAmode,thisparameterspecifiesthemaximumtimethe
- transmitterwillwaitforthechanneltobecomeclear,
- expressedinunitsofonesecond.Whenthistimehas
- elapsedwithoutanopportunitytotransmit,thetransmitter
- willbekeyed.Thisisasafeguardagainstsituationswhere
- thesquelchrefusestoclose,oraweakcarrierispresent
- onthefrequency,topreventanindefinitepileupofframes
- totransmit(withapossibledangerofmemoryoverflow).Of
- course,thevalueshouldbesetsufficientlyhightoprevent
- accidentalkeyupsinperiodsofhighchannelload,e.g.60
- seconds.Thereisacompile-timeoptioninthedriverto
- throwawayframesinthiscase.
- Infullduplex2mode,thisparameterspecifiesthemaximum
- idletime,inseconds.Whennoframeshavebeensentfor
- thistime,thetransmitterwillbekeyeddown.Avalueof0
- willdisablethisfeature,i.e.thetransmitterwillbe
- keyedindefinitely.
- Thedefaultvalueofthisparameteris120seconds.
-
-
- ♪∙êTransmitterGroupsÇ
-
- Itispossibletobuildspecialradioequipmenttousemorethan
- onefrequencyonthesameband,e.g.usingseveralreceiversand
- onlyonetransmitterthatcanbeswitchedbetweenfrequencies.
- Also,youcanconnectseveralradiosthatareactiveonthesame
- band.Inthesecases,itisnotpossible,ornotagoodidea,to
- transmitonmorethanonefrequency.TheSCCdriverprovidesa
- methodtolocktransmittersondifferentinterfaces,usingthe
- "param<interface>group<x>"command.Thiswillonlyworkwhen
- youareusingCSMAmode(parameter#5=0).
- Thenumber<x>mustbe0ifyouwantnogrouprestrictions,and
- canbecomputedasfollowstocreaterestrictedgroups:
- <x>isthesumofsomeHEXnumbers:
-
- 200Thistransmitterwillonlybekeyedwhenallother
- transmittersinthegroupareoff.
- 100Thistransmitterwillonlybekeyedwhenthecarrier
- detectofallotherinterfacesinthegroupisoff.
- 0xxAbytethatcanbeusedtodefinedifferentgroups.
- Interfacesareinthesamegroup,whenthelogicalAND
- betweentheirxxvaluesisnonzero.
-
- Examples:
- When2interfacesusegroup=201,theirtransmitterswillneverbe
- keyedatthesametime.
- When2interfacesusegroup=101,thetransmitterswillonlykey
- whenbothchannelsareclearatthesametime.Whengroup=301,
- thetransmitterswillnotbekeyedatthesametime,andonlyif
- bothchannelsareclear.
-
-
- ♪⑤êSCCSTATcommandÇ
-
- OncetheSCCdriverhasbeeninitialized,somestatistic
- informationcanbeshownusingthesccstatcommand.Theoutputof
- thiscommandshowsonelineofinformationperattachedchannel.
-
- ♪⑤Example:
-
- ChIfaceSentRcvdErrorSpaceOverrRxintsTxintsExintsSpints
- 01448815220000100134488905235
- 143067000019152900
-
- ♪⑥Theinfoshownis:
-
- -channelnumberoftheattachcommand
- -nameoftheinterface
- -numberofframesqueuedfortransmission
- -numberofframesreceivedcorrectly
- -numberofreceiveerrors(CRC,ABORT)
- -numberoftimesthereceiverbufferpoolwasfoundempty
- -numberofreceiveroverrunsandtransmitterunderruns
- -numberofreceiverinterrupts
- Ç-numberoftransmitterinterrupts
- -numberofreceiverspecialconditioninterrupts
- -numberofexternal/statusinterrupts
-
- ItisnormalthataSLIPorKISSchannelshowsnoerrors,andno
- specialconditionorexternal/statusinterrupts,whileanAX25
- channelhaslotsofthese.
-
- Anoverrunisabnormalforalloperatingmodes.Iflotsofthese
- occur,theproductofbaudrateandnumberofinterfacesistoo
- highfortheprocessingpowerofyourcomputer.
-
- If"Space"errorsoccur,specifyahighernumberofbuffersin
- the"buffers"command.Itis,however,normaliftheseerrors
- occurwhenyoustartashell,orwhenyoupausetheoutputofany
- commandusingCTRL-S.Thisisbecausetheprocessingand
- allocationofbuffersstopsinthesecases,whilereceiverinput
- keepscominginunderinterruptcontrol.
-
- Whenyouseeonlytransmittedframes,thenumberoftransmitter
- interruptsis1,andallothercountersare0,theSCCisnot
- generatinginterruptstothecomputer.Thesingletransmitter
- interruptisa"simulated"interruptthatshouldstartthe
- transmission(butapparentlydoesn't).
-
-