| The Datasheet Archive - 100 Million Datasheets from 7500 Manufacturers. |
1992 January Revised: 1995 Application note Controlling core
Top Searches for this datasheetAN426 Controlling core meters with 87C751 SA5775 1992 January Revised: 1995 Application note Controlling core meters with 87C751 SA5775 AN426 INTRODUCTION Often, certain classes microcontroller applications surface where large amounts on-chip resources such large program memory space numerous pins required. These applications typically cost sensitive desirable attributes include cost modest on-chip resources such program data memory, I/O, timer-counters. Substantial benefits reduced design cycle time realized using industry-standard architecture having software compatibility with existing popular microcontrollers. SA5775 Serial Gauge Driver SA5775 monolithic driver controlling core meters typically used automotive instrument clusters shown Figure SA5775 receives 10-bit serial word converts that word four voltage outputs that appear SINE+, SINE-, COSINE+, COSINE- outputs. differential voltage SINE outputs applied coil meter COSINE outputs applied other coil meter. currents through these coils produce resultant magnetic force which vector magnetic forces produced each coils. Since currents through coils bidirectional this magnetic vector rotate through full degrees. magnetized disc within core meter will follow rotating vector needle will indicate vector's current position. Since bits used, there 1024 discrete words available resulting angular displacement 0.3516 degrees bit. This small enough provide apparently smooth movement needle. smoothness motion will depend greatly damping factor meter movement. simplified block diagram SA5775 shown Figure This device consists serial-in/parallel-out shift register, data latch, converter, multiplexer, output buffers. logic high must present chip select (CS) input clock data. Data appearing data input (DI) clocked into shift register rising edge clock (CLK) input. data output (DO) overflow from shift register, allowing user daisy chain multiple SA5775 devices. Note that data clocked this falling edge clock. also used latch parallel outputs shift register into data latch. outputs data latch feed inputs converter. converter outputs buffered form drive signals meter coils. converter circuits, multiplexer associated output buffers purposely designed such that span these circuits include power supply rails. This avoid inaccuracies that would otherwise occur output were become very close either supply rail. With supply voltage volts (VIGN), outputs will span range approximately volts. SA5775 designed drive core meters having minimum winding impedance -40°C. clock high time requirements 175ns minimum maximum data rate megabits second. this rate would require approximately 6.4ms ramp from zero full scale binary codes were loaded into SA5775. However, core meter cannot respond such data rates. Both inertia movement damping build into design typical core meter movements limit their response speed. high output enable input (OE) required permit SA5775 drive core gauge. Figure held while microcontroller being reset prevent gauge from being driven. 87C751 Philips 87C751 such microcontroller that easily meets these requirements. This device, shown Figure program memory, bytes RAM, parallel lines, 16-bit autoreload timer-counter. also includes serial interface fixed rate timer. 87C751 based 80C51 core thus uses industry-standard architecture instruction set. device available both (83C751) EPROM (87C751) versions. EPROM version available both erasable packages. References 87C751 this document also apply 83C751, unless explicitly stated. P3.4/A4 P3.3/A3 P3.2/A2/A10 P3.1/A1/A9 P3.0/A0/A8 P0.2/VPP P0.1/SDA/ OE-PGM P0.0/SCL/ ASEL PLASTIC DUAL IN-LINE PACKAGE SHRINK SMALL OUTLINE PACKAGE P3.5/A5 P3.6/A6 P3.7/A7 P1.7/T0/D7 P1.6/INT1/D6 P1.5/INT0/D5 P1.4/D4 P1.3/D3 P1.2/D2 P1.1/D1 P1.0/D0 TYPICAL APPLICATION typical example such application interface between 87C751 Philips SA5775 Serial Gauge Driver, SGD, shown Figure This circuit includes 87C751 microcontroller, SA5775 Serial Gauge Driver, NE555 timer, discrete support components. core meter differs from conventional (d'Arsonval) meter movement that spring return needle predetermined position, zeroing adjustment, permanent magnet classical sense. Instead, consists coils wire wound quadrature with each other around central core which there disc magnetized along diameter. shaft placed through center this disc that shaft rotates with disc. indicating needle attached this shaft will rotate with PLASTIC LEADED CHIP CARRIER Function P3.4/A4 P3.3/A3 P3.2/A2/A10 P3.1/A1/A9 P3.0/A0/A8 P0.2/VPP P0.1/SDA/OE-PGM P0.0//SCLASEL Function P1.0/D0 P1.1/D1 P1.2/D2 P1.3/D3 P1.4/D4 P1.5/INT0/D5 P1.6/INT1/D6 P1.7/T0/D7 P3.7/A7 P3.6/A6 P3.5/A5 CONNECT SU00315 Figure Configuration January 1992 Revision date: 1995 January 1992 +BATT Data SINP COSP COSM SINM SINM SINP SA5775 ACMD 100k 78L05 12MHz Reset 20pF Rate 20pF Int. Data COSH COSP VIGN DGND AGND Clock Controlling core meters with 87C751 SA5775 Figure Interface Between 87C751 Philips SA5775 87C751 P3.4 P3.3 P3.2 P1.3 P1.2 P1.1 P1.0 P3.6 P3.5 Count Count Down Pulse Monitor Program Select Delay Start/ Count P0.1/SDA Ext. NE555 1.6k P0.0/SCL P0.2 P3.1 P3.0 500k Rate Control Ext. Pulse AN426 Application note SU00373A Select Application note Controlling core meters with 87C751 SA5775 AN426 SIN- SIN+ AGND VIGN DATAOUT DATAIN COS+ COS- AGND DGND SCLK executed, SELECT (S2) switch selects incremental step sizes routines, DELAY switch (S4) used delay between successive word transmissions routines. START/COUNT button (S5) used begin execution routine, cause next incremental step Routine COUNT UP/DOWN switch (S6) used Routine determine whether count increased decreased with transmission successive words. bit) masked off, leaving twice value port selected accumulator. Twice read value needed next main program lines that determine which routine execute. Line moves address label JMPTBL (Jump Table) 16-bit Data Pointer (DPTR) register. Line causes program jump address that value accumulator (two times routine number selected) plus DPTR register. Since each commands lines through byte commands, these addresses separated bytes; hence, need accumulator contain number that twice number selected routine. Routine This routine begins line incrementing 10-bit word registers amount indicated setting INCREMENT SELECT switch, then sending that word SA5775. When full scale overflow detected, full scale code (3FF hex) sent out, followed delay then successive output codes sent out, decremented amount indicated INCREMENT SELECT switch. When underflow detected code zero scale sent routine returns beginning program. This routine implemented with series subroutine calls. subroutine begins line starts sending whatever bits that LSBs register (R7) plus bits calling SENDIT subroutine. Then calls subroutine, which increases word value sent out. program then jumps beginning this subroutine, repeating process sending word incrementing next word until overflow from tenth (bit detected line 362. SENDIT subroutine (beginning line 476) brings line high, sets counter (R1) send bits R7), brings value accumulator, rotates accumulator right three times through carry bring LSBs position MSBs, calls SEND1 routine, which sends number bits accumulator, starting with MSB, indicated Counter then send accumulator loaded with contents SEND1 routine again called send final bits, and, line 491, line brought low, loading SA5775 internal parallel latch with contents input shift register. NE555 Timer NE555 timer shown this application example used free running squarewave generator used simulate sensor inputs such those which might found automobile, etc. NE555 timer (U4) operates astable mode produce output frequency that varied from about about Three program routines measure input period produce output code that proportional frequency present (TO) microcontroller. RATE switch (S7) used select between board oscillator external source. program listing included this application note. Program Entry program starts address 030(hex) line program listing. first task write pins each port. Lines clear registers These registers used this program only hold data that sent SGD. registers cleared sure that starting value zero. line program waits until START/COUNT button (S5) depressed before continuing. Lines timer overflow after 10ms. This done setting timer registers count 10,000 microseconds less than full scale. When timer counter overflows timer flag set, timer reloaded with value timer register. examining timer flag know when 10ms expired. Line calls subroutine (Read Port Selected), which reads Port determine which routine been selected. Since PROGRAM SELECT switch (S3) connected port pins P3.2 through P3.4, subroutine (lines through program) first reads Port into accumulator, then complements because switches used complementary binary. reading then rotated right once upper nibble (least significant NOTE: package available large (SOL) package only. SU00374A Figure Packages 87C751 Microcontroller 87C751 microcontroller provides intelligence this application. samples various input ports determine which demonstration programs run, incremental step sizes angular displacement meter core, time delay between increments. demonstration modes, also samples variable frequency input positions meter core response frequency that input. 87C751 also transmits 10-bit serial data SA5775. Data input (DI), Clock (CLK), Chip Select (CS) lines driven from 87C751. Port 87C751 3-bit wide port used communicating data SGD. Data transmitted, first, serial stream clocked into SA5775 rising edge clock. order clock data, SA5775 must high. data input register shifted into latch that drives high transition line. data shifted into SGD, overflows through Data (DO) falling edge clock. With this facility, multiple SGDs daisy-drained with being connected next one, common clock chip select lines used. This simplifies interfacing multiple meter drivers. 78L05 regulator (Q2) provides Volt power board that single supply volts applied board. Three rotary switches used this board. PROGRAM SELECT switch (S3) used select program routine that January 1992 Application note Controlling core meters with 87C751 SA5775 AN426 Logic Shut-Down Logic SU00375 Figure Block Diagram SA5775 SEND1 routine rotates accumulator left through carry bit, moves value carry port PO.1 (SDA-Serial Data pin), waits provide setup time, brings clock low, waits, brings clock high, waits, then decrements counter sends next counter zero. return executed when counter becomes zero. subroutine, beginning line 364, reads delay selected switch port complements (again, because rotary switches complementary binary), masks upper four bits (because delay switch just four positions connected lower four bits port), multiplies (rotates left twice), then moves result zero, program jumps around line calls 10ms delay (subroutine DLY10MS) number times entered into 10ms delay subroutine (starting line 436) sets timer 10ms, waits line timer flag set, clears timer flag, stops timer, returns, this case, line 379, where program decrements repeats 10ms delay until zero. selected delay zero, program jumps from line line reads port determine amount sent word change from value previously sent out. accumulator complemented upper bits masked recover only bits selected increment amount. Since increments January 1992 LSBs hardly noticeable, program then multiplies result (rotate left three times). insure minimum change amount, accumulator increment line 386. This means that increment amounts that selected LSBs. This amount added, lines through 391, word previously send return from this subroutine. After calling subroutine, PR0GO call FULLSC (full scale) subroutine, which sends full scale code 3E8(hex). Although 10-bit full scale code would 3FF(hex), going only allows easy distinction between zero scale full scale when looking display. FULLSC subroutine found line 352. After advancing full scale, there 500ms delay, found line called from line then calls subroutine send decreasing word values. subroutine begins line begins sending current word from line 398, then calling subroutine DOWN, which calculates next (decreasing) word send out. DOWN begins line 402. essentially does same thing subroutine, subtracts INCREMENT SELECT value from previously sent word rather than adding line subroutine ZEROSC called send zero scale code SA5775, then program branches back beginning. Routine This routine selected with PROGRAM SELECT switch position position Routine (PROG1) increments decrements word send out, depending upon setting COUNT UP/COUNT DOWN switch, amount change determined setting SELECT switch, line program examines port P3.6 jumps decrement portion routine low. this high, subroutine called from line increase R7/R6 word value. subroutine previously described. P3.6 low, DOWN subroutine (line 402) decreases previous word sent amount determined from SELECT switch setting. insure enough delay allow user time release START/COUNT button (S5), delay 200ms included line before jumping line where another depression START/COUNT button awaited. (PROGRAM SELECT) still depression will cause jump back line another program selected, program will jump selected routine. Holding down with PROGRAM SELECT position will cause increasing decreasing word values sent SA5775. Application note Controlling core meters with 87C751 SA5775 AN426 Routine PROG2 most complex these routines. purpose this routine cause core meter deflection represent frequency presented timer/counter input microcontroller. This done measuring period input square wave taking inverse period. input here must square wave because slow rise fall time this input will cause fluctuating readings. determine frequency counting pulses time would require much longer time and, therefore, impractical. MEAS (measure) subroutine called line measure period input waveform CALC (calculate) subroutine called line calculate code send SA5775. SENDIT subroutine then called send word SA5775 program jumps back line MEAS subroutine begins line being sure timer running clearing timer (overflow) flag, then entering zero into both high bytes timer timer register. carry then cleared (line timer started timer interrupt enabled. Lines form short loop that waits until either carry until input low. carry when timer gone beyond second. This done timer interrupt subroutine, found lines through input never goes low, know frequency near zero program jumps (line 108) where loaded with (hex) cause CALC subroutine load zero scale into R7/R6. When (and found low, program jumps line waits that input high. Time process same above. that input found high before second time out), timer carry cleared lines through extension timer). lines through wait complete cycle input, with timer/counter measuring that period, then return line where CALC subroutine called. CALC subroutine, starting line 113, begins initializing word send (R7/R6) zero, clearing carry bit, checking indicates time above second, returning line does. Otherwise program continues line where program checks input frequency beyond full scale (timer reading above hex). R7/R6 loaded with (full scale decimal 1,000). This value chosen because sufficiently from zero scale that easily discerned from zero scale display. result full scale zero scale, program continues line with shift subtract divide routine. dividend would 1,000,000 (decimal) convert back frequency Hertz (period measurements microseconds), that would provide maximum count 200Hz, only fifth full scale desired 1,000. made dividend 5,000,000 decimal, hex. This algorithm found lines through works follows: Clear counter. Rotate dividend until first second position. Since code already provides that, shifting necessary. Rotate divisor (the period microseconds this case) left until first second position, first byte LESS THAN first byte dividend. Increment counter each time divisor rotated. Initialize counter zero. Rotate quotient (answer) dividend left. first byte quotient smaller than first byte quotient, jump step quotient subtract divisor from dividend. Decrement counter step zero. Once CALC subroutine completed, program calls SENDIT from line jumps, ultimately, selected routine. Routine PROG3, beginning line 194, measures input period four times, then calculates code display that average these four readings. starts setting counter three readings, taking those three readings storing them memory, beginning address hex, using register index register. line program takes fourth reading, then adds three previous readings lines through 227; divides four (rotates right twice) lines through 239. word send then calculated from line sent SGD, after which program then looks jumps selected routine. Routine PROG4 begins line displays average current last three words sent out. space used first initialized zero reading taken word calculated saved. lines through 284, word added last three readings average calculated stored locations (hex), average word sent out. line 286, program reads program selected jumps line this routine selected, otherwise goes line Routine PROG5 begins line and, very simply, send sequence codes through full scale scale steps, with 500ms between steps. then steps down zero scale scale steps, then returns line Routine PROG6 begins line does same PROG5, steps scale increments. Routine PROG7 loads code scale into R7/R6, sends waits 500ms, changes scale, sends waits 500ms, then repeats this sequence more times (for total times), waits 500ms, then returns output zero scale program jumps line January 1992 Application note Controlling core meters with 87C751 SA5775 AN426 0000 0000 B02E 000B 000B 000C 000E 000F 0030 0030 0033 0036 0039 003B 003D 0040 0043 0046 0048 004B 004C 004E 0050 0052 0054 0056 0058 005A 005C 740F 7580FF 7590FF 75B0FF 7F00 7E00 20B6FD 758BF0 758DD8 51D2 90004C 015C 0168 017A 2145 2186 21D3 21F3 4107 005C 005E 0060 0062 0064 0066 006B 5128 5121 51A5 5152 511B 0130 0068 006B 006D 006F 0071 0073 0076 30B50B 5130 51B5 519D 013D 20B5F2 515A DEMO TT.20 PROCESSOR: 87C751 7-29-89 purpose this program drive version (SA5775) demonstration board. PROGRAM SELECT switch used select from choice four routines. Registers contain 10-bit word that send SA5775. $MOD751 SJMP START ;RESET VECTOR 00BH ;TIMER/COUNTER INTERRUPT ROUTINE ;INCREMENT (3rd BYTE TIMER) A,#0FH ;TEST TIME SUBB A,R3 CARRY RETI ;START PROGRAM START: P0,#0FFH ;SET PORTS HIGH P1,#0FFH P3,#0FFH R7,#0 ;CLEAR WORD SEND R6,#0 P3.6,W ;WAIT START BUTTON DEPRESS READY: RTL,#LOW(0-10000) ;SET TIMER REGISTER RTH,#HIGH(0-10000);FOR 10ms TIME ACALL ;READ PORT PROG SELECT DPTR,#JMPTBL ;JMP ADDRESS DATA POINTER @A+DPTR ;GOTO APPROPRIATE ROUTINE JMPTBL: AJMP PROG0 ;RAMP BACK DOWN AJMP PROG1 ;STEP UP/DOWN start PRESS AJMP PROG2 ;READ DISPLAY SPEED AJMP PROG3 ;DISPLAY AVERAGE READINGS AJMP PROG4 ;DISPLAY AVERAGE LAST READINGS AJMP PROG5 ;ADVANCE FULL SCALE BACK DEGREE STEPS AJMP PROG6 ;ADVANCE FULL SCALE BACK DEGREE STEPS AJMP PROG7 ;ALTERNATE DISPLAY BETWEEN SCALE TIMES PROG0: This routine increases word sent selected step size (INCREMENT SELECT) delay time (DELAY), full scale, waits 500ms, then decreases word sent selected step size delay times until zero scale reached. ACALL ACALL ACALL ACALL ACALL AJMP FULLSC DLY500 ZEROSC START ;SEND INCREASING WORDS ;SET FULL SCALE ;WAIT 500ms ;SEND DECREASING WORDS ;RESET ZERO SCALE BEGINNING PROGRAM PROG1: MANUAL INCREMENT/DECREMENT ROUTINE This routine increases decreases sent word, depending upon setting UP/DOWN switch, amount INCREMENT SELECT switch. There wait 200ms before again looking depression START/COUNT button allow time release this button switch bounce settle. program then looks which routine selected goes that routine. P3.5,DCX COUNT DOWN SELECTED ACALL ;INCREASE WORD DP1: ACALL SENDIT ;SEND WORD ACALL DLY200 ;WAIT 200ms AJMP ;WAIT COUNT BUTTON DEPRESS SELECTED ROUTINE DCX: P3.5,PROG1 COUNT SELECTED ACALL DOWN ;DECREASE WORD January 1992 Application note Controlling core meters with 87C751 SA5775 AN426 0078 80F3 007A 007A 007C 007E 0080 0082 0084 0086 0089 008C 008F 0092 0094 0095 0097 009A 009C 009F 00A1 00A4 00A7 00AA 00AC 00AD 00AF 00B2 00B4 00B7 00B9 00BC 00BD 00BF 00C0 00C2 OOC4 00C5 1182 11C5 51B5 0140 C28C C28D 758B00 758D00 758A00 758C00 7B00 D28C 75A882 4021 2097FB 401C 3097FB 758A00 758C00 7B00 4008 2097FB 4003 3097FB C28C 75A800 7B1F 7F03 7EE8 00C5 00C7 00C9 00CA 00CC 00CD 00CF 00D0 00D2 00D4 00D6 00D8 00D9 00DB 00DD 00E0 00E3 00E6 00E8 00EA 7F00 7E00 740F 5001 E58A 9488 E58C 9413 9400 40E3 752E4C 752F4B 753040 7C00 8B2B 858C2C SJMP PROG2: READ TIME INPUT DISPLAY "SPEED" This routine measures period square wave input sends word that inversely proportional times that period, providing display proportional frequency. ACALL MEAS ;MEASURE INPUT PERIOD ACALL CALC ;CALCULATE WORD SEND ACALL SENDIT ;SEND WORD AJMP READY MEAS: ;HALT TIMER ;CLEAR TIMER FLAG RTL,#0 ;SET TIMER REGISTERS RTH,#0 TL,#0 ;SET TIMER TH,#0 R3,#0 ;CLEAR TIMER BYTE SETB ;START TIMER IE,#82H ;ENABLE TIMER INTERRUPT W20: ;JUMP P1.7,W20 ;WAIT INPUT W21: ;JUMP P1.7,W21 ;WAIT INPUT HIGH TL,#0 ;RESET TIMER TH,#0 R3,#0 ;CLEAR CARRY/BORROW W22: ;JUMP TIME (CARRY SET) P1.7,W22 ;WAIT W23: ;JUMP TIME (CARRY SET) P1.7,W23 ;WAIT HIGH AGAIN ;HALT TIMER IE,#0 ;DISABLE INTERRUPTS GZS: R3,#1FH ;SET ZERO SCALE GFS: R7,#03 R6,#0E8H CALC: This subroutine calculates 10-bit word send function what 10-bit word developed left registers SENDIT subroutine. R7,#0 ;INITIALIZE QUOTIENT R6,#0 ;CLEAR CARRY/BORROW A,#0FH ;CHECK ZERO SCALE SUBB A,R3 ;JUMP ZERO SCALE NZS: A,TL ;CHECK FULL SCALE SUBB A,#88H A,TH SUBB A,#13H A,R3 SUBB A,#0 2EH,#4CH ;SET DIVIDEND 5,000,000 2FH,#4BH 30H,#40H R4,#0 ;CLEAR DIVIDE COUNTER 2BH,R3 ;MOVE READING MEMORY (DIVISOR) 2CH,TH January 1992 Application note Controlling core meters with 87C751 SA5775 AN426 00ED 00F0 00F1 00F3 00F5 00F7 00F9 00FB 00FC 00FE 0100 0101 0103 0105 0106 0108 0109 010B 010C 010D 010E 010F 0110 0111 0112 0113 0115 0116 0118 011A 011B 011D 011F 0120 0122 0123 0125 0127 0129 012A 012B 012C 012E 012F 0130 0132 0134 0136 0138 013A 013C 013E 0140 0142 0144 0145 858A2D E52E 952B 4014 6012 E52D F52D E52C F52C E52B F52B 80E5 E530 F530 E52F F52F E52E F52E 952B 401B 7401 3400 E530 952D F530 E52F 952C F52F E52E 952B F52E DCC7 0145 0147 0149 014B 014C 014D 014E 7903 7820 1182 A68C 2DH,TL ;BRING DIVISOR JUST LESS THAN DIVIDEND A,2EH SUBB A,2BH DIV24 ;JUMP SHIFTING WOULD MAKE DIVISOR DIVIDEND DIV24 ;JUMP DIVISOR DIVIDEND BYTES EQUAL BEFORE SHIFT A,2DH ;SHIFT DIVISOR LEFT 2DH,A A,2CH 2CH,A A,2BH 2BH,A SJMP ROTL DIV24: A,R6 ;ROTATE QUOTIENT LEFT R6,A A,R7 R7,A ;ROTATE DIVIDEND LEFT A,30H 30H,A A,2FH 2FH,A A,2EH 2EH,A ;TEST SUBTRACT MOST SIGNIFICANT BYTES SUBB A,2BH ZERO ;JUMP QUOTIENT BYTE DIVISOR BYTE A,#1 ;ADD QUOTIENT A,R6 R6,A A,R7 ADDC A,#0 R7,A ;SUBTRACT DIVISOR FROM DIVIDEND A,30H SUBB A,2DH 30H,A A,2FH SUBB A,2CH 2FH,A A,2EH SUBB A,2BH 2EH,A ZERO: DJNZ R4,DIV24 PROG3: DISPLAY AVERAGE FOUR READINGS This routine reads period input four times, then displays "speed" corresponding average these four readings. R1,#3 ;SET READINGS R0,#20H ;SET INDEX REGISTER BOTTOM P30: ACALL MEAS ;TAKE READINGS SAVE THEM A,R3 @R0,A @R0,TH ROTL: January 1992 Application note Controlling core meters with 87C751 SA5775 AN426 0150 0151 0153 0154 0156 0158 015A 015C 015E 015F 0161 0162 0164 0165 0167 0168 0169 016A 016B 016C 016E 0170 0171 0172 0173 0174 0176 0177 0179 017B 017C 017E 0180 0182 0184 0186 A68A D9F3 1182 7828 7903 E58A F58A E58C F58C D9EE 7902 E58C F58C E58A F58A D9F0 11C5 51B5 0140 0186 0188 018A 018B 018E 0190 0192 0194 0195 0196 0197 0198 0199 019C 019F 01A1 01A3 01A4 01A5 01A7 01A9 01AA 01AB 01AD 01AE 01B1 01B3 01B4 7827 7600 B81FFA 7820 1182 11C5 752800 752900 7927 E529 F529 E528 F528 B91FF0 7902 E528 P31: P32: DJNZ ACALL ADDC ADDC DJNZ DJNZ ACALL ACALL AJMP @R0,TL R1,P30 MEAS R0,#28H R1,#3 A,TL A,@R0 TL,A A,TH A,@R0 TH,A A,R3 A,@R0 R3,A R1,P31 R1,#2 A,R3 R3,A A,TH TH,A A,TL TL,A R1,P32 CALC SENDIT READY ;TAKE READING, LEAVING R3,TH,TL ;SET INDEX REGISTER ;SET COUNTER FIRST READINGS LAST ;ADD FIRST THREE READINGS LAST ;DIVIDE (ROTATE RIGHT TWICE) AVERAGE ;CALCULATE WORD ;SEND WORD SELECTED ROUTINE PROG4: DISPLAY AVERAGE LAST FOUR WORDS SENT This routine sends average last four readings sent out. R0,#27H @R0,#0 CJNE R0,#1FH,P4 P4A: R0,#20H P40: ACALL MEAS ;MEASURE PERIOD ACALL CALC ;CALCULATE CODE A,R7 ;SAVE CODE @R0,A A,R6 @R0,A 28H,#0 ;INITIALIZE WORD SEND 29H,#0 R1,#27H P41: A,29H ;ADD TOGETHER LAST RESULTS A,@R1 29H,A A,28H ADDC A,@R1 28H,A CJNE R1,#1FH,P41 R1,#2 P42: A,28H January 1992 Application note Controlling core meters with 87C751 SA5775 AN426 01B6 01B7 01B9 01BB 01BC 01BE 01C0 01C2 01C4 01C6 01C8 01CB 01CC 01CF 01D1 F528 E529 F529 D9F3 AF28 AE29 51B5 51D2 B40806 B828C1 80BD 0140 01D3 01D5 01D7 01D9 01DB 01DD 01DE 01E1 01E3 01E5 01E7 01E9 01EB 01EC 01EF 01F1 01F3 7F00 7E7F 51B1 7EFF 51B1 BF04F4 7F03 7EFF 51B1 7E7F 51B1 BFFFF4 511B 013D 01F3 01F5 01F7 01F9 01FA 01FD 01FE 0200 0203 0205 0207 7EFF 7F00 51B1 BF04FA 51B1 BF00FA 511B 013D 0207 0209 020B 020D 020F 0211 0213 0215 0217 0219 7A0A 7E7F 7F01 51AD 7F02 51AD DAF4 51A5 511B 0130 PROG5: This routine advances display degree steps full scale, then steps down zero degree steps. There 500ms delay between steps. R7,#0 R6,#07FH ACALL SD500 ;SEND WORD WAIT 500ms R6,#0FFH ACALL SD500 ;SEND WORD WAIT 500ms CJNE R7,#4,P5 R7,#3 LP5: R6,#0FFH ACALL SD500 ;SEND WORD WAIT 500ms R6,#7FH ACALL SD500 CJNE R7,#0FFH,LP5 ACALL ZEROSC ;RETURN ZERO AJMP ;WAIT PRESS PROG6: This routine advances display degree steps full scale, then steps down zero degree steps. There 500ms delay between steps. R6,#0FFH R7,#0 LP6: ACALL SD500 ;SEND WORD WAIT 500ms CJNE R7,#4,LP6 LP6A: ACALL SD500 ;SEND WORD WAIT 500ms CJNE R7,#0,LP6A ACALL ZEROSC ;RETURN ZERO AJMP ;WAIT PRESS PROG7: This routine alternates between scale times with 300ms delay between steps, then waits 500ms before returning display zero scale. R2,#10 ;SET COUNTER PR7: R6,#07FH R7,#1 ACALL SD300 ;SEND WORD WAIT 300ms R7,#2 ACALL SD300 ;SEND WORD WAIT 300ms DJNZ R2,PR7 TIMES ACALL DLY500 ;WAIT 500ms ACALL ZEROSC ;RESET ZERO SCALE AJMP START ;LOOK VALID PROGRAM DJNZ ACALL ACALL CJNE CJNE SJMP AJMP 28H,A A,29H 29H,A R1,P42 R7,28H R6,29H SENDIT A,#8,N4 R0,#28H,P40 READY ;SEND WORD ;READ PROGRAM SELECT ;JUMP "READY") PROGRAM SELECTED ;GOTO (HEX) January 1992 Application note Controlling core meters with 87C751 SA5775 AN426 021B 021D 021F 0221 0223 0225 0227 0228 7F00 7E00 4125 7F03 7EFF 51B5 0228 022A 022C 022F 0230 51B5 5130 30E2F9 0230 0232 0233 0235 0236 0237 0238 023B 023D 023F 0241 0243 0245 0246 0248 0249 024A 024B 024C 024D 024E 024F 0250 0251 0252 E590 540F B90002 8006 7B01 5195 D9FC E5B0 5403 0252 0254 0256 0258 025A 51B5 515A 50FA 411B 025A 025C 025D 025F 0260 0261 0262 0265 E590 540F B90002 8004 ZEROSC: AJMP FULLSC: RST: ACALL SUBROUTINES R7,#0 R6,#0 R7,#03H R6,#0FFH SENDIT ;RESET METER ZERO SCALE ;SET METER FULL SCALE This subroutine sends increasing 10-bit words registers SGD. ACALL SENDIT ;WRITE 10-BIT WORD ACALL ;INCREASE WORD VALUE ACC.2,SO ;JUMP This subroutine waits period time 10ms DELAY read then increases 10-bit word INCREMENT SELECT amount. A,P1 ;READ DELEY ;COMPLEMENT A,#0FH ;MASK UPPER BITS R1,A CJNE R1,#0,D10 ;JUMP DELAY ZERO SJMP NODLY D10: R3,#1 ;SET 10ms DELAY D10A: ACALL DLY10MS ;DELAY 10MS DELAY DJNZ R1,D10A NODLY: A,P3 ;READ INCREMENT SELECT ;COMPLEMENT A,#3 ;MASK UPPER BITS A,R6 ;ADD INCREMENT R6,A ;SAVE ADDC A,R7 ;ADD CARRY R7,A ;SAVE SOD: This subroutine sends decreasing words rate DELAY step size determined INCREMENT SELECT. ACALL SENDIT ;SEND PRESENT WORD ACALL DOWN ;DECREASE WORD AGAIN CARRY AJMP ZEROSC DOWN: Waits 10ms DELAY setting, then sends decreasing values words step sizes INCREMENT SELECT A,P1 ;READ DELAY ;COMPLEMENT A,#0FH ;MASK UPPER FOUR BITS R1,A ;SAVE DELAY CJNE R1,#0,D10S ;JUMP DELAY ZERO SJMP January 1992 Application note Controlling core meters with 87C751 SA5775 AN426 0267 0269 026B 026D 026E 0270 0271 0272 0273 0274 0275 0276 0277 0278 0279 027A 027B 027D 027E 027F 0280 0281 5195 D9FC E5B0 5403 5403 0281 0284 0287 0289 028B 028E 0290 0292 0294 758AF0 758CD8 C28D D28C 308DFD C28D DBF9 C28C 0295 7B01 0297 80EB 0299 7B0A 029B 80E4 029D 7B14 029F 80E0 02A1 7B1E 02A3 80DC 02A5 7B32 02A7 80D8 02A9 51B5 02AB 80F0 02AD 51B5 02AF 80F0 02B1 51B5 02B3 80F0 02B5 02B5 D282 02B7 7902 02B9 ACALL DLY10MS ;DELAY 10ms (DELAY DJNZ R1,D10S NDD: A,P3 ;READ INCREMENT SELECT ;COMPLEMENT A,#3 ;MASK UPPER BITS ;MULTIPLY ;INSURE MINIMUM STEP ;CLEAR CARRY SUBTRACTION A,R6 SUBB A,R6 ;SUBTRACT INCREMENT FROM A,R6 ;SAVE ;CLEAR ACCUM SUBTRACTION A,R7 SUBB A,R7 ;SUBTRACT BORROW FROM A,#3 ;INSURE MAXIMUM WORD A,R7 ;SAVE DELAY: DELAY DMS10: Produces delay 10ms value Destroys timer readings. TL,#LOW,(0-10000) ;LOAD TIMER 10ms DELAY TH,#HIGH(0-10000) ;CLEAR TIMER FLAG SETB ;START TIMER MS10W: TF,MS10W ;WAIT TIMER FLAG ;CLEAR TIMER FLAG DJNZ R3,MS10W ;WAIT 10ms ;STOP TIMER DLY10MS: R3,#1 ;SET 10ms WAIT SJMP DMS10 ;WAIT 10ms DLY100: R3,#10 ;SET 100ms WAIT SJMP DMS10 ;WAIT 100ms DLY200: R3,#20 ;SET 200ms WAIT SJMP DMS10 ;WAIT 200ms DLY300: R3,#30 ;SET 300ms WAIT SJMP DMS10 ;WAIT 300ms DLY500: R3,#50 ;SET 500ms WAIT SJMP DMS10 ;WAIT 500ms SD200: ACALL SENDIT ;SEND WORD SJMP DLY200 ;WAIT 200ms SD300: ACALL SENDIT ;SEND WORD SJMP DLY300 ;WAIT 200ms SD500: ACALL SENDIT ;SEND WORD SJMP DLY500 ;WAIT 500ms SENDIT: This subroutine sends single word locate4d Accumulator, destroyed. SETB P0.2 ;SET HIGH R1,#02 ;SET COUNTER BITS A,R7 ;MOVE SEND D10S: January 1992 Application note Controlling core meters with 87C751 SA5775 AN426 02BA 02BB 02BC 02BD 02BF 02C1 02C2 02C4 02C6 02C7 51C7 7908 51C7 C282 02C7 02C8 02CA 02CC 02CD 02CF 02D1 02D2 02D4 02D5 02D6 02D8 9281 C280 D280 D9F6 E5B0 540E ACALL ACALL SEND1 R1,#8 A,R6 SEND1 P0.2 ;ALIGN SEND ;SEND UPPER BITS ;SET COUNTER SEND ;MOVE ACCUM ;SEND LOWER BITS ;LOAD SEND1: This subroutine sends [R1] number bits accumulator, starting with over port. Accumulator, destroyed. ;ROTATE CARRY P0.1,C ;MOVE CARRY DATA P0.0 ;CLOCK SETB P0.0 ;CLOCK HIGH DJNZ R1,SEND1 ;SEND NEXT TILL DONE RPS: A,P3 ;READ PORT PROGRAM SELECT ;COMPLEMENT ;ROTATE LSB's MULT A,#0EH ;MASK PROGRAM SELECT ASSEMBLY COMPLETE, ERRORS FOUND January 1992 Application note Controlling core meters with 87C751 SA5775 AN426 CALC D10A D10S DELAY DIV24 DLY100 DLY10MS DLY200 DLY300 DLY500 DMS10 DOWN FULLSC JMPTBL LP6A MEAS MS10W NODLY PROG0 PROG1 PROG2 PROG3 PROG4 PROG5 PROG6 PROG7 READY ROTL SD200 SD300 SD500 SEND1 SENDIT START ZERO ZEROSC ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR ADDR 00E0H 00C5H 023DH 023FH 0267H 0073H 027FH 010BH 0299H 0295H 029DH 02A1H 02A5H 0281H 025AH 006DH 0221H 00C0H 00BDH 00B7H 00A8H 004CH 01E3H 01F7H 01FDH 0082H 028BH 01D1H 026BH 0243H 00D0H 0080H 0090H 00B0H 0149H 015CH 0170H 0188H 0190H 01A1H 01B3H 018EH 01D5H 0209H 005CH 0068H 007AH 0145H 0186H 01D3H 01F3H 0207H 0040H 00F0H 02D2H 0225H 008DH 008BH 02A9H 02ADH 02B1H 02C7H 02B5H 0228H 0252H 0030H 008DH 008CH 008AH 008CH 0230H 003DH 009AH 009FH 00ADH 00B2H 0142H 021BH PREDEFINED USED USED PREDEFINED PREDEFINED PREDEFINED PREDEFINED PREDEFINED PREDEFINED USED PREDEFINED PREDEFINED PREDEFINED PREDEFINED January 1992 Application note Controlling core meters with 87C751 SA5775 AN426 Definitions Short-form specification data short-form specification extracted from full data sheet with same type number title. detailed information relevant data sheet data handbook. Limiting values definition Limiting values given accordance with Absolute Maximum Rating System (IEC 134). Stress above more limiting values cause permanent damage device. These stress ratings only operation device these other conditions above those given Characteristics sections specification implied. Exposure limiting values extended periods affect device reliability. Application information Applications that described herein these products illustrative purposes only. Philips Semiconductors make representation warranty that such applications will suitable specified without further testing modification. Disclaimers Life support These products designed life support appliances, devices systems where malfunction these products reasonably expected result personal injury. Philips Semiconductors customers using selling these products such applications their risk agree fully indemnify Philips Semiconductors damages resulting from such application. Right make changes Philips Semiconductors reserves right make changes, without notice, products, including circuits, standard cells, and/or software, described contained herein order improve design and/or performance. Philips Semiconductors assumes responsibility liability these products, conveys license title under patent, copyright, mask work right these products, makes representations warranties that these products free from patent, copyright, mask work right infringement, unless otherwise specified. Philips Semiconductors East Arques Avenue P.O. 3409 Sunnyvale, California 94088-3409 Telephone 800-234-7381 Copyright Philips Electronics North America Corporation 1998 rights reserved. Printed U.S.A. Date release: 06-98 Document order number: 9397 04067 Other recent searchesSML4728A - SML4728A SML4728A Datasheet SML4764A - SML4764A SML4764A Datasheet PM50CLB060 - PM50CLB060 PM50CLB060 Datasheet HD74HC240 - HD74HC240 HD74HC240 Datasheet CA3081 - CA3081 CA3081 Datasheet CA3082 - CA3082 CA3082 Datasheet AN7835 - AN7835 AN7835 Datasheet 2SD835 - 2SD835 2SD835 Datasheet
Privacy Policy | Disclaimer |