Tektronix 494AP service manual O o o o o o o o o a o o, 100

Models: 494AP 494A

1 336
Download 336 pages 53.32 Kb
Page 292
Image 292

Theory of Operaton - 494[l4g4Ap Service, Vot. 1

Keyboard Check Subroutine.This subroutineis calledwhenthe main scan routinedetects a changein the keyboardmatrixwhichoccurswhen a key opensor closes. A key openingusuallysignifiesthat an action has been completed,whereasa closure indicatesthat an operationor actionis requestedby the user;there- fore, the two are treateddifferentlyby the cpu.

Becausemechanicalkeys tendto bouncewhenthey open or close,the subroutinemust debounceeachkey change.To debounce,the subroutinecalls up the timel subroutine.This sets a numberinto the internaltimer and starts it running. Whenthe timer has timed out, in about a millisecond,the keyboard subroutine again scans the row and comparesthis scan with the scan beforethe debouncecheck. lf the scan does not com_ pare, the routine assumes the key change was a bounceor glitch,and it returnsto the mainscanroutine. lf it does compare,the routinethen recognizesthat a key statehaschanged

The routine then checks to see if this is the first scanthat lookedfor a key changeafter it has outputted previousinformationto the master processor. lf it is the first pass then the routinecausesthe CpU to re_ scanthe full keyboardmatrixto ensurethat th€re is not

aphantomkey closure. lf this is the secondor subse- quentpass and an actualkey changehas occurred,the routinethen notes if the key changewas an openingor closure.

lf the change was an openingthe CpU memoryis updatedto the fact that the key is open. lf a closure has occurred,the routine will then check the column that has the closureand outputa new key addressonto the output stack. This addr€ss consists of the key's row and colsmn location. After outputtingthe address, the subroutinereturnsto scanningthe remainderof the keyboardmatrix.

FrequencyCoder SubroutineCheck. This subrou- tine is called when the main scan routine detects a change in the frequencycoder switch. Like the key- board subroutine,this routinealso debouncesthe fre- quencycoder switch after everychangeto ensurethat the switchcode has changed:lf a real changeis noted, the routineproceedsto determinethe directionof the change.

7-100

The frequencyknob outputsa two-bit code with only one bit at a time changingas the control is rotated. The directionthe knob is rotatedis determinedby the pro- perty of a graycode,generatedby an exclusive-ORlog- ical operationwithin the CPU. The previousstate of one bit is comparedwith the currentstate of the other

bit. Down {counterclockwiserotation)yields unequal inputs, whila up (clockwiserotation) yields the oppo- site. The bit that indicatesdirectionis insertedas the MSB for the frequencycoder byte. This byte is then loaded into the output stack. The subroutinethen returnsto the mainscanroutine.

Output Subroutine. After each scani the CPU checks its output register to see if any information needsto be output. lf it needsto be output,th€ output subroutineis called up; if not, anotherscan is start€d. The outputsubroutinechecksa numberof thingsbefore it outputsany informationto the outputregister. lt first determinesif the CPUis on its firstor initialscanaftera reset. The first scanwill containmorethanoneclosure. All of theseclosuresmustbe outputbeforeit continues. On all scansthat follow,the routinelooksfor morethan one closureby checkingthe numbErof entriesinto the output stack. lf more than one closure has been entered,the output routineaborts.This eliminatesout- puttingphantomkey closures.

The routine is now readyto output information.lt pulls a key addressfrom the outputstackand looksup the code from a look-uptablein RoM. This key codeis loaded into the data port or output buffer. The appropriatepoft P24 or P25 ( pins 35 & 36) is pulled low. The routine continuouslyreads the frequency coder and updatesits memorywhileit is waitingfor the rnasterprocessorto readthe data in the outputbuffer. Once the data has been read, P24 or P25 goes high and the subroutinestartsto checkthe outputstackfor more key closures. When the output stack is empty, the first scan flag is rescindedand the cPU returnsto its mainscanningroutine.

a o o

O

o o o o o o o o o o o a o o

O

o o o o o o o

e

o o o o

O

o o o o o

O

o o o o o o

Page 292
Image 292
Tektronix 494AP service manual O o o o o o o o o a o o, 100