'************************************************************************************ ' LEGAL RESTRICTIONS ON PROGRAM USE 'This program is fully protected by the provisions of the 'Commonwealth Copyright Act (Australia). Although any form 'of reproduction contravenes the Act, the author is not concerned 'about bona fide electronic hobbyists (and particularly radio 'amateurs) making single copies of it for their own personal 'use. However, commercial organisations should note that no 'significant part of this software can be offered for sale or 'sold, either on its own or as part of an assembly, unless a 'licence to do so has been obtained from myself-James Tregellas, '14 Sheringa Drive, Morphett Vale 5162 June 2005 '************************************************************************************ start: 'CONSTANT SYMBOL DECLARATIONS symbol v50res=50 'This is used for the V50 sensing resistor in calculations '************************************************************************************ '**** Revision information can be found at the end of this file**** '************************************************************************************ '************************************************************************************ 'VK3DPM has added the Component Routines 'and made changes neccessary to implement them. '************************************************************************************ '************************************************************************************ 'ZL2TTM has added the Impedance and Angle Routines 'and made changes neccessary to implement them. 'To make room for the changes several code fragments were turned into subroutines 'and some features like zero suppression were removed. 'The message routines were changed significantly to allow more data to appear on screen 'and to overcome the display flickering associated with the previous implementation. 'Comments were revised for better readability. 'See revision history at the end for more changes that were made '************************************************************************************ ' ' ' Basic PICAXE-28X variable & storage info ' Added by VK3DPM for reference ' bx = byte variables ' wx = integer variables (double byte) and are made up of bx pairs, refer to the ' PICAXE documentation for detail. ' memory locations 80-127 & 192-239 are available for byte storage only by ' using the peek & poke instructions. ' ' w0 = b1 : b0 ' w1 = b3 : b2 ' w2 = b5 : b4 ' w3 = b7 : b6 ' w4 = b9 : b8 ' w5 = b11 : b10 ' w6 = b13 : b12 ' '************************************************************************************ ' HD44780 LCD SETUP ROUTINE '************************************************************************************ ' gosub init 'initialise lcd '************************************************************************************ ' MEASURE BATTERY VOLTS AND DISPLAY VERSION '************************************************************************************ battery: readadc 3,b0 'External resistors are scaled to give a resulting 'count of around 120 for a 12volt battery-16K from +12volt to 'adc input 3 and 3K9 from adc input 3 to ground. w2=b0*100 'adjust the adc count by multiplication and then division so that w2=w2/100 'the display shows the correct voltage - change say division only w3=w2/100 'Derive individual digits for display w4=w2//100 w4=w4/10 w5=w2//10 w3=w3+48 'convert individual digits to ASCII w4=w4+48 w5=w5+48 b1=1 'ASCII characters are formatted,punctuated,and labelled, gosub wrins 'and fed to 16 character X 2 line alphanumeric display- 'display starts at position 1- Display uses industry 'standard Hitachi HD44780 chip. Display format can be 'simply altered to accomodate 2X20,2X40,4X16 displays b0=0 loop10: lookup b0,("BATTERY ",b6,b8,".",b10,"V"),b1 b0=b0+1 gosub wrchr if b0<13 then loop10 b1=192 'VK3DPM setup to display on line 2 gosub wrins 'VK3DPM send it b0=0 'VK3DPM reset character counter loopver: 'VK3DPM new label required here lookup b0,("V3.20"),b1 'VK3DPM bump this version number after every mod 'VK3DPM and add revision info at the end of file b0=b0+1 'VK3DPM increment display counter gosub wrchr 'VK3DPM output character if b0<5 then loopver 'VK3DPM if not finished do it again rem pause 6000 'removed ZL2TTM display battery volts & version for 1.5 seconds & VK3DPM '************************************************************************************ ' VK3DPM - Check at startup if we are in Antenna or Component measurement mode '************************************************************************************ ' At startup if set to quick then put into component mode, once ' switched to slow mode we then remain in Analyser mode Poke 107,0 'VK3DPM initialize mode If pin2=0 Then cont 'VK3DPM we're in analyser mode Poke 107,255 'VK3DPM we're in component mode ' '************************************************************************************ ' MEASURE FREQUENCY and store for later display '************************************************************************************ 'ZL2TTM 'preload atan data into eeprom 'this lot for angles 1 to 45 degrees are 100 times their atan values eeprom 0,(2,3,5,7,9,11,12,14,16,18,19,21,23,25,27,29,31,32,34,36,38,40,42,45,47,49,51,53,55,58,60,62,65,67,70,73,75,78,81,84,87,90,93,97,100) 'ZL2TTM 'this lot for angles 46 to 90 degrees are 10 times their atan values eeprom 45,(10,11,11,12,12,12,13,13,14,14,15,15,16,17,17,18,19,20,21,21,22,24,25,26,27,29,31,33,35,37,40,43,47,51,57,63,71,81,95,114,143,191,255,255,255) main: Peek 107,b0 'VK3DPM read mode If pin2=1 And bit0=1 Then cont 'VK3DPM if true then we are in component mode if pin2=0 and bit0=1 then modechangeclrdisp 'ZL2TTM Poke 107,0 'VK3DPM must now be in Analyser mode goto cont modechangeclrdisp: 'ZL2TTM b1=1 'This will clear the screen after comming from component mode gosub wrins poke 107,0 cont: Poke 80,0 poke 84,0 poke 88,0 poke 103,0 poke 104,0 if pin2=1 And bit0=0 then quick 'VK3DPM if in component mode go slow ' ' count 3,4093,w0 'Frequency counter routine. 5 digit resolution Poke 108,b0 'VK3DPM save LSB freq for component calculations, ZL2TTM and auto calibration Poke 109,b1 'VK3DPM save MSB freq for component calculations, ZL2TTM and auto calibration w2=w0/10000 'Max input frequency is 50KHz on digital input 3 (IC pin14)- w3=w0//10000 'NOTE-careful measurement shows 100KHz published is WRONG. w3=w3/1000 w4=w0//1000 'Routines with w1,w2,w3,w4,w6 recover individual digits from w4=w4/100 'count total w0. Clock rate used is 16MHz. Prescaler divider w5=w0//100 'ratio used to feed input 3 is 1024. w5=w5/10 w6=w0//10 w6=w6+48 poke 96,b12 goto convert2ascii: 'ZL2TTM reuse some code 'These two frequency counting routines produce 5 ASCII 'characters which are formatted,punctuated,labelled, 'and fed to 16 character X 2 line alphanumeric display- 'display starts at position 1- Display uses industry 'standard Hitachi HD44780 chip. Display format can be 'simply altered to accomodate 2X20,2X40,4X16 displays '(loop counter b0,data to display b1,do not use b2) 'display frequency "xx.xxxMHz" at start of display line 1 quick: count 3,409,w0 'Frequency counter routine. 4 digit resolution w0=w0*10 'ZL2TTM Normalize to same save resolution as for slow mode Poke 108,b0 'ZL2TTM save LSB freq for auto calibration, this is a factor of 10 less than slow mode value Poke 109,b1 'ZL2TTM save MSB freq for auto calibration, this is a factor of 10 less than slow mode value w0=w0/10 'ZL2TTM Restore to original value w2=w0/1000 'Comments as for preceding routine w3=w0//1000 w3=w3/100 w4=w0//100 w4=w4/10 w5=w0//10 poke 96,48 convert2ascii: 'This bit used by slow and quick w2=w2+48 w3=w3+48 w4=w4+48 w5=w5+48 poke 92,b4 poke 93,b6 poke 94,b8 poke 95,b10 ' '************************************************************************************ ' CALCULATE RESISTANCE AND REACTANCE '************************************************************************************ rxcalc: '3 voltages are read from test network via ADC 'inputs AN0(ICpin2),AN1(ICpin3)AN2(ICpin4) and 'used to calculate magnitudes of real and 'complex parts of antenna load attached readadc 0,w2 'w2=network input volts (Vin) readadc 1,w3 'w3=voltage proportional to network current (V50) readadc 2,w4 'w4=network output voltage (Vout) rem w2=240 'presetting variables to test R/X/SWR calculations only used when testing rem w3=117 rem w4=117 poke 98,b6 'save V50 for later ' if w2<25 then cactus 'no rf oscillator output to drive network goto rxcontd ' rxcontd: w5=w3+w4 if w5>w2 then square if w5=w2 then square w2=w5 'impossible output from network w2>w3+w4 -modify w2 and treat as pure resistance ' square: w5=w4 'save vout for later w2=w2*w2 'calculate w2 squared-VIN squared w3=w3*w3 'calculate w3 squared-V50 squared w4=w4*w4 'calculate w4 squared-VOUT squared w6=w3+w4 if w220 (approx) if w2<10 and w6>50 then swr2large if w2<20 and w6>100 then swr2large if w2<50 and w6>150 then swr2large if w6>250 then swr2large if w2>500 then swr2large goto printr ' swr2large: poke 88,10 'set flag to print "SWR>10" ' 'inputs w2-ADC output for network input volts (0-255max 240max preferred) ' w3-ADC output for volts across 50 ohm series R (network current) ' w4-ADC output for network output volts (volts across load) 'outputs w2-unknown series load resistance in ohms ' w6-unknown reactance in ohms 'voltage across aerial load resistance is in 97 'voltage across 50 ohm series resistor is in 98 'voltage across aerial load reactance is in 99 ' printr: if w2>500 then r2large w0=w2 'recover individual digits from w2 (resistance) gosub recover3digits 'ZL2TTM seperated this code because it is used several times goto digitsrecovered recover3digits: w1=w0/100 w2=w0//100 w2=w2/10 w3=w0//10 w1=w1+48 'Convert individual digits to ASCII w2=w2+48 w3=w3+48 return digitsrecovered: poke 81,b2 poke 82,b4 poke 83,b6 goto printx r2large: poke 80,10 'set flag to print "R>500 ohms" printx: if w6>500 then x2large w0=w6 'recover individual digits from w6 (reactance) gosub recover3digits poke 85,b2 poke 86,b4 poke 87,b6 goto calcZjcd x2large: poke 84,10 'set flag to print "X>500 ohms" '############################################################################## 'ZL2TTM Z block 'ZL2TTM do the same for Z but if either 80 or 84 flags are set then don't. If either of these are set then R or X are over range '16bit limitations are that sqrt of 65535=255 is the largest value that can be squared also the sum of the 2 squared values 'can not exeed 65535 or math routine will overflow. If to big try scaling the triange down. 'If either R or X are above 255 then start scaling by dividing both by increasing intergers 'Dividing by 2 gives max R250, X250, dividing by 3 gives max R166,X166 which is ok as the sum of their squares fits calcZjcd: peek 80,b0 if b0>0 then calca peek 84,b0 if b0>0 then calca 'now do Z=sqrt(Rsqr+Xsqr) and save digits in 118,119,120 peek 116,b4 'put R into w2 peek 117,b5 peek 114,b6 'put X into w3 peek 115,b7 'scale both values such that their summed squares do not exceed 65535 and save the scaling factor for later in 101 'save a copy of data w4=w2 w5=w3 w6=1 'scaling counter scaleloop1: if w2<=166 and w3<=166 then scaledone w6=w6+1 w2=w4/w6 w3=w5/w6 goto scaleloop1 scaledone: poke 101,b12 'save counter lsb of w6 w2=w2*w2 'sqr w3=w3*w3 'sqr w0=w2+w3 'add squares 'now find sqare root gosub squrt 'ZL2TTM value passed in w0 and returned in w6 printrjcd: 'multiply by scale factor in case scaling was performed peek 101,b3 w3=w6*b3 'Z not saved as it is not needed elsewhere 'no check for Z too large because code not done if R or X >500 w0=w3 'recover individual digits from w5 (resistance) gosub recover3digits poke 118,b2 poke 119,b4 poke 120,b6 'now work out the phase angle, for x = oppopsit/adjacent and x is <=1 use (x/(1+ (0.28*x*x))) * (180/3.14) 'for x is >1 use (90 - ((x/((x*x) + 0.28))) * (180/3.14)) 'numbers will have to be scaled up and down to preserve accuracy 'The above formulas proved difficult to program given the limitations of space 'so the lookup table was implemented ZL2TTM 'divide X by R peek 114,b4 'X in w2 peek 115,b5 peek 116,b6 'R in w3 peek 117,b7 if w2>w3 then aboveone belowone: 'the loopup values are 100 times the atan if w2=0 then anglezero if w3=w2 then angle45 'scale numbers for divide, w3 will be 1 to 500 and w3 will be smaller, scale up 100 w2=w2*100 w4=w2/w3 'w4 that is b8 has tan times 100 which matches the values in eeprom, look for the first match that is bigger, the angle is index+1 'limit to b8 to 99 so lookup doesnt overrun if b8<=99 then continue1 b8=99 continue1: for b0 = 0 to 44 read b0,b1 if b1>=b8 then anglefound1 next b0 aboveone: 'the loopup values are 10 times the atan if w3=0 then angle90 'scale numbers for divide, w2 will be 1 to 500 and w3 will be smaller, scale up 10 w2=w2*10 w4=w2/w3 'w4 that is b8 has tan times 10 which matches the values in eeprom, look for the first match that is bigger, the angle is index+1 'limit to b8 to 254 so lookup doesnt overrun if b8<=254 then continue2 b8=254 continue2: for b0 = 45 to 89 read b0,b1 if b1>=b8 then anglefound1 next b0 angle90: b0=90 goto anglefound2 anglezero: b0=0 goto anglefound2 angle45: b0=45 goto anglefound2 anglefound1: 'b0 has the index,add one to get angle convert to digits and save b0=b0+1 anglefound2: 'got here from angle zero 45 and 90 w0=b0 'just in case b1 has a value gosub recover3digits poke 192,b2 'there will only be 2 significant digits for 0 to 90 poke 193,b4 poke 194,b6 'end of ZL2TTM Z block '############################################################################## '************************************************************************************ ' SWR CALCULATIONS '************************************************************************************ calca: peek 88,b10 if b10>0 then freq peek 97,b4 peek 98,b5 peek 99,b6 w4=b6*b6 w5=b5+b4 w5=w5*w5 w4=w4+w5 'w4= A squared in swr equation squrt1: 'now find sqare root w0=w4 gosub squrt 'ZL2TTM value passed in w0 and returned in w6 calcb: poke 100,b12 'save value of A for later if b4>b5 then calcb1 if b4=b5 then calcb1 w4=b6*b6 w5=b5-b4 w5=w5*w5 w4=w4+w5 goto squrt2 calcb1: w4=b6*b6 w5=b4-b5 w5=w5*w5 w4=w4+w5 'w4=B squared in swr equation squrt2: 'now find sqare root w0=w4 gosub squrt 'ZL2TTM value passed in w0 and returned in w6 swr: peek 100,b4 w3=b4+b12 w3=w3*100 w4=b4-b12 w3=w3/w4 printswr: if w3>999 then swr2large1 w0=w3 'recover individual digits from w5 (resistance) gosub recover3digits poke 89,b2 poke 90,b4 poke 91,b6 goto freq swr2large1: poke 88,10 goto freq ' '************************************************************************************ ' VK3DPM Component Routines ' We don't have floating point so I cheat - OK! ' ' I've grabbed the full freq count but only calculate to 100 Khz resolution. '************************************************************************************ compt: Peek 108,b8 'Get LSB of raw freq Peek 109,b9 'Get MSB of raw freq Peek 114,b12 'w4 = raw freq count, 2Mhz=2000, 32Mhz=32000 Peek 115,b13 'w6 = reactance w4=w4/100 'decrease the freq resolution to improve the division result w5=w6*159/w4 'Calculate L but keep the dividend value as high as possible w5=w5*10 'and re-adjust for the deliberate error w3=63662/w4 'Calculate C but keep the dividend value as high as possible w3=w3*10/w6 'it's really 400000/2*Pi then adjust for the deliberate error w3=w3*10/4 'and again. w3 = C pF, w5 = L nH poke 110,b10 'Store LSB of L poke 111,b11 'Store MSB of L poke 112,b6 'Store LSB of C poke 113,b7 'Store MSB of C '************************************************************************************ ' VK3DPM Message routines revised by ZL2TTM '************************************************************************************ ' Frequency display start of line 1 '************************************************************************************ cfreq: 'ZL2TTM gosub freq2lcd 'use existing freq code '************************************************************************************ ' Reactance display end of line 1 '************************************************************************************ cxwrite: Peek 114,b12 'LSB of reactance to w6 Peek 115,b13 'MSB of reactance to w6 If w6>500 Or w6<5 then rangeout 'rangecheck - leave if we are out of range w0=w6 'recover individual digits from w6 (reactance) w2=w0/100 w3=w0//100 w3=w3/10 w4=w0//10 w2=w2+48 'Convert individual digits to ASCII w3=w3+48 w4=w4+48 b0=0 'Append message "X=xxx ohms" to end of display line 1 cxloop1: lookup b0,(" x",b4,b6,b8),b1 b0=b0+1 gosub wrchr If b0<9 Then cxloop1 '************************************************************************************ ' Inductance display at the start of line 2 - allowing for 5 digits in nH ' Calculated measurement range is approx 25nH to 49000nH '************************************************************************************ b1=192 gosub wrins clwrite: peek 110,b0 'Grab Inductance LSB peek 111,b1 'Grab Inductance LSB gosub cclstrip 'ZL2TTM goto cclstripdone cclstrip: w2=w0/10000 'Strip least significant 4 digits w3=w0//10000 'Grab the remainder w3=w3/1000 'Strip least significant 3 digits w4=w0//1000 'Grab the remainder w4=w4/100 'Strip least significant 2 digits w5=w0//100 'Grab the remainder w5=w5/10 'Strip least significant digit w6=w0//10 'Grab the remainder w2=w2+48 'Convert individual digits to ASCII by adding 48 w3=w3+48 w4=w4+48 w5=w5+48 w6=w6+48 return cclstripdone: b0=0 'display message "xxxxxnH" at start of display line 2 clloop3: 'Simple display loop - grab each character in turn and send to the display lookup b0,(b4,b6,b8,b10,b12,"nH"),b1 b0=b0+1 gosub wrchr if b0<7 Then clloop3 'Continue looping until we're done '************************************************************************************ ' Capacitance display at the end of line 2 - allowing for 5 digits in pF ' although in practice it shouldn't exceed 4 unless the rangecheck is changed ' Calculated measurement range is approx 10pF to 20,000pF or 20nF '************************************************************************************ ccwrite: peek 112,b0 'Grab Capacitance LSB peek 113,b1 'Grab Capacitance MSB gosub cclstrip b0=0 'display message "xxxxxpF" at the end of display line 2 ccloop3: lookup b0,(" ",b4,b6,b8,b10,b12,"pF"),b1 b0=b0+1 gosub wrchr if b0<9 then ccloop3 ' goto main 'Start the whole sequence again ' rangeout: 'If we get here then the reactance value is to far out of range b0=0 'display message "Out of range" loopr: lookup b0,(" Range>>>"),b1 b0=b0+1 gosub wrchr if b0<9 then loopr 'also clear line 2 gosub clrline2 goto main '************************************************************************************ ' End of VK3DPM Component routines '************************************************************************************ ' '************************************************************************************ ' MESSAGE ROUTINES revised by ZL2TTM '************************************************************************************ 'all lines are written in full so that no clear screen is required cactus: b1=1 gosub wrins b0=0 'display message "NO RF" at start of display line 1 loop7: lookup b0,("NO RF"),b1 b0=b0+1 gosub wrchr if b0<5 then loop7 goto main freq: 'ZL2TTM freq writing made into proceedure so it can be called from component mode gosub freq2lcd goto freqdone freq2lcd: b1=128 'display frequency "fxx.xxx" at start of display line 1 gosub wrins peek 92,b4 if b4<>48 then freq1 'VK3DPM check for a leading disp zero b4=32 'VK3DPM simply deposit a space char freq1: 'VK3DPM add a label peek 93,b5 peek 94,b6 peek 95,b7 peek 96,b8 b0=0 peek 107,b10 if pin2=0 or b10>0 then loop0 'VK3DPM check for a trailing disp zero in quick mode but not for component mode b8=32 'VK3DPM simply deposit a space char loop0: lookup b0,("f",b4,b5,".",b6,b7,b8),b1 b0=b0+1 gosub wrchr if b0<7 then loop0 return freqdone: swrwrite: peek 88,b4 peek 89,b5 peek 90,b6 peek 91,b7 if b4>0 then swr10 b0=0 'append message " SWRx.xx" to line 1 loop5: lookup b0,(" swr",b5,".",b6,b7),b1 b0=b0+1 gosub wrchr if b0<9 then loop5 goto rwrite swr10: b0=0 'append message " SWR>>> " to line 1 loop6: lookup b0,(" swr>>> "),b1 b0=b0+1 gosub wrchr if b0<9 then loop6 rwrite: b1=192 gosub wrins peek 80,b11 if b11>0 then rxz2big 'R to large peek 84,b11 if b11>0 then rxz2big 'X to large peek 81,b3 peek 82,b4 peek 83,b5 b0=0 'Write message "rxxx" to start of display line 2 loop1: lookup b0,("r",b3,b4,b5),b1 b0=b0+1 gosub wrchr if b0<4 then loop1 goto xwrite xwrite: peek 85,b3 peek 86,b4 peek 87,b5 b0=0 'append message "jxxx" at next on display line 2 loop3: lookup b0,("j",b3,b4,b5),b1 b0=b0+1 gosub wrchr if b0<4 then loop3 goto zwrite rxz2big: 'write message "r>>>j>>> z>>>a>>" on display line 2 b0=0 loop4: lookup b0,("r>>>j>>> z>>>a>>"),b1 b0=b0+1 gosub wrchr if b0<16 then loop4 goto main zwrite: peek 118,b3 peek 119,b4 peek 120,b5 peek 193,b6 peek 194,b7 b0=0 'append message "zxxxaxx" at next on display line 2 loop11: lookup b0,(" z",b3,b4,b5,"a",b6,b7),b1 b0=b0+1 gosub wrchr if b0<8 then loop11 goto main 'ZL2TTM subroutine to clr line 2 clrline2: b1=192 gosub wrins b0=0 loopclrline2: lookup b0,(" "),b1 b0=b0+1 gosub wrchr if b0<16 then loopclrline2 return '************************************************************************************ ' HD44780 LCD DISPLAY ROUTINES '************************************************************************************ init: 'INITIALISE DISPLAY subroutine pins=0 'clear all output lines b0=0 'reset variable b0 pause 800 'wait 200ms for lcd to reset pins=48 'set to 8 bit operation pulsout 3,4 'send data by pulsing enable line pause 40 'wait 10ms pulsout 3,4 'send data by pulsing enable line pulsout 3,4 'send data by pulsing enable line pins=32 'set to 4 bit operation pulsout 3,4 'send data by pulsing enable line pulsout 3,4 'send data by pulsing enable line pins=128 'set to 2 line operation pulsout 3,4 'send data by pulsing enable line b1=12 'jcd cursor not on b1=14 'screen on, cursor on operation gosub wrins 'write instruction to lcd return 'return to main program wrchr: 'WRITE CHARACTER subroutine pins=b1&240 'mask high nibble of b1 into b2 high 2 'make sure RS is high(character mode) pause 4 pulsout 3,4 'send data by pulsing enable line b2=b1*16 'put low nibble of b1 into b2 pins=b2&240 'mask the high nibble of b2 high 2 'make sure RS is high pause 4 pulsout 3,4 'send data by pulsing enable line return 'return to main program wrins: 'WRITE INSTRUCTION subroutine pins=b1&240 'mask high nibble of b1 into b2 low 2 'make sure RS is low(instruction mode) pause 4 pulsout 3,4 'send data by pulsing enable line b2=b1*16 'put low nibble of b1 into b2 pins=b2&240 'mask the high nibble of b2 low 2 'make sure RS is low pause 4 pulsout 3,4 'send data by pulsing enable line high 2 'back to character mode pause 4 return 'return to main program '************************************************************************************ ' PROGRAM STRUCTURE DATA '************************************************************************************ 'FLAG AND REGISTER USE '80 flag>0 indicates print "R>500 ohms" '81 three digits of Rload in ohms '82 '83 '84 flag>0 indicates print "X>500 ohms" '85 three digits of X in ohms '86 '87 '88 flag>0 indicates print "SWR>10" '89 three digits of SWR '90 '91 '92 five digits of frequency data '93 '94 '95 '96 '97 volts across load resistance '98 V50 '99 volts across load reactance '100 A in SWR calculation '101 Z scaling factor '102 Spare '103 Spare '104 Spare '105 Spare '106 Spare - The following storage is used for component measurement '107 flag >0 indicates component display '108 Raw frequency count LSB - 2MHz is stored as 2000 '109 Raw frequency count USB '110 LSB of L in nH '111 MSB of L in nH '112 LSB of C in pF '113 MSB of C in pF '114 LSB of X in ohms '115 MSB of X in ohms '116 LSB of R in ohms '117 MSB of R in ohms '118 three digits of R in ohms '119 '120 '192 three digits of phase angle '193 '194 '************************************************************************************ ' SOFTWARE TEST RESULTS '************************************************************************************ ' CALCULATED RESULT PROGRAM RESULT Calc. Prog. R,X values all match previous tests 'TEST w2 w3 w4 R X SWR R X SWR Z A Z A swr ' '1 240 120 120 50 0 1.00 50 0 1.00 50 0 50 0 1.00 '2 240 207 33 8 0 6.25 7 0 6.27 8 0 7 0 6.27 '3 240 218 22 5 0 10 5 0 9.90 5 0 5 0 9.90 '4 240 222 18 4 0 12.5 4 0 >10 4 0 4 0 >>> '5 240 240 0 0 0 INF. SHORT CCT LOAD OPN<>SHT '6 240 40 200 250 0 5.00 250 0 5.00 250 0 250 0 5.00 '7 240 22 218 500 0 10.0 495 0 9.90 500 0 495 0 9.90 '8 240 18 222 600 0 12.0 >500 0 >10 600 0 r>>> 0 >>> '9 240 0 240 INF. 0 INF. OPEN CCT LOAD OPN<>SHT '10 240 239 24 0 5 >10 0 5 >10 5 90 5 90 >>> '11 240 170 170 0 50 >10 0 50 >10 50 90 50 90 >>> '12 240 47 235 0 250 >10 1 250 >10 250 90 250 88 >>> '13 240 24 239 0 500 >10 0 497 >10 500 90 495 90 >>> '14 240 20 239 0 600 >10 2 >500 >10 600 90 >>> >> >>> '15 240 119 122 50 10 1.22 50 10 1.24 51 11 51 12 1.24 '16 240 197 56 10 10 5.19 9 10 5.20 14 45 13 47 5.20 '17 240 78 164 100 30 2.23 100 30 2.22 104 17 104 17 2.22 '18 240 114 126 55 5 1.14 55 0 1.10 55 5 55 0 1.10 '19 240 173 126 10 35 7.51 9 34 7.69 36 74 35 75 7.69 '20 240 195 67 10 14 5.40 9 14 5.54 17 54 16 56 5.54 '21 240 130 184 10 70 14.93 10 70 >10 71 82 70 82 >>> '22 240 121 176 20 70 7.67 20 69 7.53 73 74 71 74 7.53 '23 240 103 207 10 100 25.2 9 100 >10 100 84 100 85 >>> '24 240 67 210 50 150 10.9 50 148 >10 158 72 156 71 >>> '25 240 50 232 10 230 111.0 12 231 >10 230 88 230 88 >>> '26 240 44 219 100 230 13.0 98 227 >10 251 67 246 67 >>> '27 240 57 204 100 150 6.83 97 150 6.96 180 56 178 56 6.96 '28 240 36 209 250 150 6.85 243 158 6.96 292 31 288 33 6.96 '29 0 0 0 RF OSCILLATOR KAPUT NO RF '30 240 170 172 0 51 INF. 0 50 >10 51 90 50 90 >>> '31 240 117 117 50 0 1.00 50 0 1.00 50 0 50 0 1.00 'COMMENTS TEST 18 GIVES X=0 AS w2=w3+w4 (NEAREST APPROX INTEGERS) ' TESTS 30 AND 31 ARE FOR IMPOSSIBLE NETWORK OUTPUTS ' i.e. INCORRECTLY ADJUSTED TRIMPOTS '************************************************************************************ ' REVISION INFORMATION '************************************************************************************ '1-Aug-05 VK3DPM-V2.1 Added leading zero blanking for freq display and trailing ' blanking when when counter is in "quick" mode. '1-Aug-05 VK3DPM-V2.1 Added this revision system including the version display. ' '01-Sep-05 VK3DPM-V3.0 Added L & C measurement '18-Mar-06 ZL2TTM-V3.11 Added Z measurement and rationalized some code to make space '19-Mar-06 ZL2TTM-3.12 changed display '20-Mar-06 ZL2TTM-3.13 added phase angle to Z and revised existing code to make more room '21-Mar-06 ZL2TTM-3.14 reorganise mesages so that no sreen refresh needed and annoying screen flicker removed '22-Mar-06 ZL2TTM-3.15 saved more code space, performed tests and added Z and A results to table. '30-Mar-06 ZL2TTM-3.16 Removed open or short message, redundant as looking at Z gives sufficient indication '02-Apr-06 ZL2TTM-3.17 If X>>> or R>>> then both are set as >>> as the result is meaningless anyway. Frees code space '02-Apr-06 ZL2TTM-3.20 Revised comments. '***************************** End of Revision notes ********************************