TransistorTester.elf: Dateiformat elf32-avr Sektionen: Idx Name Größe VMA LMA Datei-Off Ausr. 0 .data 00000000 00800100 00007434 000074e8 2**0 CONTENTS, ALLOC, LOAD, DATA 1 .text 00007434 00000000 00000000 000000b4 2**1 CONTENTS, ALLOC, LOAD, READONLY, CODE 2 .bss 000000b9 00800100 00800100 000074e8 2**0 ALLOC 3 .eeprom 0000000f 00810000 00810000 000074e8 2**0 CONTENTS, ALLOC, LOAD, READONLY, DATA 4 .stab 00000dec 00000000 00000000 000074f8 2**2 CONTENTS, READONLY, DEBUGGING 5 .stabstr 000001d4 00000000 00000000 000082e4 2**0 CONTENTS, READONLY, DEBUGGING 6 .comment 00000011 00000000 00000000 000084b8 2**0 CONTENTS, READONLY 7 .debug_aranges 00000480 00000000 00000000 000084d0 2**3 CONTENTS, READONLY, DEBUGGING 8 .debug_info 0000af5b 00000000 00000000 00008950 2**0 CONTENTS, READONLY, DEBUGGING 9 .debug_abbrev 00002424 00000000 00000000 000138ab 2**0 CONTENTS, READONLY, DEBUGGING 10 .debug_line 00002974 00000000 00000000 00015ccf 2**0 CONTENTS, READONLY, DEBUGGING 11 .debug_frame 00000ae4 00000000 00000000 00018644 2**2 CONTENTS, READONLY, DEBUGGING 12 .debug_str 00001488 00000000 00000000 00019128 2**0 CONTENTS, READONLY, DEBUGGING 13 .debug_loc 00005984 00000000 00000000 0001a5b0 2**0 CONTENTS, READONLY, DEBUGGING 14 .debug_ranges 00000048 00000000 00000000 0001ff34 2**0 CONTENTS, READONLY, DEBUGGING Disassembly of section .text: 00000000 <__vectors>: 0: 0c 94 31 08 jmp 0x1062 ; 0x1062 <__ctors_end> 4: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 8: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> c: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 10: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 14: 0c 94 b3 28 jmp 0x5166 ; 0x5166 <__vector_5> 18: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 1c: 0c 94 bd 0f jmp 0x1f7a ; 0x1f7a <__vector_7> 20: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 24: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 28: 0c 94 cd 20 jmp 0x419a ; 0x419a <__vector_10> 2c: 0c 94 a5 28 jmp 0x514a ; 0x514a <__vector_11> 30: 0c 94 97 28 jmp 0x512e ; 0x512e <__vector_12> 34: 0c 94 a7 20 jmp 0x414e ; 0x414e <__vector_13> 38: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 3c: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 40: 0c 94 71 28 jmp 0x50e2 ; 0x50e2 <__vector_16> 44: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 48: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 4c: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 50: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 54: 0c 94 be 0f jmp 0x1f7c ; 0x1f7c <__vector_21> 58: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 5c: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 60: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 64: 0c 94 43 08 jmp 0x1086 ; 0x1086 <__bad_interrupt> 68: 66 0a sbc r6, r22 6a: 68 0a sbc r6, r24 6c: 6d 0a sbc r6, r29 6e: 78 0a sbc r7, r24 70: 76 0a sbc r7, r22 72: 72 0a sbc r7, r18 74: 72 0a sbc r7, r18 76: 74 0a sbc r7, r20 00000078 : 78: be 00 b7 00 b0 00 ...... 0000007e : 7e: 10 08 40 7e 01 01 3e 01 01 3e 01 01 3e 01 01 7e ..@~..>..>..>..~ 8e: 40 40 @@ 00000090 : 90: 18 00 07 20 08 08 08 f8 00 00 00 20 60 a0 3f a0 ... ....... `.?. a0: 60 20 02 02 02 ff 02 02 02 10 10 10 1f 00 00 00 ` .............. 000000b0 : b0: 05 08 42 81 89 89 76 ..B...v 000000b7 : b7: 05 08 c2 a1 91 89 86 ....... 000000be : be: 05 08 00 04 02 ff 00 ....... 000000c5 : c5: 10 10 05 08 f8 78 38 58 88 .....x8X. 000000ce : ce: 09 10 03 08 1c 3e 7f .....>. 000000d5 : d5: 0d 08 07 10 ff 81 81 81 f1 e1 c1 ff 40 40 40 47 ............@@@G e5: 43 41 CA 000000e7 : e7: 0d 08 01 10 ff ff ...... 000000ed : ed: 11 08 03 10 f1 e1 c1 47 43 41 .......GCA 000000f7 : f7: 0e 00 08 20 21 21 12 20 60 e0 e0 e0 fe fe 04 02 ... !!. `....... 107: 01 00 01 03 7f 7f 21 c2 c4 c4 c0 40 94 84 00 07 ......!....@.... 117: 03 01 02 04 .... 0000011b : 11b: 0e 08 02 10 fe fe 7f 7f 00 00 00 00 ............ 00000127 : 127: 11 00 05 20 20 60 e0 e0 e0 02 01 00 01 03 c2 c4 ... `.......... 137: c4 c0 40 07 03 01 02 04 ..@..... 0000013f : 13f: 52 45 46 5f 52 3d 00 REF_R=. 00000146 : 146: 52 45 46 5f 43 3d 00 REF_C=. 0000014d : 14d: 20 3e 31 30 30 6e 46 00 >100nF. 00000155 : 155: 70 6e 05 6d 00 6b 4d pn.m.kM 0000015c : 15c: 01 04 10 09 0a 0c ...... 00000162 : 162: 00 11 11 11 13 1d 10 10 ........ 0000016a : 16a: 00 00 0e 11 11 0a 1b 00 ........ 00000172 : 172: 04 1f 11 11 11 11 1f 04 ........ 0000017a : 17a: 00 1e 02 03 02 1e 00 00 ........ 00000182 : 182: 00 0f 08 18 08 0f 00 00 ........ 0000018a : 18a: 11 13 17 1f 17 13 11 00 ........ 00000192 : 192: 11 19 1d 1f 1d 19 11 00 ........ 0000019a : 19a: 1b 1b 1b 1b 1b 1b 1b 00 ........ 000001a2 : 1a2: 52 44 53 3d 00 RDS=. 000001a7 : 1a7: 5b 43 5d 00 [C]. 000001ab : 1ab: 31 08 03 08 33 20 00 1...3 . 000001b2 : 1b2: 5b 52 4c 5d 00 [RL]. 000001b7 : 1b7: 31 08 07 06 08 09 0a 08 33 20 00 1.......3 . 000001c2 : 1c2: 43 2b 45 53 52 40 54 50 31 3a 33 00 C+ESR@TP1:3. 000001ce : 1ce: 66 40 54 50 32 00 f@TP2. 000001d4 : 1d4: 20 35 30 48 7a 00 50Hz. 000001da : 1da: 43 30 20 00 C0 . 000001de : 1de: 52 69 5f 4c 6f 3d 00 Ri_Lo=. 000001e5 : 1e5: 52 69 5f 48 69 3d 00 Ri_Hi=. 000001ec : 1ec: 52 30 3d 00 R0=. 000001f0 : 1f0: 52 48 2f 52 4c 00 RH/RL. 000001f6 : 1f6: 2b 52 48 2d 20 31 32 20 31 33 20 32 33 00 +RH- 12 13 23. 00000204 : 204: 2b 52 4c 2d 20 31 32 20 31 33 20 32 33 00 +RL- 12 13 23. 00000212 : 212: 52 48 2b 00 RH+. 00000216 : 216: 52 48 2d 00 RH-. 0000021a : 21a: 52 48 66 3d 00 RHf=. 0000021f : 21f: 52 65 66 3d 00 Ref=. 00000224 : 224: 49 43 45 73 3d 00 ICEs=. 0000022a : 22a: 49 43 45 30 3d 00 ICE0=. 00000230 : 230: 56 65 72 73 69 6f 6e 20 31 2e 31 32 6b 00 Version 1.12k. 0000023e : 23e: 08 09 0a 08 00 ..... 00000243 : 243: 08 07 06 08 00 ..... 00000248 : 248: 2a 01 20 20 00 *. . 0000024d : 24d: 08 02 08 00 .... 00000251 : 251: 08 01 08 00 .... 00000255 : 255: 4e 6f 74 20 63 61 6c 69 62 72 61 74 65 64 21 20 Not calibrated! 265: 46 6f 72 ff 63 61 6c 69 62 72 61 74 69 6f 6e 20 For.calibration 275: 63 6c 61 6d 70 20 74 68 65 20 33 ff 70 69 6e 73 clamp the 3.pins 285: 20 74 6f 67 65 74 68 65 72 20 61 6e 64 20 73 74 together and st 295: 61 72 74 20 77 69 74 68 20 74 68 65 ff 6b 65 79 art with the.key 2a5: 2e 20 41 63 6b 6e 6f 77 6c 65 64 67 65 20 74 68 . Acknowledge th 2b5: 65 20 73 65 6c 66 2d 74 65 73 74 20 77 69 74 68 e self-test with 2c5: 20 74 68 65 20 6b 65 79 20 77 69 74 68 69 6e ff the key within. 2d5: 32 73 2e 20 44 69 73 63 6f 6e 6e 65 63 74 20 70 2s. Disconnect p 2e5: 69 6e 73 20 61 66 74 65 72 20 74 68 65 ff 6d 65 ins after the.me 2f5: 73 73 61 67 65 20 22 69 73 6f 6c 61 74 65 ff 50 ssage "isolate.P 305: 72 6f 62 65 21 22 20 69 73 20 73 68 6f 77 6e 2e robe!" is shown. 315: 20 53 6f 66 74 77 61 72 65 20 61 6e 64 20 64 6f Software and do 325: 63 75 6d 65 6e 74 61 74 69 6f 6e 20 69 73 20 61 cumentation is a 335: 74 20 73 76 6e 3a 2f 2f 20 6d 69 6b 72 6f 63 6f t svn:// mikroco 345: 6e 74 72 6f 6c 6c 65 72 2e 20 6e 65 74 2f 74 72 ntroller. net/tr 355: 61 6e 73 69 73 74 6f 72 20 74 65 73 74 65 72 20 ansistor tester ... 00000366 : 366: 49 72 3d 00 Ir=. 0000036a : 36a: 4c 3d 00 L=. 0000036d : 36d: 20 56 6c 6f 73 73 3d 00 Vloss=. 00000375 : 375: 20 45 53 52 3d 00 ESR=. 0000037b : 37b: 56 43 43 3d 00 VCC=. 00000380 : 380: 43 65 6c 6c 21 00 Cell!. 00000386 : 386: 08 03 08 00 .... 0000038a : 38a: 40 56 67 3d 00 @Vg=. 0000038f : 38f: 20 56 74 3d 00 Vt=. 00000394 : 394: 55 66 3d 00 Uf=. 00000398 : 398: 55 62 65 3d 00 Ube=. 0000039d : 39d: 20 31 32 33 3d 00 123=. 000003a3 : 3a3: 42 4a 54 2d 50 4e 50 00 BJT-PNP. 000003ab : 3ab: 42 4a 54 2d 4e 50 4e 00 BJT-NPN. 000003b3 : 3b3: 43 3d 00 C=. 000003b6 : 3b6: 43 67 3d 00 Cg=. 000003ba : 3ba: 68 46 45 3d 00 hFE=. 000003bf : 3bf: 2d 49 47 42 54 00 -IGBT. 000003c5 : 3c5: 4a 46 45 54 00 JFET. 000003ca : 3ca: 2d 4d 4f 53 00 -MOS. 000003cf : 3cf: 44 43 20 50 77 72 20 4d 6f 64 65 00 DC Pwr Mode. 000003db : 3db: 4f 4b 00 OK. 000003de : 3de: 42 61 74 2e 20 00 Bat. . 000003e4 : 3e4: 43 6f 6e 74 72 61 73 74 00 Contrast. 000003ed : 3ed: 73 68 6f 72 74 20 50 72 6f 62 65 73 21 00 short Probes!. 000003fb : 3fb: 53 65 6c 66 74 65 73 74 00 Selftest. 00000404 : 404: 74 75 72 6e 21 00 turn!. 0000040a : 40a: 72 6f 74 61 72 79 20 65 6e 63 6f 64 65 72 00 rotary encoder. 00000419 : 419: 31 30 2d 62 69 74 20 50 57 4d 00 10-bit PWM. 00000424 : 424: 66 2d 47 65 6e 65 72 61 74 6f 72 00 f-Generator. 00000430 : 430: 53 77 69 74 63 68 20 6f 66 66 00 Switch off. 0000043b : 43b: 53 68 6f 77 20 64 61 74 61 00 Show data. 00000445 : 445: 56 6f 6c 74 61 67 65 00 Voltage. 0000044d : 44d: 46 72 65 71 75 65 6e 63 79 00 Frequency. 00000457 : 457: 54 72 61 6e 73 69 73 74 6f 72 00 Transistor. 00000462 : 462: 53 65 6c 65 63 74 69 6f 6e 3a 00 Selection:. 0000046d : 46d: 54 65 73 74 20 45 6e 64 00 Test End. 00000476 : 476: 69 73 6f 6c 61 74 65 20 50 72 6f 62 65 73 21 00 isolate Probes!. 00000486 : 486: 53 65 6c 66 74 65 73 74 20 6d 6f 64 65 2e 2e 00 Selftest mode... 00000496 : 496: 54 69 6d 65 6f 75 74 21 00 Timeout!. 0000049f : 49f: 6f 72 20 64 61 6d 61 67 65 64 20 00 or damaged . 000004ab : 4ab: 4e 6f 2c 20 75 6e 6b 6e 6f 77 6e 2c 20 6f 72 00 No, unknown, or. 000004bb : 4bb: 20 75 6e 6b 6e 6f 77 6e 00 unknown. 000004c4 : 4c4: 54 68 79 72 69 73 74 2e 00 Thyrist.. 000004cd : 4cd: 54 72 69 61 63 00 Triac. 000004d3 : 4d3: 70 61 72 74 00 part. 000004d8 : 4d8: 64 61 6d 61 67 65 64 20 00 damaged . 000004e1 : 4e1: 65 6d 70 74 79 21 00 empty!. 000004e8 : 4e8: 77 65 61 6b 00 weak. 000004ed : 4ed: 54 65 73 74 69 6e 67 2e 2e 2e 00 Testing.... 000004f8 : 4f8: ba 03 87 03 58 03 2e 03 07 03 e4 02 c3 02 a4 02 ....X........... 508: 88 02 .. 0000050a : 50a: 00 00 14 00 29 00 3e 00 53 00 69 00 80 00 97 00 ....).>.S.i..... 51a: ae 00 c6 00 df 00 f8 00 12 01 2d 01 49 01 65 01 ..........-.I.e. 52a: 82 01 a0 01 be 01 de 01 ff 01 21 02 44 02 68 02 ..........!.D.h. 53a: 8e 02 b5 02 de 02 09 03 35 03 64 03 94 03 c8 03 ........5.d..... 54a: fe 03 37 04 73 04 b4 04 f9 04 43 05 93 05 ea 05 ..7.s.....C..... 55a: 49 06 b3 06 29 07 ae 07 48 08 ff 08 de 09 I...)...H..... 00000568 : 568: af 57 b9 50 c2 4a 97 45 11 41 13 3d 87 39 5a 36 .W.P.J.E.A.=.9Z6 578: 7e 33 e8 30 8e 2e 69 2c 71 2a a1 28 f5 26 69 25 ~3.0..i,q*.(.&i% 588: f9 23 a2 22 62 21 37 20 1e 1f 16 1e 1e 1d 34 1c .#."b!7 ......4. 598: 57 1b 85 1a bf 19 03 19 50 18 a6 17 04 17 6a 16 W.......P.....j. 5a8: d6 15 49 15 c2 14 41 14 c5 13 4e 13 dc 12 6e 12 ..I...A...N...n. 5b8: 05 12 9f 11 3d 11 df 10 84 10 ....=..... 000005c2 : ... 5d2: 1e 21 21 21 12 00 80 7f 00 00 00 7e 4a 4a 4a 34 .!!!.......~JJJ4 5e2: 00 00 00 00 00 00 fc 40 20 10 08 04 02 01 00 00 .......@ ....... 5f2: 00 01 01 01 01 01 01 01 01 01 01 01 01 01 7f 04 ................ 602: 88 d0 e0 f0 f8 00 00 00 00 00 00 00 00 00 00 00 ................ 612: 00 00 00 00 00 00 00 fc 94 94 84 00 00 01 02 fc ................ ... 62e: 1e 21 21 21 12 e0 c0 80 40 20 10 0f 00 00 00 c0 .!!!....@ ...... 63e: 20 20 20 40 00 00 00 fc 00 00 9e 9e 04 03 03 03 @............ 64e: 03 02 00 00 00 20 20 23 24 25 25 23 20 20 20 3f ..... #$%%# ? 65e: 00 00 7b 7b 21 42 84 04 80 c0 00 00 00 00 00 00 ..{{!B.......... ... 676: fc 94 94 84 00 04 06 07 07 07 08 f0 00 00 00 00 ................ ... 68e: 00 80 3f 21 21 12 0c 00 00 00 00 ff 00 00 00 f0 ..?!!........... 69e: 08 48 48 c8 00 00 fe 00 00 e7 81 81 81 c1 e1 f1 .HH............. 6ae: 81 81 81 01 00 20 20 20 21 21 21 20 20 20 3f 00 ..... !!! ?. 6be: 00 f3 40 40 40 41 43 47 40 40 7f c0 00 00 00 00 ..@@@ACG@@...... ... 6d6: 00 00 48 94 94 94 64 00 00 00 00 ff 00 00 00 00 ..H...d......... ... 6f2: 3f 21 21 12 0c 00 00 ff 00 00 00 f0 08 48 48 d0 ?!!..........HH. 702: 00 00 00 00 00 00 fe fe 04 04 04 04 04 04 04 07 ................ 712: 00 08 08 08 09 09 09 08 08 7f 3e 1c 08 08 7f 7f ..........>..... 722: 20 20 20 20 20 20 20 e0 00 00 00 00 00 00 00 00 ......... ... 73a: 48 94 94 94 64 00 00 ff 00 00 00 00 00 00 00 00 H...d........... 74a: 00 00 00 ff 00 3c 0a 09 0a 3c 00 22 31 29 29 26 .....<...<."1))& 75a: 00 00 82 86 8e 9e be fe fe be de ef f6 fa fe fe ................ 76a: fa f2 e2 c2 82 00 00 00 08 08 08 04 02 79 84 a4 .............y.. 77a: a4 68 00 ff 00 00 00 00 00 00 00 00 00 00 00 00 .h.............. ... 792: 00 00 00 ff 00 00 f0 28 24 28 f0 00 10 08 fc 00 .......($(...... ... 7aa: 00 00 00 3c 0a 09 0a 3c 00 ff 00 00 00 00 00 00 ...<...<........ ... 7c6: 04 0c 1c 3c 7c ff 7c 3c 1c 0c 04 00 00 00 00 00 ...<|.|<........ 7d6: 00 9e a1 a9 a9 9a 80 43 23 13 0b 07 03 ff 03 03 .......C#....... 7e6: 03 03 03 03 00 00 00 00 00 00 00 00 00 00 00 78 ...............x 7f6: 84 84 84 48 00 ff 00 00 00 00 00 00 00 00 00 f0 ...H............ 806: 08 04 e2 11 09 09 09 09 09 09 09 09 09 11 21 c2 ..............!. 816: 04 08 10 e0 00 00 00 01 02 04 04 07 00 00 00 00 ................ 826: 00 80 40 20 10 88 44 23 10 08 04 03 00 00 00 00 ..@ ..D#........ 836: 00 00 00 00 00 00 00 fe 01 00 fc 02 01 00 00 00 ................ ... 852: 00 00 00 79 49 49 79 00 00 00 00 00 00 00 00 00 ...yIIy......... 00000862 : 862: 40 f0 10 10 10 10 f0 40 00 01 01 01 01 01 01 00 @......@........ 872: 40 fc f8 f0 e0 40 fc 40 00 07 03 01 00 00 07 00 @....@.@........ 882: 40 fc 40 e0 f0 f8 fc 40 00 07 00 00 01 03 07 00 @.@....@........ 892: 40 fc fc 00 00 fc fc 40 00 07 07 00 00 07 07 00 @......@........ 8a2: 78 84 82 02 82 84 78 00 06 04 07 00 07 04 06 00 x.....x......... 8b2: 00 fc 00 00 00 f0 10 00 10 0f 02 04 02 07 04 00 ................ 8c2: 08 08 08 08 08 08 f8 40 02 02 02 02 02 02 03 00 .......@........ 8d2: 40 f8 08 08 08 08 08 08 00 03 02 02 02 02 02 02 @............... 8e2: 40 40 40 40 40 40 40 40 00 00 00 00 00 00 00 00 @@@@@@@@........ 8f2: c0 00 00 80 00 00 80 00 01 02 02 01 02 02 01 02 ................ 902: 00 80 00 00 80 00 00 c0 02 01 02 02 01 02 02 01 ................ ... 962: 00 00 f8 04 02 fe 02 00 0c 06 05 04 04 07 0c 00 ................ 972: 02 fe 02 00 02 fe 02 00 04 07 04 04 04 17 0c 00 ................ 982: 02 fe 02 f0 02 fe 02 00 04 07 04 07 04 17 0c 00 ................ 992: 00 00 e0 10 08 f8 08 00 0c 06 05 04 04 07 0c 00 ................ 9a2: 80 40 28 f8 28 40 80 00 01 02 14 1f 14 02 01 00 .@(.(@.......... 9b2: 08 f8 08 00 08 f8 08 00 04 07 04 04 04 17 0c 00 ................ 9c2: 08 f8 08 c0 08 f8 08 00 04 07 04 07 04 17 0c 00 ................ 9d2: 00 10 18 fc fc 18 10 00 00 01 01 01 01 01 01 00 ................ 9e2: 00 10 18 fc 18 10 00 00 00 00 00 01 00 00 00 00 ................ 9f2: 00 00 00 fc 00 00 00 00 00 01 01 01 01 01 00 00 ................ a02: 40 40 40 40 50 e0 40 00 00 00 00 00 01 00 00 00 @@@@P.@......... a12: 20 70 a8 20 20 20 20 00 00 00 00 00 00 00 00 00 p. ......... a22: e0 00 00 00 00 00 00 00 01 01 01 01 01 01 01 00 ................ a32: 20 70 a8 20 20 a8 70 20 00 00 00 00 00 00 00 00 p. .p ........ a42: 00 c0 f0 fc f0 c0 00 00 00 00 00 00 00 00 00 00 ................ a52: 0c 3c fc fc fc 3c 0c 00 00 00 00 00 00 00 00 00 .<...<.......... ... a72: 00 00 00 fe 00 00 00 00 00 00 00 0d 00 00 00 00 ................ a82: 00 16 0e 00 00 16 0e 00 00 00 00 00 00 00 00 00 ................ a92: 00 10 fc 10 10 fc 10 00 00 01 07 01 01 07 01 00 ................ aa2: 00 18 24 fe 44 88 00 00 00 03 04 0f 04 03 00 00 ..$.D........... ab2: 0c 12 92 4c 20 10 08 00 02 01 00 06 09 09 06 00 ...L ........... ac2: 8c 52 22 52 8c 40 c0 00 01 02 04 04 04 01 02 00 .R"R.@.......... ad2: 00 00 00 16 0e 00 00 00 00 00 00 00 00 00 00 00 ................ ae2: 00 00 f0 08 04 02 00 00 00 00 01 02 04 08 00 00 ................ af2: 00 00 02 04 08 f0 00 00 00 00 08 04 02 01 00 00 ................ b02: 48 50 e0 fc e0 50 48 00 02 01 00 07 00 01 02 00 HP...PH......... b12: 40 40 40 f8 40 40 40 00 00 00 00 03 00 00 00 00 @@@.@@@......... ... b2a: 00 00 00 16 0e 00 00 00 40 40 40 40 40 40 40 00 ........@@@@@@@. ... b4a: 00 00 00 06 06 00 00 00 00 00 80 40 20 10 08 00 ...........@ ... b5a: 02 01 00 00 00 00 00 00 f8 04 02 02 02 04 f8 00 ................ b6a: 01 02 04 04 04 02 01 00 00 08 04 fe 02 00 00 00 ................ b7a: 00 04 04 07 04 04 00 00 08 04 02 82 42 24 18 00 ............B$.. b8a: 04 06 05 04 04 04 06 00 06 02 02 02 12 2a c6 00 .............*.. b9a: 01 02 04 04 04 02 01 00 c0 a0 9e 80 80 fc 80 00 ................ baa: 00 00 00 00 04 07 04 00 3e 12 0a 0a 0a 12 e6 00 ........>....... bba: 01 02 04 04 04 02 01 00 f8 44 22 12 12 24 c0 00 .........D"..$.. bca: 01 02 04 04 04 02 01 00 0e 02 c2 62 32 1a 0e 00 ...........b2... bda: 00 00 07 00 00 00 00 00 88 54 22 22 22 54 88 00 .........T"""T.. bea: 01 02 04 04 04 02 01 00 38 44 82 82 42 24 f8 00 ........8D..B$.. bfa: 00 02 04 04 04 02 01 00 00 00 00 18 18 00 00 00 ................ c0a: 00 00 00 06 06 00 00 00 00 00 00 18 18 00 00 00 ................ c1a: 00 00 00 16 0e 00 00 00 00 40 a0 10 08 04 02 00 .........@...... c2a: 00 00 00 01 02 04 08 00 00 20 20 20 20 20 20 00 ......... . c3a: 00 01 01 01 01 01 01 00 00 02 04 08 10 a0 40 00 ..............@. c4a: 00 08 04 02 01 00 00 00 18 04 02 82 42 24 18 00 ............B$.. c5a: 00 00 00 0d 00 00 00 00 f8 04 d2 52 e2 04 f8 00 ...........R.... c6a: 01 02 05 05 04 05 04 02 00 f0 08 04 02 fe 02 00 ................ c7a: 04 07 05 01 05 07 04 00 02 fe 22 22 22 54 88 00 .........."""T.. c8a: 04 07 04 04 04 02 01 00 f8 04 02 02 02 04 8e 00 ................ c9a: 01 02 04 04 04 02 01 00 02 fe 02 02 02 04 f8 00 ................ caa: 04 07 04 04 04 02 01 00 02 fe 22 22 72 02 0e 00 ..........""r... cba: 04 07 04 04 04 04 07 00 02 fe 22 22 72 02 0e 00 ..........""r... cca: 04 07 04 04 00 00 00 00 f8 04 02 c2 42 44 de 00 ............BD.. cda: 01 02 04 04 02 01 07 00 02 fe 22 20 22 fe 02 00 .........." "... cea: 04 07 04 00 04 07 04 00 00 02 02 fe 02 02 00 00 ................ cfa: 00 04 04 07 04 04 00 00 00 00 00 02 02 fe 02 00 ................ d0a: 00 03 04 04 04 03 00 00 02 fe 62 90 08 04 02 00 ..........b..... d1a: 04 07 04 00 01 06 04 00 02 fe 02 00 00 00 00 00 ................ d2a: 04 07 04 04 04 04 07 00 02 fe 38 e0 38 fe 02 00 ..........8.8... d3a: 04 07 04 00 04 07 04 00 02 fe 1a 60 82 fe 02 00 ...........`.... d4a: 04 07 04 00 05 07 04 00 f8 04 02 02 02 04 f8 00 ................ d5a: 01 02 04 04 04 02 01 00 02 fe 42 42 42 24 18 00 ..........BBB$.. d6a: 04 07 04 00 00 00 00 00 f8 04 02 02 82 04 f8 00 ................ d7a: 01 02 04 04 04 05 02 04 02 fe 42 c2 42 24 18 00 ..........B.B$.. d8a: 04 07 04 00 01 06 04 00 88 14 22 22 22 44 8e 00 .........."""D.. d9a: 01 02 04 04 04 02 01 00 0e 02 02 fe 02 02 0e 00 ................ daa: 00 04 04 07 04 04 00 00 02 fe 02 00 02 fe 02 00 ................ dba: 00 03 04 04 04 03 00 00 02 fe 82 00 82 fe 02 00 ................ dca: 00 00 03 06 03 00 00 00 02 fe 02 f0 02 fe 02 00 ................ dda: 00 01 07 03 07 01 00 00 02 de 72 20 72 de 02 00 ..........r r... dea: 04 07 04 00 04 07 04 00 02 7e c2 80 c2 7e 02 00 .........~...~.. dfa: 00 00 04 07 04 00 00 00 0e 82 42 22 12 0a 06 00 ..........B".... e0a: 07 04 04 04 04 04 07 00 00 fe 02 02 02 00 00 00 ................ e1a: 00 07 04 04 04 00 00 00 08 10 20 40 80 00 00 00 .......... @.... e2a: 00 00 00 00 00 01 02 00 00 00 02 02 02 fe 00 00 ................ e3a: 00 00 04 04 04 07 00 00 10 08 04 02 04 08 10 00 ................ ... e5a: 08 08 08 08 08 08 08 00 00 00 00 0e 16 00 00 00 ................ ... e72: 90 48 28 28 48 90 e0 00 01 02 04 04 04 02 07 00 .H((H........... e82: 02 fe 10 08 08 10 e0 00 04 07 02 04 04 02 01 00 ................ e92: e0 10 08 08 08 10 38 00 01 02 04 04 04 02 01 00 ......8......... ea2: e0 10 08 08 10 fe 02 00 01 02 04 04 02 07 04 00 ................ eb2: e0 50 48 48 48 50 60 00 01 02 04 04 04 02 01 00 .PHHHP`......... ec2: 20 f8 24 22 02 0c 00 00 04 07 04 04 00 00 00 00 .$"............ ed2: e0 10 08 08 10 f8 08 00 00 09 12 12 09 07 00 00 ................ ee2: 02 fe 10 08 08 f0 00 00 04 07 04 00 04 07 04 00 ................ ef2: 00 10 16 f6 00 00 00 00 00 04 04 07 04 04 00 00 ................ f02: 00 00 10 16 16 f0 00 00 00 0c 10 10 10 0f 00 00 ................ f12: 02 fe c0 20 10 08 18 00 04 07 04 01 02 04 04 00 ... ............ f22: 00 00 02 02 fe 00 00 00 00 00 04 04 07 04 04 00 ................ f32: 08 f8 08 f0 08 f0 00 00 04 07 00 07 00 07 04 00 ................ f42: 08 f8 20 10 08 f0 00 00 04 07 04 00 04 07 04 00 .. ............. f52: e0 10 08 08 08 10 e0 00 01 02 04 04 04 02 01 00 ................ f62: 08 f8 10 08 08 10 e0 00 10 1f 12 04 04 02 01 00 ................ f72: e0 10 08 08 10 f8 08 00 01 02 04 04 12 1f 10 00 ................ f82: 08 f8 20 10 08 08 30 00 04 07 04 00 00 00 00 00 .. ...0......... f92: 10 28 48 48 48 90 38 00 01 02 04 04 04 02 01 00 .(HHH.8......... fa2: 08 08 fe 08 08 00 00 00 00 00 03 04 04 04 02 00 ................ fb2: 08 f8 08 00 08 f8 08 00 00 03 04 04 02 07 04 00 ................ fc2: 08 f8 88 00 88 f8 08 00 00 00 03 06 03 00 00 00 ................ fd2: 08 f8 08 c0 08 f8 08 00 00 03 06 03 06 03 00 00 ................ fe2: 08 b8 e0 40 e0 b8 08 00 04 07 00 00 00 07 04 00 ...@............ ff2: 08 f8 08 00 08 f8 08 00 00 09 12 12 11 0f 00 00 ................ 1002: 18 08 88 48 28 18 08 00 06 05 04 04 04 04 06 00 ...H(........... 1012: 40 b0 1c 02 02 00 00 00 00 01 07 08 08 00 00 00 @............... 1022: 00 00 00 fe 00 00 00 00 00 00 00 1f 00 00 00 00 ................ 1032: 00 00 02 02 1c b0 40 00 00 00 08 08 07 01 00 00 ......@......... 1042: 0c 02 02 04 08 08 04 02 00 00 00 00 00 00 00 00 ................ 1052: c0 20 10 08 10 20 c0 00 01 01 01 01 01 01 01 00 . ... .......... 00001062 <__ctors_end>: 1062: 11 24 eor r1, r1 1064: 1f be out 0x3f, r1 ; 63 1066: cf ef ldi r28, 0xFF ; 255 1068: d8 e0 ldi r29, 0x08 ; 8 106a: de bf out 0x3e, r29 ; 62 106c: cd bf out 0x3d, r28 ; 61 0000106e <__do_clear_bss>: 106e: 11 e0 ldi r17, 0x01 ; 1 1070: a0 e0 ldi r26, 0x00 ; 0 1072: b1 e0 ldi r27, 0x01 ; 1 1074: 01 c0 rjmp .+2 ; 0x1078 <.do_clear_bss_start> 00001076 <.do_clear_bss_loop>: 1076: 1d 92 st X+, r1 00001078 <.do_clear_bss_start>: 1078: a9 3b cpi r26, 0xB9 ; 185 107a: b1 07 cpc r27, r17 107c: e1 f7 brne .-8 ; 0x1076 <.do_clear_bss_loop> 107e: 0e 94 cd 31 call 0x639a ; 0x639a
1082: 0c 94 18 3a jmp 0x7430 ; 0x7430 <_exit> 00001086 <__bad_interrupt>: 1086: 0c 94 00 00 jmp 0 ; 0x0 <__vectors> 0000108a <_lcd_hw_write>: #if (LCD_INTERFACE_MODE == MODE_SPI) ;--------------------------------------------------------------------------------- ; serial output for ST7565 controller, 4-Bit SPI _lcd_hw_write: ; Set RS (0=Cmd, 1=Char) sbrc preg_1, 0 108a: 80 fd sbrc r24, 0 set_rs_high 108c: 59 9a sbi 0x0b, 1 ; 11 sbrs preg_1, 0 108e: 80 ff sbrs r24, 0 set_rs_low 1090: 59 98 cbi 0x0b, 1 ; 11 set_rs_output; //init hardware 1092: 51 9a sbi 0x0a, 1 ; 10 set_b0_output ; wait for address setup, set B0 to output 1094: 53 9a sbi 0x0a, 3 ; 10 ; Send bit-7 set_en_low 1096: 5a 98 cbi 0x0b, 2 ; 11 sbrc preg_2, 7 1098: 67 fd sbrc r22, 7 set_b0_high 109a: 5b 9a sbi 0x0b, 3 ; 11 sbrs preg_2, 7 109c: 67 ff sbrs r22, 7 set_b0_low 109e: 5b 98 cbi 0x0b, 3 ; 11 set_en_high ; force data read from LCD controller 10a0: 5a 9a sbi 0x0b, 2 ; 11 ; Send bit-6 set_en_low 10a2: 5a 98 cbi 0x0b, 2 ; 11 sbrc preg_2, 6 10a4: 66 fd sbrc r22, 6 set_b0_high 10a6: 5b 9a sbi 0x0b, 3 ; 11 sbrs preg_2, 6 10a8: 66 ff sbrs r22, 6 set_b0_low 10aa: 5b 98 cbi 0x0b, 3 ; 11 set_en_high ; force data read from LCD controller 10ac: 5a 9a sbi 0x0b, 2 ; 11 ; Send bit-5 set_en_low 10ae: 5a 98 cbi 0x0b, 2 ; 11 sbrc preg_2, 5 10b0: 65 fd sbrc r22, 5 set_b0_high 10b2: 5b 9a sbi 0x0b, 3 ; 11 sbrs preg_2, 5 10b4: 65 ff sbrs r22, 5 set_b0_low 10b6: 5b 98 cbi 0x0b, 3 ; 11 set_en_high ; force data read from LCD controller 10b8: 5a 9a sbi 0x0b, 2 ; 11 ; Send bit-4 set_en_low 10ba: 5a 98 cbi 0x0b, 2 ; 11 sbrc preg_2, 4 10bc: 64 fd sbrc r22, 4 set_b0_high 10be: 5b 9a sbi 0x0b, 3 ; 11 sbrs preg_2, 4 10c0: 64 ff sbrs r22, 4 set_b0_low 10c2: 5b 98 cbi 0x0b, 3 ; 11 set_en_high ; force data read from LCD controller 10c4: 5a 9a sbi 0x0b, 2 ; 11 ; Send bit-3 set_en_low 10c6: 5a 98 cbi 0x0b, 2 ; 11 sbrc preg_2, 3 10c8: 63 fd sbrc r22, 3 set_b0_high 10ca: 5b 9a sbi 0x0b, 3 ; 11 sbrs preg_2, 3 10cc: 63 ff sbrs r22, 3 set_b0_low 10ce: 5b 98 cbi 0x0b, 3 ; 11 set_en_high ; force data read from LCD controller 10d0: 5a 9a sbi 0x0b, 2 ; 11 ; Send bit-2 set_en_low 10d2: 5a 98 cbi 0x0b, 2 ; 11 sbrc preg_2, 2 10d4: 62 fd sbrc r22, 2 set_b0_high 10d6: 5b 9a sbi 0x0b, 3 ; 11 sbrs preg_2, 2 10d8: 62 ff sbrs r22, 2 set_b0_low 10da: 5b 98 cbi 0x0b, 3 ; 11 set_en_high ; force data read from LCD controller 10dc: 5a 9a sbi 0x0b, 2 ; 11 ; Send bit-1 set_en_low 10de: 5a 98 cbi 0x0b, 2 ; 11 sbrc preg_2, 1 10e0: 61 fd sbrc r22, 1 set_b0_high 10e2: 5b 9a sbi 0x0b, 3 ; 11 sbrs preg_2, 1 10e4: 61 ff sbrs r22, 1 set_b0_low 10e6: 5b 98 cbi 0x0b, 3 ; 11 set_en_high ; force data read from LCD controller 10e8: 5a 9a sbi 0x0b, 2 ; 11 ; Send bit-0 set_en_low 10ea: 5a 98 cbi 0x0b, 2 ; 11 sbrc preg_2, 0 10ec: 60 fd sbrc r22, 0 set_b0_high 10ee: 5b 9a sbi 0x0b, 3 ; 11 sbrs preg_2, 0 10f0: 60 ff sbrs r22, 0 set_b0_low 10f2: 5b 98 cbi 0x0b, 3 ; 11 set_en_high ; force data read from LCD controller 10f4: 5a 9a sbi 0x0b, 2 ; 11 ret 10f6: 08 95 ret 000010f8 : #endif /* ******************************************************************************* */ //move to the beginning of the 1. row void lcd_line1() { lcd_text_line = 0; 10f8: 10 92 11 01 sts 0x0111, r1 /* ************************************************************************************** */ /* Set the character position to x,y , where x specifies the character number in a text line. */ /* The y position is the page address (8 line units). */ /* For most controllers the y position must be increased by (Height + 7) / 8 for the next text line */ void lcd_set_cursor(uint8_t y, uint8_t x) { _lcd_column = x; 10fc: 10 92 04 01 sts 0x0104, r1 #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || (LCD_ST_TYPE == 7108) || (LCD_ST_TYPE == 7920)) // unsigned char xx; //move to the specified position (depends on used font) _page = y; 1100: 10 92 05 01 sts 0x0105, r1 // The pixel memory is greater as the display window. // For example the SPL501 controller has 132x65 dot matrix memory // LCD_ST7565_H_OFFSET specifies the offset of the 128 pixel of the display window. _xpos = (x * FONT_WIDTH); 1104: 10 92 10 01 sts 0x0110, r1 1108: 08 95 ret 0000110a : // for the ST7920 you can select a accurate vertical pixel positioning of line with: // #define FONT_V_SPACE FONT_HEIGHT // or you can select a 8-line rounding of the positioning of the lines with: #define FONT_V_SPACE (((FONT_HEIGHT + 7) / 8) * 8) void lcd_line2() { lcd_text_line = 1; 110a: 81 e0 ldi r24, 0x01 ; 1 110c: 80 93 11 01 sts 0x0111, r24 /* ************************************************************************************** */ /* Set the character position to x,y , where x specifies the character number in a text line. */ /* The y position is the page address (8 line units). */ /* For most controllers the y position must be increased by (Height + 7) / 8 for the next text line */ void lcd_set_cursor(uint8_t y, uint8_t x) { _lcd_column = x; 1110: 10 92 04 01 sts 0x0104, r1 #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || (LCD_ST_TYPE == 7108) || (LCD_ST_TYPE == 7920)) // unsigned char xx; //move to the specified position (depends on used font) _page = y; 1114: 82 e0 ldi r24, 0x02 ; 2 1116: 80 93 05 01 sts 0x0105, r24 // The pixel memory is greater as the display window. // For example the SPL501 controller has 132x65 dot matrix memory // LCD_ST7565_H_OFFSET specifies the offset of the 128 pixel of the display window. _xpos = (x * FONT_WIDTH); 111a: 10 92 10 01 sts 0x0110, r1 111e: 08 95 ret 00001120 : } /* ******************************************************************************* */ //move to the beginning of the 3. row void lcd_line3() { lcd_text_line = 2; 1120: 82 e0 ldi r24, 0x02 ; 2 1122: 80 93 11 01 sts 0x0111, r24 /* ************************************************************************************** */ /* Set the character position to x,y , where x specifies the character number in a text line. */ /* The y position is the page address (8 line units). */ /* For most controllers the y position must be increased by (Height + 7) / 8 for the next text line */ void lcd_set_cursor(uint8_t y, uint8_t x) { _lcd_column = x; 1126: 10 92 04 01 sts 0x0104, r1 #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || (LCD_ST_TYPE == 7108) || (LCD_ST_TYPE == 7920)) // unsigned char xx; //move to the specified position (depends on used font) _page = y; 112a: 84 e0 ldi r24, 0x04 ; 4 112c: 80 93 05 01 sts 0x0105, r24 // The pixel memory is greater as the display window. // For example the SPL501 controller has 132x65 dot matrix memory // LCD_ST7565_H_OFFSET specifies the offset of the 128 pixel of the display window. _xpos = (x * FONT_WIDTH); 1130: 10 92 10 01 sts 0x0110, r1 1134: 08 95 ret 00001136 : } /* ******************************************************************************* */ //move to the beginning of the 4. row void lcd_line4() { lcd_text_line = 3; 1136: 83 e0 ldi r24, 0x03 ; 3 1138: 80 93 11 01 sts 0x0111, r24 /* ************************************************************************************** */ /* Set the character position to x,y , where x specifies the character number in a text line. */ /* The y position is the page address (8 line units). */ /* For most controllers the y position must be increased by (Height + 7) / 8 for the next text line */ void lcd_set_cursor(uint8_t y, uint8_t x) { _lcd_column = x; 113c: 10 92 04 01 sts 0x0104, r1 #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || (LCD_ST_TYPE == 7108) || (LCD_ST_TYPE == 7920)) // unsigned char xx; //move to the specified position (depends on used font) _page = y; 1140: 86 e0 ldi r24, 0x06 ; 6 1142: 80 93 05 01 sts 0x0105, r24 // The pixel memory is greater as the display window. // For example the SPL501 controller has 132x65 dot matrix memory // LCD_ST7565_H_OFFSET specifies the offset of the 128 pixel of the display window. _xpos = (x * FONT_WIDTH); 1146: 10 92 10 01 sts 0x0110, r1 114a: 08 95 ret 0000114c : /* ************************************************************************************** */ /* Set the character position to x,y , where x specifies the character number in a text line. */ /* The y position is the page address (8 line units). */ /* For most controllers the y position must be increased by (Height + 7) / 8 for the next text line */ void lcd_set_cursor(uint8_t y, uint8_t x) { _lcd_column = x; 114c: 60 93 04 01 sts 0x0104, r22 #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || (LCD_ST_TYPE == 7108) || (LCD_ST_TYPE == 7920)) // unsigned char xx; //move to the specified position (depends on used font) _page = y; 1150: 80 93 05 01 sts 0x0105, r24 // The pixel memory is greater as the display window. // For example the SPL501 controller has 132x65 dot matrix memory // LCD_ST7565_H_OFFSET specifies the offset of the 128 pixel of the display window. _xpos = (x * FONT_WIDTH); 1154: 66 0f add r22, r22 1156: 66 0f add r22, r22 1158: 66 0f add r22, r22 115a: 60 93 10 01 sts 0x0110, r22 115e: 08 95 ret 00001160 : /* ******************************************************************************* */ // position to next line to column xx // Text_line number is incremented by 1, if possible (not yet at the last line). // If already at the last line of the display, last_line_used is set to 1 . void lcd_next_line(uint8_t xx) { lcd_text_line ++; 1160: 90 91 11 01 lds r25, 0x0111 1164: 9f 5f subi r25, 0xFF ; 255 1166: 90 93 11 01 sts 0x0111, r25 if (lcd_text_line > (LCD_LINES - 1)) { 116a: 94 30 cpi r25, 0x04 ; 4 116c: 38 f0 brcs .+14 ; 0x117c // Limit is reached lcd_text_line = (LCD_LINES - 1); 116e: 93 e0 ldi r25, 0x03 ; 3 1170: 90 93 11 01 sts 0x0111, r25 last_line_used = 1; 1174: 91 e0 ldi r25, 0x01 ; 1 1176: 90 93 4a 01 sts 0x014A, r25 117a: 02 c0 rjmp .+4 ; 0x1180 } else { last_line_used = 0; 117c: 10 92 4a 01 sts 0x014A, r1 } lcd_set_cursor((uint8_t)(lcd_text_line * PAGES_PER_LINE), xx); 1180: 90 91 11 01 lds r25, 0x0111 1184: 68 2f mov r22, r24 1186: 89 2f mov r24, r25 1188: 88 0f add r24, r24 118a: 0e 94 a6 08 call 0x114c ; 0x114c 118e: 08 95 ret 00001190 : } /* ******************************************************************************* */ #ifdef WAIT_LINE2_CLEAR void lcd_next_line_wait(uint8_t xx) { lcd_next_line(xx); 1190: 0e 94 b0 08 call 0x1160 ; 0x1160 wait_for_key_5s_line2(); // wait 5s and clear last line 1194: 0e 94 1d 0f call 0x1e3a ; 0x1e3a 1198: 08 95 ret 0000119a : } #if FLASHEND > 0x1fff /* ************************************************************************************** */ uint8_t lcd_save_position(void) { last_text_column = _lcd_column; 119a: 80 91 04 01 lds r24, 0x0104 119e: 80 93 01 01 sts 0x0101, r24 last_text_line = lcd_text_line; 11a2: 80 91 11 01 lds r24, 0x0111 11a6: 80 93 03 01 sts 0x0103, r24 return(last_text_line); } 11aa: 08 95 ret 000011ac : /* ************************************************************************************** */ void lcd_restore_position(void) { lcd_set_cursor((uint8_t)last_text_line * PAGES_PER_LINE, (uint8_t)(last_text_column)); 11ac: 80 91 03 01 lds r24, 0x0103 11b0: 60 91 01 01 lds r22, 0x0101 11b4: 88 0f add r24, r24 11b6: 0e 94 a6 08 call 0x114c ; 0x114c 11ba: 08 95 ret 000011bc : } #ifdef WITH_UART void uart_newline(void) { uart_putc('\r'); 11bc: 8d e0 ldi r24, 0x0D ; 13 11be: 0e 94 12 0e call 0x1c24 ; 0x1c24 uart_putc('\n'); 11c2: 8a e0 ldi r24, 0x0A ; 10 11c4: 0e 94 12 0e call 0x1c24 ; 0x1c24 11c8: 08 95 ret 000011ca : #endif } /* end lcd_data() */ // sends a command to the LCD void lcd_command(unsigned char temp1) { 11ca: cf 93 push r28 11cc: c8 2f mov r28, r24 lcd_write_cmd(temp1); // set RS to 0 11ce: 68 2f mov r22, r24 11d0: 80 e0 ldi r24, 0x00 ; 0 11d2: 0e 94 45 08 call 0x108a ; 0x108a <_lcd_hw_write> #ifdef WITH_UART if((temp1 == 0x80) || (temp1 == 0xC0)) { 11d6: cf 7b andi r28, 0xBF ; 191 11d8: c0 38 cpi r28, 0x80 ; 128 11da: 11 f4 brne .+4 ; 0x11e0 uart_newline(); 11dc: 0e 94 de 08 call 0x11bc ; 0x11bc } #endif } 11e0: cf 91 pop r28 11e2: 08 95 ret 000011e4 : } #endif #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || (LCD_ST_TYPE == 7108)) void lcd_powersave(void) { lcd_command(CMD_DISPLAY_OFF); 11e4: 8e ea ldi r24, 0xAE ; 174 11e6: 0e 94 e5 08 call 0x11ca ; 0x11ca #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306)) lcd_command(CMD_SET_ALLPTS_ON); // Enter power save mode 11ea: 85 ea ldi r24, 0xA5 ; 165 11ec: 0e 94 e5 08 call 0x11ca ; 0x11ca 11f0: 08 95 ret 000011f2 : #endif /* ******************************************************************************* */ // send the command to clear the display void lcd_clear(void) { 11f2: cf 93 push r28 11f4: df 93 push r29 #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306)) unsigned char p; unsigned char count; for (p = 0; p < (SCREEN_HEIGHT / 8); p++) { 11f6: c0 e0 ldi r28, 0x00 ; 0 lcd_command(CMD_SET_COLUMN_UPPER); // set horizontal position to 0 11f8: 80 e1 ldi r24, 0x10 ; 16 11fa: 0e 94 e5 08 call 0x11ca ; 0x11ca lcd_command(CMD_SET_COLUMN_LOWER); 11fe: 80 e0 ldi r24, 0x00 ; 0 1200: 0e 94 e5 08 call 0x11ca ; 0x11ca lcd_command(CMD_SET_PAGE | (0x0f & p)); // set page 0 to 7 1204: 8c 2f mov r24, r28 1206: 80 6b ori r24, 0xB0 ; 176 1208: 0e 94 e5 08 call 0x11ca ; 0x11ca 120c: d4 e8 ldi r29, 0x84 ; 132 for (count = 0; count < 132; count++) lcd_write_data(0); 120e: 60 e0 ldi r22, 0x00 ; 0 1210: 81 e0 ldi r24, 0x01 ; 1 1212: 0e 94 45 08 call 0x108a ; 0x108a <_lcd_hw_write> 1216: d1 50 subi r29, 0x01 ; 1 for (p = 0; p < (SCREEN_HEIGHT / 8); p++) { lcd_command(CMD_SET_COLUMN_UPPER); // set horizontal position to 0 lcd_command(CMD_SET_COLUMN_LOWER); lcd_command(CMD_SET_PAGE | (0x0f & p)); // set page 0 to 7 for (count = 0; count < 132; count++) 1218: d1 f7 brne .-12 ; 0x120e #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306)) unsigned char p; unsigned char count; for (p = 0; p < (SCREEN_HEIGHT / 8); p++) { 121a: cf 5f subi r28, 0xFF ; 255 121c: c8 30 cpi r28, 0x08 ; 8 121e: 61 f7 brne .-40 ; 0x11f8 #else lcd_command(CLEAR_DISPLAY); wait_about10ms(); #endif #ifdef WITH_UART uart_newline(); 1220: 0e 94 de 08 call 0x11bc ; 0x11bc #endif lcd_line1(); // set cursor to Line1 Column 1, (only for OLED-Display) 1224: 0e 94 7c 08 call 0x10f8 ; 0x10f8 lcd_text_line = 0; 1228: 10 92 11 01 sts 0x0111, r1 } 122c: df 91 pop r29 122e: cf 91 pop r28 1230: 08 95 ret 00001232 : /* -------------------------------------------------------------------------- */ #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306)) void lcd_init(void) { #if (LCD_INTERFACE_MODE == MODE_SPI) HW_LCD_RES_PORT &= ~_BV(HW_LCD_RES_PIN); // RESET LCD-Display 1232: 58 98 cbi 0x0b, 0 ; 11 HW_LCD_EN_PORT &= ~_BV(HW_LCD_EN_PIN); 1234: 5a 98 cbi 0x0b, 2 ; 11 HW_LCD_RS_PORT &= ~_BV(HW_LCD_RS_PIN); 1236: 59 98 cbi 0x0b, 1 ; 11 HW_LCD_B0_PORT &= ~_BV(HW_LCD_B0_PIN); 1238: 5b 98 cbi 0x0b, 3 ; 11 HW_LCD_RES_DDR |= _BV(HW_LCD_RES_PIN); // LCD RESET is Output 123a: 50 9a sbi 0x0a, 0 ; 10 HW_LCD_EN_DDR |= _BV(HW_LCD_EN_PIN); // LCD SCL is Output 123c: 52 9a sbi 0x0a, 2 ; 10 HW_LCD_RS_DDR |= _BV(HW_LCD_RS_PIN); // LCD A0 is Output 123e: 51 9a sbi 0x0a, 1 ; 10 HW_LCD_B0_DDR |= _BV(HW_LCD_B0_PIN); // LCD SI is Output 1240: 53 9a sbi 0x0a, 3 ; 10 wait_about100ms(); // Set LCD for 100 ms into RESET 1242: 84 e1 ldi r24, 0x14 ; 20 1244: 0e 94 4a 0e call 0x1c94 ; 0x1c94 HW_LCD_RES_PORT |= _BV(HW_LCD_RES_PIN); 1248: 58 9a sbi 0x0b, 0 ; 11 wait_about30ms(); // Wait for 30 ms after RESET 124a: 86 e0 ldi r24, 0x06 ; 6 124c: 0e 94 4a 0e call 0x1c94 ; 0x1c94 #if (LCD_INTERFACE_MODE == MODE_I2C) i2c_init(); // init the I2C interface wait_about30ms(); // Set LCD for 100 ms into RESET #endif lcd_command(CMD_DISPLAY_OFF); // display off 1250: 8e ea ldi r24, 0xAE ; 174 1252: 0e 94 e5 08 call 0x11ca ; 0x11ca lcd_command(CMD_INTERNAL_RESET); // 0xe2 1256: 82 ee ldi r24, 0xE2 ; 226 1258: 0e 94 e5 08 call 0x11ca ; 0x11ca lcd_command(CMD_SET_BIAS_9); // 0xa3 125c: 82 ea ldi r24, 0xA2 ; 162 125e: 0e 94 e5 08 call 0x11ca ; 0x11ca lcd_command(CMD_SET_ADC_NORMAL); // 0xa0 1262: 80 ea ldi r24, 0xA0 ; 160 1264: 0e 94 e5 08 call 0x11ca ; 0x11ca lcd_command(CMD_SET_COM_NORMAL); // 0xc0 1268: 80 ec ldi r24, 0xC0 ; 192 126a: 0e 94 e5 08 call 0x11ca ; 0x11ca #if (LCD_ST_TYPE == 7565) //Booster on, Voltage regulator/follower circuit on lcd_command(CMD_SET_POWER_CONTROL | 7); // 0x28 BOOSTER ON | V_REGULATOR ON | V_FOLLOWER ON 126e: 8f e2 ldi r24, 0x2F ; 47 1270: 0e 94 e5 08 call 0x11ca ; 0x11ca lcd_command(CMD_SET_RESISTOR_RATIO | (7 & LCD_ST7565_RESISTOR_RATIO)); // 0x20 1274: 84 e2 ldi r24, 0x24 ; 36 1276: 0e 94 e5 08 call 0x11ca ; 0x11ca lcd_command(CMD_SET_VOLUME_FIRST); // 0x81 set volume command 127a: 81 e8 ldi r24, 0x81 ; 129 127c: 0e 94 e5 08 call 0x11ca ; 0x11ca lcd_command(eeprom_read_byte(&EE_Volume_Value) & 0x3f); //set volume value of EEprom 1280: 80 e0 ldi r24, 0x00 ; 0 1282: 90 e0 ldi r25, 0x00 ; 0 1284: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> 1288: 8f 73 andi r24, 0x3F ; 63 128a: 0e 94 e5 08 call 0x11ca ; 0x11ca // lcd_command(CMD_SET_Vcomh_DESELECT_LEVEL); // set Vcomh deselect level (0xdb), 0x20 is reset value // lcd_command(0x40); //## lcd_command(CMD_RMW); // 0xe0 , set Read Modify Write mode #endif lcd_command(CMD_SET_DISP_START_LINE | 0); // 0x40 128e: 80 e4 ldi r24, 0x40 ; 64 1290: 0e 94 e5 08 call 0x11ca ; 0x11ca lcd_command(CMD_SET_ALLPTS_NORMAL); // 0xa4 1294: 84 ea ldi r24, 0xA4 ; 164 1296: 0e 94 e5 08 call 0x11ca ; 0x11ca lcd_command(CMD_SET_DISP_NORMAL); // 0xa6 not reverse 129a: 86 ea ldi r24, 0xA6 ; 166 129c: 0e 94 e5 08 call 0x11ca ; 0x11ca lcd_clear(); 12a0: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_command(CMD_DISPLAY_ON); // 0xaf 12a4: 8f ea ldi r24, 0xAF ; 175 12a6: 0e 94 e5 08 call 0x11ca ; 0x11ca /* ************************************************************************************** */ /* Set the character position to x,y , where x specifies the character number in a text line. */ /* The y position is the page address (8 line units). */ /* For most controllers the y position must be increased by (Height + 7) / 8 for the next text line */ void lcd_set_cursor(uint8_t y, uint8_t x) { _lcd_column = x; 12aa: 10 92 04 01 sts 0x0104, r1 #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || (LCD_ST_TYPE == 7108) || (LCD_ST_TYPE == 7920)) // unsigned char xx; //move to the specified position (depends on used font) _page = y; 12ae: 10 92 05 01 sts 0x0105, r1 // The pixel memory is greater as the display window. // For example the SPL501 controller has 132x65 dot matrix memory // LCD_ST7565_H_OFFSET specifies the offset of the 128 pixel of the display window. _xpos = (x * FONT_WIDTH); 12b2: 10 92 10 01 sts 0x0110, r1 12b6: 08 95 ret 000012b8 : } #endif /* ******************************************************************************* */ // load custom character from PGM or EEprom and send to LCD void lcd_fix_customchar(const unsigned char *chardata) { 12b8: 08 95 ret 000012ba : #endif /* ******************************************************************************* */ #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || (LCD_ST_TYPE == 7108)) unsigned char reverse_byte(unsigned char b) { 12ba: 58 2f mov r21, r24 12bc: 28 e0 ldi r18, 0x08 ; 8 12be: 30 e0 ldi r19, 0x00 ; 0 unsigned char result = 0; unsigned char bitin; unsigned char bitout; for (bitin = 1, bitout = 0x80; bitin != 0; bitin <<= 1, bitout >>= 1) 12c0: 90 e8 ldi r25, 0x80 ; 128 12c2: 41 e0 ldi r20, 0x01 ; 1 /* ******************************************************************************* */ #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || (LCD_ST_TYPE == 7108)) unsigned char reverse_byte(unsigned char b) { unsigned char result = 0; 12c4: 80 e0 ldi r24, 0x00 ; 0 unsigned char bitin; unsigned char bitout; for (bitin = 1, bitout = 0x80; bitin != 0; bitin <<= 1, bitout >>= 1) if (b & bitin) 12c6: 64 2f mov r22, r20 12c8: 65 23 and r22, r21 12ca: 09 f0 breq .+2 ; 0x12ce result |= bitout; 12cc: 89 2b or r24, r25 { unsigned char result = 0; unsigned char bitin; unsigned char bitout; for (bitin = 1, bitout = 0x80; bitin != 0; bitin <<= 1, bitout >>= 1) 12ce: 44 0f add r20, r20 12d0: 96 95 lsr r25 12d2: 21 50 subi r18, 0x01 ; 1 12d4: 31 09 sbc r19, r1 12d6: 21 15 cp r18, r1 12d8: 31 05 cpc r19, r1 12da: a9 f7 brne .-22 ; 0x12c6 if (b & bitin) result |= bitout; return result; } 12dc: 08 95 ret 000012de : /* width and height specifies the dimension of the pixel field. */ /* The different controller types uses different ways of loading the pixels. */ /* For the ST7920 controller the changes are only made in a memory field (RAM). */ /* ******************************************************************************* */ void lcd_set_pixels(const unsigned char *pdata, unsigned char x, unsigned char y, unsigned char options, unsigned char width, unsigned char height) { 12de: a0 e0 ldi r26, 0x00 ; 0 12e0: b0 e0 ldi r27, 0x00 ; 0 12e2: e5 e7 ldi r30, 0x75 ; 117 12e4: f9 e0 ldi r31, 0x09 ; 9 12e6: 0c 94 3d 39 jmp 0x727a ; 0x727a <__prologue_saves__> 12ea: ec 01 movw r28, r24 /* ------------------------------------------------------------------------------- */ #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || (LCD_ST_TYPE == 7108)) if (x >= (SCREEN_WIDTH - 6) || (y >= (SCREEN_HEIGHT - 8))) 12ec: 6a 37 cpi r22, 0x7A ; 122 12ee: 08 f0 brcs .+2 ; 0x12f2 12f0: 77 c0 rjmp .+238 ; 0x13e0 12f2: 48 33 cpi r20, 0x38 ; 56 12f4: 08 f0 brcs .+2 ; 0x12f8 12f6: 74 c0 rjmp .+232 ; 0x13e0 unsigned char offset; unsigned char page; unsigned char pagemax; unsigned char xx; page = y >> 3; // page of screen has 8 pixel lines each 12f8: 34 2e mov r3, r20 12fa: 36 94 lsr r3 12fc: 36 94 lsr r3 12fe: 36 94 lsr r3 pagemax = (y + height - 1) >> 3; 1300: f1 2c mov r15, r1 1302: e4 0e add r14, r20 1304: f1 1c adc r15, r1 1306: 81 e0 ldi r24, 0x01 ; 1 1308: e8 1a sub r14, r24 130a: f1 08 sbc r15, r1 130c: 53 e0 ldi r21, 0x03 ; 3 130e: f5 94 asr r15 1310: e7 94 ror r14 1312: 5a 95 dec r21 1314: e1 f7 brne .-8 ; 0x130e if ((options & OPT_VREVERSE) == OPT_VREVERSE) 1316: 12 2f mov r17, r18 1318: 12 70 andi r17, 0x02 ; 2 131a: 21 ff sbrs r18, 1 131c: 0b c0 rjmp .+22 ; 0x1334 pdata += (pagemax - page) * width; 131e: c7 01 movw r24, r14 1320: 99 27 eor r25, r25 1322: 83 19 sub r24, r3 1324: 91 09 sbc r25, r1 1326: 08 9f mul r16, r24 1328: a0 01 movw r20, r0 132a: 09 9f mul r16, r25 132c: 50 0d add r21, r0 132e: 11 24 eor r1, r1 1330: c4 0f add r28, r20 1332: d5 1f adc r29, r21 1334: 97 e0 ldi r25, 0x07 ; 7 1336: 9e 15 cp r25, r14 1338: 10 f4 brcc .+4 ; 0x133e 133a: 47 e0 ldi r20, 0x07 ; 7 133c: e4 2e mov r14, r20 if (pagemax >= (SCREEN_HEIGHT >> 3)) pagemax = ((SCREEN_HEIGHT - 1) >> 3); // limit to last page of screen for (; page <= pagemax; page++) { #if (LCD_ST7565_H_FLIP == 1) xx = (SCREEN_WIDTH - x - width) + LCD_ST7565_H_OFFSET; 133e: 84 e8 ldi r24, 0x84 ; 132 1340: 80 1b sub r24, r16 1342: 86 1b sub r24, r22 } else { _lcd_hw_select(2); // select controller 2 } lcd_command(CMD_SET_COLUMN_ADDR | (0x3f & xx )); #else lcd_command(CMD_SET_COLUMN_UPPER | (0x0f & (xx >> 4))); 1344: f8 2e mov r15, r24 1346: f2 94 swap r15 1348: 9f e0 ldi r25, 0x0F ; 15 134a: f9 22 and r15, r25 134c: 9f 2d mov r25, r15 134e: 90 61 ori r25, 0x10 ; 16 1350: f9 2e mov r15, r25 1352: 37 e0 ldi r19, 0x07 ; 7 1354: 23 2e mov r2, r19 1356: 23 18 sub r2, r3 lcd_command(CMD_SET_COLUMN_LOWER | (0x0f & xx)); 1358: 8f 70 andi r24, 0x0F ; 15 135a: 58 2e mov r5, r24 _lcd_hw_select(2); // select controller 2 lcd_command(CMD_SET_COLUMN_ADDR | (0x3f & xx )); } #endif #if (LCD_ST7565_H_FLIP == 1) if (!((options & OPT_HREVERSE) == OPT_HREVERSE)) 135c: 21 70 andi r18, 0x01 ; 1 135e: 42 2e mov r4, r18 #else if ((options & OPT_HREVERSE) == OPT_HREVERSE) #endif { byte = pgm_read_byte(pdata + width - offset - 1); 1360: a0 2e mov r10, r16 1362: b1 2c mov r11, r1 1364: 45 01 movw r8, r10 1366: 81 e0 ldi r24, 0x01 ; 1 1368: 88 1a sub r8, r24 136a: 91 08 sbc r9, r1 if ((options & OPT_VREVERSE) == OPT_VREVERSE) pdata += (pagemax - page) * width; if (pagemax >= (SCREEN_HEIGHT >> 3)) pagemax = ((SCREEN_HEIGHT - 1) >> 3); // limit to last page of screen for (; page <= pagemax; page++) 136c: e3 14 cp r14, r3 136e: 88 f1 brcs .+98 ; 0x13d2 #endif #if (LCD_ST_TYPE == 7108) _lcd_hw_select(3); // select both controllers #endif #if (LCD_ST7565_V_FLIP == 1) lcd_command(CMD_SET_PAGE | (((SCREEN_HEIGHT / 8) - 1) - page)); 1370: 82 2d mov r24, r2 1372: 80 6b ori r24, 0xB0 ; 176 1374: 0e 94 e5 08 call 0x11ca ; 0x11ca } else { _lcd_hw_select(2); // select controller 2 } lcd_command(CMD_SET_COLUMN_ADDR | (0x3f & xx )); #else lcd_command(CMD_SET_COLUMN_UPPER | (0x0f & (xx >> 4))); 1378: 8f 2d mov r24, r15 137a: 0e 94 e5 08 call 0x11ca ; 0x11ca lcd_command(CMD_SET_COLUMN_LOWER | (0x0f & xx)); 137e: 85 2d mov r24, r5 1380: 0e 94 e5 08 call 0x11ca ; 0x11ca 1384: c1 2c mov r12, r1 1386: d1 2c mov r13, r1 1388: 3e 01 movw r6, r28 138a: 68 0c add r6, r8 138c: 79 1c adc r7, r9 #endif for (offset = 0; offset < width; offset++) 138e: c0 16 cp r12, r16 1390: b0 f4 brcc .+44 ; 0x13be _lcd_hw_select(2); // select controller 2 lcd_command(CMD_SET_COLUMN_ADDR | (0x3f & xx )); } #endif #if (LCD_ST7565_H_FLIP == 1) if (!((options & OPT_HREVERSE) == OPT_HREVERSE)) 1392: 41 10 cpse r4, r1 1394: 04 c0 rjmp .+8 ; 0x139e 1396: f3 01 movw r30, r6 1398: ec 19 sub r30, r12 139a: fd 09 sbc r31, r13 139c: 03 c0 rjmp .+6 ; 0x13a4 139e: fe 01 movw r30, r28 13a0: ec 0d add r30, r12 13a2: fd 1d adc r31, r13 #else if ((options & OPT_HREVERSE) == OPT_HREVERSE) #endif { byte = pgm_read_byte(pdata + width - offset - 1); } else { byte = pgm_read_byte(pdata + offset); 13a4: 84 91 lpm r24, Z } #if (LCD_ST7565_V_FLIP == 1) if (!((options & OPT_VREVERSE) == OPT_VREVERSE)) 13a6: 11 11 cpse r17, r1 13a8: 02 c0 rjmp .+4 ; 0x13ae #else if ((options & OPT_VREVERSE) == OPT_VREVERSE) #endif { byte = reverse_byte(byte); 13aa: 0e 94 5d 09 call 0x12ba ; 0x12ba } // if ((options & OPT_CINVERSE) == OPT_CINVERSE) { // byte = ~byte; // } lcd_write_data(byte); 13ae: 68 2f mov r22, r24 13b0: 81 e0 ldi r24, 0x01 ; 1 13b2: 0e 94 45 08 call 0x108a ; 0x108a <_lcd_hw_write> 13b6: 9f ef ldi r25, 0xFF ; 255 13b8: c9 1a sub r12, r25 13ba: d9 0a sbc r13, r25 13bc: e8 cf rjmp .-48 ; 0x138e xx++; } /* end for offset */ if ((options & OPT_VREVERSE) == OPT_VREVERSE) { 13be: 11 23 and r17, r17 13c0: 19 f0 breq .+6 ; 0x13c8 pdata -= width; 13c2: ca 19 sub r28, r10 13c4: db 09 sbc r29, r11 13c6: 02 c0 rjmp .+4 ; 0x13cc } else { pdata += width; 13c8: ca 0d add r28, r10 13ca: db 1d adc r29, r11 if ((options & OPT_VREVERSE) == OPT_VREVERSE) pdata += (pagemax - page) * width; if (pagemax >= (SCREEN_HEIGHT >> 3)) pagemax = ((SCREEN_HEIGHT - 1) >> 3); // limit to last page of screen for (; page <= pagemax; page++) 13cc: 33 94 inc r3 13ce: 2a 94 dec r2 13d0: cd cf rjmp .-102 ; 0x136c pdata += width; } } /* end for page */ // Restore previous cursor position #if (LCD_ST7565_V_FLIP == 1) lcd_command(CMD_SET_PAGE | (((SCREEN_HEIGHT / 8) - 1) - _page)); 13d2: 87 e0 ldi r24, 0x07 ; 7 13d4: 90 91 05 01 lds r25, 0x0105 13d8: 89 1b sub r24, r25 13da: 80 6b ori r24, 0xB0 ; 176 13dc: 0e 94 e5 08 call 0x11ca ; 0x11ca #endif } } /* end for jj */ } /* end for ii */ #endif /* (LCD_ST_TYPE == 7565) || == 1306 || == 7108 || == 7920 */ } 13e0: cd b7 in r28, 0x3d ; 61 13e2: de b7 in r29, 0x3e ; 62 13e4: e2 e1 ldi r30, 0x12 ; 18 13e6: 0c 94 59 39 jmp 0x72b2 ; 0x72b2 <__epilogue_restores__> 000013ea : // with offset 32, 0x20 the icon is written to the right upper quarter of the screen // with offset 48, 0x30 the icon is written to the left upper quarter of the screen // to the left of the quarter are at least 8 pixels free // to the right of the quarter are 16 pixels free (8+24+16 < (SCREEN_WIDTH/2) #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || (LCD_ST_TYPE == 7108) || (LCD_ST_TYPE == 7920)) void lcd_big_icon(unsigned char temp1) { 13ea: ef 92 push r14 13ec: 0f 93 push r16 13ee: 28 2f mov r18, r24 uint8_t *pfont; // pointer to the start of font data uint8_t pos_nr; #define TP_WIDTH 8 /* specifies the width of the Test Port number */ #define DIODE_WIDTH 5 /* diode is 8 pixel width, but TP overlap the diode images with 3 pixels */ pfont = (uint8_t *) bigfont[temp1 & 0x0f]; // first byte of character data 13f0: 8f 70 andi r24, 0x0F ; 15 13f2: 30 e6 ldi r19, 0x60 ; 96 13f4: 83 9f mul r24, r19 13f6: c0 01 movw r24, r0 13f8: 11 24 eor r1, r1 13fa: 8e 53 subi r24, 0x3E ; 62 13fc: 9a 4f sbci r25, 0xFA ; 250 pos_nr = temp1 & 0x30; // filter the position Information 13fe: 32 2f mov r19, r18 1400: 30 73 andi r19, 0x30 ; 48 icon_xx = TP_WIDTH; // left side if ((pos_nr & 0x10) == 0) icon_xx += (SCREEN_WIDTH / 2); // right side 1402: 24 ff sbrs r18, 4 1404: 02 c0 rjmp .+4 ; 0x140a uint8_t pos_nr; #define TP_WIDTH 8 /* specifies the width of the Test Port number */ #define DIODE_WIDTH 5 /* diode is 8 pixel width, but TP overlap the diode images with 3 pixels */ pfont = (uint8_t *) bigfont[temp1 & 0x0f]; // first byte of character data pos_nr = temp1 & 0x30; // filter the position Information icon_xx = TP_WIDTH; // left side 1406: 28 e0 ldi r18, 0x08 ; 8 1408: 01 c0 rjmp .+2 ; 0x140c if ((pos_nr & 0x10) == 0) icon_xx += (SCREEN_WIDTH / 2); // right side 140a: 28 e4 ldi r18, 0x48 ; 72 140c: 20 93 12 01 sts 0x0112, r18 icon_yy = 0; if (pos_nr < 0x20) { 1410: 30 32 cpi r19, 0x20 ; 32 1412: 18 f0 brcs .+6 ; 0x141a #define DIODE_WIDTH 5 /* diode is 8 pixel width, but TP overlap the diode images with 3 pixels */ pfont = (uint8_t *) bigfont[temp1 & 0x0f]; // first byte of character data pos_nr = temp1 & 0x30; // filter the position Information icon_xx = TP_WIDTH; // left side if ((pos_nr & 0x10) == 0) icon_xx += (SCREEN_WIDTH / 2); // right side icon_yy = 0; 1414: 10 92 00 01 sts 0x0100, r1 1418: 08 c0 rjmp .+16 ; 0x142a if (pos_nr < 0x20) { icon_yy = (SCREEN_HEIGHT / 2); // lower half of display 141a: 20 e2 ldi r18, 0x20 ; 32 141c: 20 93 00 01 sts 0x0100, r18 // shift lower icon position to the right icon_xx += (SCREEN_WIDTH / 2) - ICON_WIDTH - TP_WIDTH - TP_WIDTH - DIODE_WIDTH; 1420: 20 91 12 01 lds r18, 0x0112 1424: 2d 5e subi r18, 0xED ; 237 1426: 20 93 12 01 sts 0x0112, r18 } lcd_set_pixels( pfont, icon_xx, icon_yy, 0, ICON_WIDTH, ICON_HEIGHT); // write the pixel data of the Icon 142a: 60 e2 ldi r22, 0x20 ; 32 142c: e6 2e mov r14, r22 142e: 08 e1 ldi r16, 0x18 ; 24 1430: 20 e0 ldi r18, 0x00 ; 0 1432: 40 91 00 01 lds r20, 0x0100 1436: 60 91 12 01 lds r22, 0x0112 143a: 0e 94 6f 09 call 0x12de ; 0x12de } 143e: 0f 91 pop r16 1440: ef 90 pop r14 1442: 08 95 ret 00001444 : // followed by the bitfield data. void lcd_update_icon(const unsigned char *ubitmap) { lcd_update_icon_opt(ubitmap, 0); // call with no special option } /* ******************************************************************************* */ void lcd_update_icon_opt(const unsigned char *ubitmap, unsigned char options) { 1444: ef 92 push r14 1446: 0f 93 push r16 1448: 26 2f mov r18, r22 const unsigned char *pfont; uint8_t xx, yy; uint8_t ww, hh; pfont = &ubitmap[4]; // the bitfield data begin at position 4 xx = icon_xx + pgm_read_byte(&ubitmap[0]); // first byte = offset x to left (upper) corner of the Icon 144a: fc 01 movw r30, r24 144c: 64 91 lpm r22, Z yy = icon_yy + pgm_read_byte(&ubitmap[1]); // second byte = offset y to (left) upper corner of the Icon 144e: 31 96 adiw r30, 0x01 ; 1 1450: 44 91 lpm r20, Z ww = pgm_read_byte(&ubitmap[2]); // the width of the bitfield 1452: fc 01 movw r30, r24 1454: 32 96 adiw r30, 0x02 ; 2 1456: 04 91 lpm r16, Z hh = pgm_read_byte(&ubitmap[3]); // the height of the bitfield (must be multiple of 8 for ST7565) 1458: fc 01 movw r30, r24 145a: 33 96 adiw r30, 0x03 ; 3 145c: e4 90 lpm r14, Z const unsigned char *pfont; uint8_t xx, yy; uint8_t ww, hh; pfont = &ubitmap[4]; // the bitfield data begin at position 4 xx = icon_xx + pgm_read_byte(&ubitmap[0]); // first byte = offset x to left (upper) corner of the Icon yy = icon_yy + pgm_read_byte(&ubitmap[1]); // second byte = offset y to (left) upper corner of the Icon 145e: 50 91 00 01 lds r21, 0x0100 1462: 45 0f add r20, r21 void lcd_update_icon_opt(const unsigned char *ubitmap, unsigned char options) { const unsigned char *pfont; uint8_t xx, yy; uint8_t ww, hh; pfont = &ubitmap[4]; // the bitfield data begin at position 4 xx = icon_xx + pgm_read_byte(&ubitmap[0]); // first byte = offset x to left (upper) corner of the Icon 1464: 50 91 12 01 lds r21, 0x0112 1468: 65 0f add r22, r21 yy = icon_yy + pgm_read_byte(&ubitmap[1]); // second byte = offset y to (left) upper corner of the Icon ww = pgm_read_byte(&ubitmap[2]); // the width of the bitfield hh = pgm_read_byte(&ubitmap[3]); // the height of the bitfield (must be multiple of 8 for ST7565) lcd_set_pixels( pfont, xx, yy, options, ww, hh); // update the icon at the specified position with specified size 146a: 04 96 adiw r24, 0x04 ; 4 146c: 0e 94 6f 09 call 0x12de ; 0x12de } 1470: 0f 91 pop r16 1472: ef 90 pop r14 1474: 08 95 ret 00001476 : // The first two bytes specify the location of the change bitmap relative to the upper left corner // (the start position) of the last loaded Icon ( call of lcd_big_icon(ICON_NUMBER);). // the next two bytes specify the width and height of the correction bitfield, // followed by the bitfield data. void lcd_update_icon(const unsigned char *ubitmap) { lcd_update_icon_opt(ubitmap, 0); // call with no special option 1476: 60 e0 ldi r22, 0x00 ; 0 1478: 0e 94 22 0a call 0x1444 ; 0x1444 147c: 08 95 ret 0000147e : #endif /* ******************************************************************************* */ /* ******************************************************************************* */ // sends a character to the LCD void lcd_data(unsigned char temp1) { 147e: ef 92 push r14 1480: 0f 93 push r16 1482: cf 93 push r28 1484: c8 2f mov r28, r24 #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || (LCD_ST_TYPE == 7108) || (LCD_ST_TYPE == 7920)) uint8_t *pfont; pfont = (uint8_t *)font + (FONT_WIDTH * NR_BYTE * temp1); // first byte of character data // for other controllers like ST7565 the _page specifies the page of the controller (8 lines) lcd_set_pixels( pfont, _xpos, _page*8, 0, (unsigned char)FONT_WIDTH, (unsigned char)(NR_BYTE*8)); 1486: 40 91 05 01 lds r20, 0x0105 148a: 44 0f add r20, r20 148c: 44 0f add r20, r20 148e: 44 0f add r20, r20 void lcd_data(unsigned char temp1) { /* -------------------------------------------------------------------------- */ #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || (LCD_ST_TYPE == 7108) || (LCD_ST_TYPE == 7920)) uint8_t *pfont; pfont = (uint8_t *)font + (FONT_WIDTH * NR_BYTE * temp1); // first byte of character data 1490: 20 e1 ldi r18, 0x10 ; 16 1492: 82 9f mul r24, r18 1494: c0 01 movw r24, r0 1496: 11 24 eor r1, r1 // for other controllers like ST7565 the _page specifies the page of the controller (8 lines) lcd_set_pixels( pfont, _xpos, _page*8, 0, (unsigned char)FONT_WIDTH, (unsigned char)(NR_BYTE*8)); 1498: 70 e1 ldi r23, 0x10 ; 16 149a: e7 2e mov r14, r23 149c: 08 e0 ldi r16, 0x08 ; 8 149e: 20 e0 ldi r18, 0x00 ; 0 14a0: 60 91 10 01 lds r22, 0x0110 14a4: 8e 59 subi r24, 0x9E ; 158 14a6: 97 4f sbci r25, 0xF7 ; 247 14a8: 0e 94 6f 09 call 0x12de ; 0x12de _xpos += FONT_WIDTH; // move pointer to the next character position 14ac: 80 91 10 01 lds r24, 0x0110 14b0: 88 5f subi r24, 0xF8 ; 248 14b2: 80 93 10 01 sts 0x0110, r24 #else lcd_write_data(temp1); // set RS to 1 #endif #ifdef WITH_UART switch(temp1) { 14b6: 4c 2f mov r20, r28 14b8: 50 e0 ldi r21, 0x00 ; 0 14ba: fa 01 movw r30, r20 14bc: 31 97 sbiw r30, 0x01 ; 1 14be: e8 30 cpi r30, 0x08 ; 8 14c0: f1 05 cpc r31, r1 14c2: f0 f4 brcc .+60 ; 0x1500 14c4: ec 5c subi r30, 0xCC ; 204 14c6: ff 4f sbci r31, 0xFF ; 255 14c8: 0c 94 74 39 jmp 0x72e8 ; 0x72e8 <__tablejump2__> case LCD_CHAR_DIODE1: uart_putc('>'); 14cc: 8e e3 ldi r24, 0x3E ; 62 14ce: 06 c0 rjmp .+12 ; 0x14dc uart_putc('|'); break; case LCD_CHAR_DIODE2: uart_putc('|'); 14d0: 8c e7 ldi r24, 0x7C ; 124 14d2: 0e 94 12 0e call 0x1c24 ; 0x1c24 uart_putc('<'); 14d6: 8c e3 ldi r24, 0x3C ; 60 14d8: 14 c0 rjmp .+40 ; 0x1502 break; case LCD_CHAR_CAP: uart_putc('|'); 14da: 8c e7 ldi r24, 0x7C ; 124 14dc: 0e 94 12 0e call 0x1c24 ; 0x1c24 uart_putc('|'); 14e0: 8c e7 ldi r24, 0x7C ; 124 14e2: 0f c0 rjmp .+30 ; 0x1502 break; case LCD_CHAR_RESIS1: case LCD_CHAR_RESIS2: uart_putc('R'); 14e4: 82 e5 ldi r24, 0x52 ; 82 14e6: 0d c0 rjmp .+26 ; 0x1502 break; case LCD_CHAR_LINE1: uart_putc('-'); 14e8: 8d e2 ldi r24, 0x2D ; 45 14ea: 0b c0 rjmp .+22 ; 0x1502 // case LCD_CHAR_DEGREE: // degree sign // uart_putc(0xf8); // codepage 437 or 850 has degree // break; case LCD_CHAR_U: //µ // uart_putc(0xe6); // codepage 437 or 850 has my uart_putc('u'); // better use the ASCII u 14ec: 85 e7 ldi r24, 0x75 ; 117 14ee: 09 c0 rjmp .+18 ; 0x1502 break; case LCD_CHAR_OMEGA: //Omega uart_putc('O'); 14f0: 8f e4 ldi r24, 0x4F ; 79 14f2: 0e 94 12 0e call 0x1c24 ; 0x1c24 uart_putc('h'); 14f6: 88 e6 ldi r24, 0x68 ; 104 14f8: 0e 94 12 0e call 0x1c24 ; 0x1c24 uart_putc('m'); 14fc: 8d e6 ldi r24, 0x6D ; 109 14fe: 01 c0 rjmp .+2 ; 0x1502 break; default: uart_putc(temp1); 1500: 8c 2f mov r24, r28 1502: 0e 94 12 0e call 0x1c24 ; 0x1c24 } #endif } /* end lcd_data() */ 1506: cf 91 pop r28 1508: 0f 91 pop r16 150a: ef 90 pop r14 150c: 08 95 ret 0000150e : /* ******************************************************************************* */ // sends numeric character (Pin Number) to the LCD // from binary 0 we send ASCII 1 .... void lcd_testpin(unsigned char temp) { lcd_data(temp + '1' + TP_OFFSET); 150e: 8f 5c subi r24, 0xCF ; 207 1510: 0e 94 3f 0a call 0x147e ; 0x147e 1514: 08 95 ret 00001516 : } /* ******************************************************************************* */ // send space character to LCD void lcd_space(void) { lcd_data(' '); 1516: 80 e2 ldi r24, 0x20 ; 32 1518: 0e 94 3f 0a call 0x147e ; 0x147e 151c: 08 95 ret 0000151e : } #if FLASHEND > 0x1fff void lcd_spaces(uint8_t nn) { 151e: a1 e0 ldi r26, 0x01 ; 1 1520: b0 e0 ldi r27, 0x00 ; 0 1522: e5 e9 ldi r30, 0x95 ; 149 1524: fa e0 ldi r31, 0x0A ; 10 1526: 0c 94 4d 39 jmp 0x729a ; 0x729a <__prologue_saves__+0x20> while (nn != 0) { 152a: 88 23 and r24, r24 152c: 31 f0 breq .+12 ; 0x153a lcd_space(); 152e: 89 83 std Y+1, r24 ; 0x01 1530: 0e 94 8b 0a call 0x1516 ; 0x1516 nn--; 1534: 89 81 ldd r24, Y+1 ; 0x01 1536: 81 50 subi r24, 0x01 ; 1 1538: f8 cf rjmp .-16 ; 0x152a } } 153a: 21 96 adiw r28, 0x01 ; 1 153c: e2 e0 ldi r30, 0x02 ; 2 153e: 0c 94 69 39 jmp 0x72d2 ; 0x72d2 <__epilogue_restores__+0x20> 00001542 : /* ******************************************************************************* */ #ifdef LCD_CLEAR void lcd_clear_line(void) { // writes 20 spaces to LCD-Display, Cursor must be positioned to first column lcd_spaces(20); 1542: 84 e1 ldi r24, 0x14 ; 20 1544: 0e 94 8f 0a call 0x151e ; 0x151e 1548: 08 95 ret 0000154a : } void lcd_clear_line1(void) { lcd_line1(); 154a: 0e 94 7c 08 call 0x10f8 ; 0x10f8 lcd_clear_line(); 154e: 0e 94 a1 0a call 0x1542 ; 0x1542 lcd_line1(); 1552: 0e 94 7c 08 call 0x10f8 ; 0x10f8 1556: 08 95 ret 00001558 : } void lcd_clear_line2(void) { lcd_line2(); 1558: 0e 94 85 08 call 0x110a ; 0x110a lcd_clear_line(); 155c: 0e 94 a1 0a call 0x1542 ; 0x1542 lcd_line2(); 1560: 0e 94 85 08 call 0x110a ; 0x110a 1564: 08 95 ret 00001566 : /* ******************************************************************************* */ // writes a string to the LCD void lcd_string(char *data) { 1566: cf 93 push r28 1568: df 93 push r29 156a: ec 01 movw r28, r24 while(*data) { 156c: 89 91 ld r24, Y+ 156e: 88 23 and r24, r24 1570: 19 f0 breq .+6 ; 0x1578 lcd_data(*data); 1572: 0e 94 3f 0a call 0x147e ; 0x147e 1576: fa cf rjmp .-12 ; 0x156c data++; } } 1578: df 91 pop r29 157a: cf 91 pop r28 157c: 08 95 ret 0000157e : #ifdef use_lcd_pgm //Load string from PGM and send to LCD void lcd_pgm_string(const unsigned char *data) { 157e: cf 93 push r28 1580: df 93 push r29 1582: ec 01 movw r28, r24 unsigned char cc; while(1) { cc = pgm_read_byte(data); 1584: fe 01 movw r30, r28 1586: 84 91 lpm r24, Z if((cc==0) || (cc==128)) { 1588: 98 2f mov r25, r24 158a: 9f 77 andi r25, 0x7F ; 127 158c: 21 f0 breq .+8 ; 0x1596 return; } lcd_data(cc); 158e: 0e 94 3f 0a call 0x147e ; 0x147e data++; 1592: 21 96 adiw r28, 0x01 ; 1 } 1594: f7 cf rjmp .-18 ; 0x1584 } 1596: df 91 pop r29 1598: cf 91 pop r28 159a: 08 95 ret 0000159c : #ifdef WITH_GRAPHICS void lcd_pgm_bitmap(const unsigned char * pbitmap, unsigned char x, unsigned char y, unsigned char options) { 159c: ef 92 push r14 159e: 0f 93 push r16 uint8_t dx; // width uint8_t dy; // height dx = (unsigned char)pgm_read_byte(&pbitmap[0]); // width of the bitmap 15a0: fc 01 movw r30, r24 15a2: 04 91 lpm r16, Z dy = (unsigned char)pgm_read_byte(&pbitmap[1]); // height of the bitmap 15a4: 31 96 adiw r30, 0x01 ; 1 15a6: e4 90 lpm r14, Z lcd_set_pixels( (const unsigned char *)(pbitmap+2), x, y, options, dx, dy); 15a8: 02 96 adiw r24, 0x02 ; 2 15aa: 0e 94 6f 09 call 0x12de ; 0x12de } 15ae: 0f 91 pop r16 15b0: ef 90 pop r14 15b2: 08 95 ret 000015b4 : } /* end for ii */ #endif /* (LCD_ST_TYPE == 7565) || == 1306 || == 7108 || == 7920 */ } #endif /* ******************************************************************************* */ void lcd_show_Cg(void) { 15b4: 0f 93 push r16 lcd_MEM_string(GateCap_str); //"Cg=" 15b6: 86 eb ldi r24, 0xB6 ; 182 15b8: 93 e0 ldi r25, 0x03 ; 3 15ba: 0e 94 bf 0a call 0x157e ; 0x157e #if FLASHEND > 0x1fff if (cap.cpre < -3) { 15be: 40 91 91 01 lds r20, 0x0191 15c2: 4d 3f cpi r20, 0xFD ; 253 15c4: 6c f4 brge .+26 ; 0x15e0 DisplayValue(cap.cval,cap.cpre,'F',3); 15c6: 60 91 7f 01 lds r22, 0x017F 15ca: 70 91 80 01 lds r23, 0x0180 15ce: 80 91 81 01 lds r24, 0x0181 15d2: 90 91 82 01 lds r25, 0x0182 15d6: 03 e0 ldi r16, 0x03 ; 3 15d8: 26 e4 ldi r18, 0x46 ; 70 15da: 0e 94 a8 0b call 0x1750 ; 0x1750 15de: 03 c0 rjmp .+6 ; 0x15e6 } else { lcd_data('?'); 15e0: 8f e3 ldi r24, 0x3F ; 63 15e2: 0e 94 3f 0a call 0x147e ; 0x147e } #else DisplayValue(cap.cval,cap.cpre,'F',3); #endif } 15e6: 0f 91 pop r16 15e8: 08 95 ret 000015ea : .section .text i2lcd: ; void i2lcd(int iw) ;; movw r20, r24 sbrs r25, 7 15ea: 97 ff sbrs r25, 7 rjmp to_lcd ; if (iw >= 0) { 15ec: 09 c0 rjmp .+18 ; 0x1600 ; // negativ value, output - and invert iw push r24 ; save r24:r25 15ee: 8f 93 push r24 push r25 15f0: 9f 93 push r25 ldi r24,'-' ; 45 15f2: 8d e2 ldi r24, 0x2D ; 45 RCALL lcd_data ; lcd_data('-'); uses r22 15f4: 44 df rcall .-376 ; 0x147e pop r25 ; recall r25:r24 15f6: 9f 91 pop r25 pop r24 ; old r24 15f8: 8f 91 pop r24 com r25 15fa: 90 95 com r25 neg r24 15fc: 81 95 neg r24 sbci r25,-1 ; iw = - iw 15fe: 9f 4f sbci r25, 0xFF ; 255 00001600 : u2lcd: ; void i2lcd(uint16_t iw) to_lcd: ; void i2lcd(uint16_t iw) ldi r22, lo8(outval) ;0x0F 1600: 65 e2 ldi r22, 0x25 ; 37 ldi r23, hi8(outval) ;0x01 1602: 71 e0 ldi r23, 0x01 ; 1 ldi r20, 10 1604: 4a e0 ldi r20, 0x0A ; 10 ldi r21, 0x00 ; 0 1606: 50 e0 ldi r21, 0x00 ; 0 ACALL utoa ; utoa(iw, outval, 10); //output voltage to string 1608: 0e 94 c1 39 call 0x7382 ; 0x7382 RCALL lcd_string ;lcd_string(utoa(iw, outval, 10)); //output correction voltage 160c: ac df rcall .-168 ; 0x1566 ret 160e: 08 95 ret 00001610 : PinLayout: #ifndef EBC_STYLE ; // Layout with 123= style push r14 1610: ef 92 push r14 push r15 1612: ff 92 push r15 push r16 1614: 0f 93 push r16 push r17 1616: 1f 93 push r17 mov r17, r24 ; Pin1 1618: 18 2f mov r17, r24 mov r16, r22 ; Pin2 161a: 06 2f mov r16, r22 mov r15, r20 ; Pin3 161c: f4 2e mov r15, r20 ldi r24, lo8(N123_str) ; 0x0B 161e: 8d e9 ldi r24, 0x9D ; 157 ldi r25, hi8(N123_str) ; 0x01 1620: 93 e0 ldi r25, 0x03 ; 3 #ifdef USE_EEPROM RCALL lcd_fix_string ; lcd_MEM_string(N123_str); //" 123=" #else RCALL lcd_pgm_string ; lcd_MEM_string(N123_str); //" 123=" 1622: ad df rcall .-166 ; 0x157e #endif eor r14, r14 ; for (ipp=0; 1624: ee 24 eor r14, r14 00001626 : loop1: lds r30, _trans 1626: e0 91 48 01 lds r30, 0x0148 lds r31, _trans+1 162a: f0 91 49 01 lds r31, 0x0149 ldd r24, Z+OFFS_e ; _trans->e 162e: 86 85 ldd r24, Z+14 ; 0x0e cp r14, r24 1630: e8 16 cp r14, r24 brne checkb ; if (ipp == _trans->e) 1632: 11 f4 brne .+4 ; 0x1638 mov r24, r17 ; pin1 1634: 81 2f mov r24, r17 rjmp data_ipp ; lcd_data(pin1); // Output Character in right order 1636: 09 c0 rjmp .+18 ; 0x164a 00001638 : checkb: ldd r24, Z+OFFS_b ; _trans->b 1638: 84 85 ldd r24, Z+12 ; 0x0c cp r14, r24 ; if (ipp == _trans->b) 163a: e8 16 cp r14, r24 brne checkc 163c: 11 f4 brne .+4 ; 0x1642 mov r24, r16 163e: 80 2f mov r24, r16 rjmp data_ipp ; lcd_data(pin2); 1640: 04 c0 rjmp .+8 ; 0x164a 00001642 : checkc: ldd r24, Z+OFFS_c ; _trans->c 1642: 85 85 ldd r24, Z+13 ; 0x0d cp r14, r24 1644: e8 16 cp r14, r24 brne next_ipp ; if (ipp == _trans->c) 1646: 11 f4 brne .+4 ; 0x164c mov r24, r15 1648: 8f 2d mov r24, r15 0000164a : data_ipp: RCALL lcd_data ; lcd_data(pin3); 164a: 19 df rcall .-462 ; 0x147e 0000164c : next_ipp: inc r14 164c: e3 94 inc r14 mov r24, r14 164e: 8e 2d mov r24, r14 cpi r24, 0x03 ; for ( ;ipp<3;ipp++) { 1650: 83 30 cpi r24, 0x03 ; 3 brne loop1 1652: 49 f7 brne .-46 ; 0x1626 pop r17 1654: 1f 91 pop r17 pop r16 1656: 0f 91 pop r16 pop r15 1658: ff 90 pop r15 pop r14 165a: ef 90 pop r14 ret 165c: 08 95 ret 0000165e : .endfunc .GLOBAL Rnum2pins .func Rnum2pins Rnum2pins: mov r22,r24 165e: 68 2f mov r22, r24 ldi r24, TP1 1660: 80 e0 ldi r24, 0x00 ; 0 ldi r25, TP3 1662: 92 e0 ldi r25, 0x02 ; 2 and r22,r22 1664: 66 23 and r22, r22 brne nozero 1666: 09 f4 brne .+2 ; 0x166a ldi r25, TP2 1668: 91 e0 ldi r25, 0x01 ; 1 0000166a : nozero: cpi r22, 2 166a: 62 30 cpi r22, 0x02 ; 2 brne no_two 166c: 09 f4 brne .+2 ; 0x1670 ldi r24, TP2 166e: 81 e0 ldi r24, 0x01 ; 1 00001670 : no_two: ret 1670: 08 95 ret 00001672 : .extern ResistorVal .section .text RvalOut: ; void RvalOut(uint8_t nrr) push r16 1672: 0f 93 push r16 mov r16, r24 1674: 08 2f mov r16, r24 LDIZ ResistorVal 1676: ed ea ldi r30, 0xAD ; 173 1678: f1 e0 ldi r31, 0x01 ; 1 add r24, r24 ; nrr*2 167a: 88 0f add r24, r24 add r24, r24 ; nrr*4 167c: 88 0f add r24, r24 add r30, r24 167e: e8 0f add r30, r24 adc r31, zero_reg 1680: f1 1d adc r31, r1 ld r22, Z ; resis[rr].rx 1682: 60 81 ld r22, Z ldd r23, Z+1 ; 0x01 1684: 71 81 ldd r23, Z+1 ; 0x01 ldd r24, Z+2 ; 0x02 1686: 82 81 ldd r24, Z+2 ; 0x02 ldd r25, Z+3 ; 0x03 1688: 93 81 ldd r25, Z+3 ; 0x03 #if FLASHEND > 0x1fff cpi r22, 0x64 ; 100 168a: 64 36 cpi r22, 0x64 ; 100 cpc r23, r1 168c: 71 05 cpc r23, r1 cpc r24, r1 168e: 81 05 cpc r24, r1 cpc r25, r1 1690: 91 05 cpc r25, r1 brcc ad1d8e ; (ResistorVal[nrr] < 100) 1692: 80 f4 brcc .+32 ; 0x16b4 lds r18, inductor_lpre 1694: 20 91 02 01 lds r18, 0x0102 and r18, r18 1698: 22 23 and r18, r18 brne ad1d8e ; (inductor_lpre == 0) 169a: 61 f4 brne .+24 ; 0x16b4 mov r24,r16 169c: 80 2f mov r24, r16 ACALL Rnum2pins; ; pins = Rnum2pins(nrr) 169e: 0e 94 2f 0b call 0x165e ; 0x165e mov r22, r25 16a2: 69 2f mov r22, r25 ACALL GetESR ; rr = GetESR(resis[nrr].ra,resis[nrr].rb); 16a4: 0e 94 1c 24 call 0x4838 ; 0x4838 movw r22, r24 16a8: bc 01 movw r22, r24 ldi r24, 0 16aa: 80 e0 ldi r24, 0x00 ; 0 ldi r25, 0 16ac: 90 e0 ldi r25, 0x00 ; 0 ldi r20, -2 ; 254 16ae: 4e ef ldi r20, 0xFE ; 254 ldi r16, 0x03 ; 3 16b0: 03 e0 ldi r16, 0x03 ; 3 rjmp ad1d94 ; DisplayValue(rr,-2,LCD_CHAR_OMEGA,3); 16b2: 02 c0 rjmp .+4 ; 0x16b8 000016b4 : ad1d8e: ; } else { #endif ; r22-r25 = ResistorVal[rr] ldi r20, -1 ; 255 16b4: 4f ef ldi r20, 0xFF ; 255 ldi r16, 0x04 ; DisplayValue(resis[nrr].rx,-1,LCD_CHAR_OMEGA,4); 16b6: 04 e0 ldi r16, 0x04 ; 4 000016b8 : ad1d94: ldi r18, LCD_CHAR_OMEGA ; 244 16b8: 24 e0 ldi r18, 0x04 ; 4 RCALL DisplayValue 16ba: 4a d0 rcall .+148 ; 0x1750 RCALL lcd_space ; lcd_space(); 16bc: 2c df rcall .-424 ; 0x1516 pop r16 16be: 0f 91 pop r16 ret 16c0: 08 95 ret 000016c2 : .extern lcd_space .func mVAusgabe mVAusgabe: ; if (nn < 6) { cpi r24, 0x06 ; 6 16c2: 86 30 cpi r24, 0x06 ; 6 brcc ad1ca4; 16c4: 58 f4 brcc .+22 ; 0x16dc // Output in mV units LDIZ diodes+12; 16c6: e1 ea ldi r30, 0xA1 ; 161 16c8: f1 e0 ldi r31, 0x01 ; 1 add r30,r24 16ca: e8 0f add r30, r24 adc r31,zero_reg 16cc: f1 1d adc r31, r1 add r30,r24 16ce: e8 0f add r30, r24 adc r31,zero_reg 16d0: f1 1d adc r31, r1 ld r24, Z ; diodes.Voltage[nn] 16d2: 80 81 ld r24, Z ldd r25, Z+1 ; 0x01 16d4: 91 81 ldd r25, Z+1 ; 0x01 ldi r22, 0x03 ; 3 16d6: 63 e0 ldi r22, 0x03 ; 3 RCALL Display_mV ; Display_mV(diodes.Voltage[nn],3); 16d8: 00 d1 rcall .+512 ; 0x18da RCALL lcd_space; ; lcd_space(); 16da: 1d df rcall .-454 ; 0x1516 000016dc : ad1ca4: ret 16dc: 08 95 ret 000016de : .extern mVAusgabe .func UfAusgabe UfAusgabe: push r17 16de: 1f 93 push r17 mov r17, r24 16e0: 18 2f mov r17, r24 lds r24, ResistorsFound; 0x0168 16e2: 80 91 7b 01 lds r24, 0x017B and r24, r24 16e6: 88 23 and r24, r24 breq ad1cbe; if (ResistorsFound > 0) { 16e8: 19 f0 breq .+6 ; 0x16f0 RCALL lcd_space; lcd_space(); 16ea: 15 df rcall .-470 ; 0x1516 ldi r24, LCD_CHAR_RESIS3; 0 16ec: 80 e0 ldi r24, 0x00 ; 0 RCALL lcd_data; lcd_data(LCD_CHAR_RESIS3); // special symbol or R 16ee: c7 de rcall .-626 ; 0x147e 000016f0 : ad1cbe: RCALL lcd_line2; //2. row 16f0: 0c dd rcall .-1512 ; 0x110a ldi r24, lo8(Uf_str); 0xE9 16f2: 84 e9 ldi r24, 0x94 ; 148 ldi r25, hi8(Uf_str); 0x01 16f4: 93 e0 ldi r25, 0x03 ; 3 #ifdef USE_EEPROM RCALL lcd_fix_string ; lcd_PGM_string(Uf_str); //"Uf=" #else RCALL lcd_pgm_string ; lcd_PGM_string(Uf_str); //"Uf=" 16f6: 43 df rcall .-378 ; 0x157e #endif mov r24, r17 16f8: 81 2f mov r24, r17 swap r24 16fa: 82 95 swap r24 andi r24, 0x0F 16fc: 8f 70 andi r24, 0x0F ; 15 rcall mVAusgabe ; mVAusgabe(bcdnum >> 4); 16fe: e1 df rcall .-62 ; 0x16c2 mov r24, r17 1700: 81 2f mov r24, r17 andi r24, 0x0F ; 15 1702: 8f 70 andi r24, 0x0F ; 15 rcall mVAusgabe ; mVAusgabe(bcdnum & 0x0f); 1704: de df rcall .-68 ; 0x16c2 pop r17 1706: 1f 91 pop r17 ret 1708: 08 95 ret 0000170a : .extern AnKat .func SerienDiodenAusgabe SerienDiodenAusgabe: push r28 170a: cf 93 push r28 push r29 170c: df 93 push r29 lds r24, diode_sequence; 0x0102 170e: 80 91 13 01 lds r24, 0x0113 swap r24 1712: 82 95 swap r24 andi r24, 0x0F ; first = diode_sequence >> 4; 1714: 8f 70 andi r24, 0x0F ; 15 ldi r28, lo8(diodes) ;0x80 1716: c5 e9 ldi r28, 0x95 ; 149 ldi r29, hi8(diodes) ;0x01 1718: d1 e0 ldi r29, 0x01 ; 1 add r28, r24 ; first 171a: c8 0f add r28, r24 adc r29, zero_reg 171c: d1 1d adc r29, r1 ld r24, Y ;Anode 171e: 88 81 ld r24, Y RCALL lcd_testpin ; lcd_testpin(diodes.Anode[first]); 1720: f6 de rcall .-532 ; 0x150e ldi r24, lo8(AnKat) ;0xA3 1722: 81 e5 ldi r24, 0x51 ; 81 ldi r25, hi8(AnKat) ;0x03 1724: 92 e0 ldi r25, 0x02 ; 2 #ifdef USE_EEPROM .extern lcd_fix_string RCALL lcd_fix_string ; lcd_PGM_string(AnKat); //"->|-" #else .extern lcd_pgm_string RCALL lcd_pgm_string ; lcd_PGM_string(AnKat); //"->|-" 1726: 2b df rcall .-426 ; 0x157e #endif ldd r24, Y+6 ; Cathode 1728: 8e 81 ldd r24, Y+6 ; 0x06 RCALL lcd_testpin ; lcd_testpin(diodes.Cathode[first]); 172a: f1 de rcall .-542 ; 0x150e ldi r24, lo8(AnKat) ;0xA3 172c: 81 e5 ldi r24, 0x51 ; 81 ldi r25, hi8(AnKat) ;0x03 172e: 92 e0 ldi r25, 0x02 ; 2 #ifdef USE_EEPROM RCALL lcd_fix_string ; lcd_PGM_string(AnKat); //"->|-" #else RCALL lcd_pgm_string ; lcd_PGM_string(AnKat); //"->|-" 1730: 26 df rcall .-436 ; 0x157e #endif ldi r28, lo8(diodes) ;0x80 1732: c5 e9 ldi r28, 0x95 ; 149 ldi r29, hi8(diodes) ;0x01 1734: d1 e0 ldi r29, 0x01 ; 1 lds r24, diode_sequence; 0x0102 1736: 80 91 13 01 lds r24, 0x0113 andi r24, 0x03 ; second = diode_sequence & 3; 173a: 83 70 andi r24, 0x03 ; 3 add r28, r24 173c: c8 0f add r28, r24 adc r29, zero_reg 173e: d1 1d adc r29, r1 ldd r24, Y+6 ; Cathode 1740: 8e 81 ldd r24, Y+6 ; 0x06 RCALL lcd_testpin ; lcd_testpin(diodes.Cathode[second]); 1742: e5 de rcall .-566 ; 0x150e lds r24, diode_sequence; x0102 1744: 80 91 13 01 lds r24, 0x0113 rcall UfAusgabe ; UfAusgabe(diode_sequence); 1748: ca df rcall .-108 ; 0x16de pop r29 174a: df 91 pop r29 pop r28 174c: cf 91 pop r28 ret 174e: 08 95 ret 00001750 : */ void DisplayValue(unsigned long Value, int8_t Exponent, unsigned char Unit, unsigned char digits) { 1750: a0 e0 ldi r26, 0x00 ; 0 1752: b0 e0 ldi r27, 0x00 ; 0 1754: ee ea ldi r30, 0xAE ; 174 1756: fb e0 ldi r31, 0x0B ; 11 1758: 0c 94 43 39 jmp 0x7286 ; 0x7286 <__prologue_saves__+0xc> 175c: 14 2f mov r17, r20 175e: c2 2f mov r28, r18 Limit = 100; /* scale value down to 2 digits */ if (digits == 3) Limit = 1000; /* scale value down to 3 digits */ 1760: 03 30 cpi r16, 0x03 ; 3 1762: 09 f4 brne .+2 ; 0x1766 1764: a7 c0 rjmp .+334 ; 0x18b4 if (digits == 4) Limit = 10000; /* scale value down to 4 digits */ 1766: 04 30 cpi r16, 0x04 ; 4 1768: 09 f4 brne .+2 ; 0x176c 176a: ab c0 rjmp .+342 ; 0x18c2 #ifdef WITH_MENU if (digits == 5) Limit = 100000; /* scale value down to 5 digits */ 176c: 05 30 cpi r16, 0x05 ; 5 176e: 51 f0 breq .+20 ; 0x1784 if (digits == 6) Limit = 1000000; /* scale value down to 6 digits */ 1770: 06 30 cpi r16, 0x06 ; 6 1772: 81 f0 breq .+32 ; 0x1794 if (digits == 7) Limit = 10000000; /* scale value down to 7 digits */ 1774: 07 30 cpi r16, 0x07 ; 7 1776: b1 f0 breq .+44 ; 0x17a4 Limit = 100; /* scale value down to 2 digits */ 1778: b4 e6 ldi r27, 0x64 ; 100 177a: cb 2e mov r12, r27 177c: d1 2c mov r13, r1 177e: e1 2c mov r14, r1 1780: f1 2c mov r15, r1 1782: 17 c0 rjmp .+46 ; 0x17b2 if (digits == 3) Limit = 1000; /* scale value down to 3 digits */ if (digits == 4) Limit = 10000; /* scale value down to 4 digits */ #ifdef WITH_MENU if (digits == 5) Limit = 100000; /* scale value down to 5 digits */ 1784: a0 ea ldi r26, 0xA0 ; 160 1786: ca 2e mov r12, r26 1788: a6 e8 ldi r26, 0x86 ; 134 178a: da 2e mov r13, r26 178c: ee 24 eor r14, r14 178e: e3 94 inc r14 1790: f1 2c mov r15, r1 1792: 0f c0 rjmp .+30 ; 0x17b2 if (digits == 6) Limit = 1000000; /* scale value down to 6 digits */ 1794: f0 e4 ldi r31, 0x40 ; 64 1796: cf 2e mov r12, r31 1798: f2 e4 ldi r31, 0x42 ; 66 179a: df 2e mov r13, r31 179c: ff e0 ldi r31, 0x0F ; 15 179e: ef 2e mov r14, r31 17a0: f1 2c mov r15, r1 17a2: 07 c0 rjmp .+14 ; 0x17b2 if (digits == 7) Limit = 10000000; /* scale value down to 7 digits */ 17a4: e0 e8 ldi r30, 0x80 ; 128 17a6: ce 2e mov r12, r30 17a8: e6 e9 ldi r30, 0x96 ; 150 17aa: de 2e mov r13, r30 17ac: e8 e9 ldi r30, 0x98 ; 152 17ae: ee 2e mov r14, r30 17b0: f1 2c mov r15, r1 { Value += 5; /* for automatic rounding */ Value = Value / 10; /* scale down by 10^1 */ 17b2: 5a e0 ldi r21, 0x0A ; 10 17b4: 85 2e mov r8, r21 17b6: 91 2c mov r9, r1 17b8: a1 2c mov r10, r1 17ba: b1 2c mov r11, r1 if (digits == 5) Limit = 100000; /* scale value down to 5 digits */ if (digits == 6) Limit = 1000000; /* scale value down to 6 digits */ if (digits == 7) Limit = 10000000; /* scale value down to 7 digits */ #endif while (Value >= Limit) 17bc: 6c 15 cp r22, r12 17be: 7d 05 cpc r23, r13 17c0: 8e 05 cpc r24, r14 17c2: 9f 05 cpc r25, r15 17c4: 60 f0 brcs .+24 ; 0x17de { Value += 5; /* for automatic rounding */ 17c6: 6b 5f subi r22, 0xFB ; 251 17c8: 7f 4f sbci r23, 0xFF ; 255 17ca: 8f 4f sbci r24, 0xFF ; 255 17cc: 9f 4f sbci r25, 0xFF ; 255 Value = Value / 10; /* scale down by 10^1 */ 17ce: a5 01 movw r20, r10 17d0: 94 01 movw r18, r8 17d2: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 17d6: ca 01 movw r24, r20 17d8: b9 01 movw r22, r18 17da: 1f 5f subi r17, 0xFF ; 255 17dc: ef cf rjmp .-34 ; 0x17bc * determine prefix */ Length = Exponent + 12; 17de: 0c e0 ldi r16, 0x0C ; 12 17e0: 01 0f add r16, r17 if ((int8_t)Length < 0) Length = 0; /* Limit to minimum prefix */ 17e2: 07 fd sbrc r16, 7 17e4: 04 c0 rjmp .+8 ; 0x17ee if (Length > 18) Length = 18; /* Limit to maximum prefix */ 17e6: 03 31 cpi r16, 0x13 ; 19 17e8: 18 f0 brcs .+6 ; 0x17f0 17ea: 02 e1 ldi r16, 0x12 ; 18 17ec: 01 c0 rjmp .+2 ; 0x17f0 */ Length = Exponent + 12; if ((int8_t)Length < 0) Length = 0; /* Limit to minimum prefix */ 17ee: 00 e0 ldi r16, 0x00 ; 0 if (Length > 18) Length = 18; /* Limit to maximum prefix */ Index = Length / 3; 17f0: 1b ea ldi r17, 0xAB ; 171 17f2: 01 9f mul r16, r17 17f4: 11 2d mov r17, r1 17f6: 11 24 eor r1, r1 17f8: 16 95 lsr r17 Offset = Length % 3; 17fa: 21 2f mov r18, r17 17fc: 22 0f add r18, r18 17fe: 21 0f add r18, r17 1800: 02 1b sub r16, r18 if (Offset > 0) 1802: 21 f0 breq .+8 ; 0x180c { Index++; /* adjust index for exponent offset, take next prefix */ 1804: 1f 5f subi r17, 0xFF ; 255 Offset = 3 - Offset; /* reverse value (1 or 2) */ 1806: 23 e0 ldi r18, 0x03 ; 3 1808: 20 1b sub r18, r16 180a: 02 2f mov r16, r18 } /* convert value into string */ #ifdef WITH_MENU ultoa(Value, OutBuffer, 10); 180c: 2a e0 ldi r18, 0x0A ; 10 180e: 30 e0 ldi r19, 0x00 ; 0 1810: 49 e3 ldi r20, 0x39 ; 57 1812: 51 e0 ldi r21, 0x01 ; 1 1814: 0e 94 9c 39 call 0x7338 ; 0x7338 #else utoa((unsigned int)Value, OutBuffer, 10); #endif Length = strlen(OutBuffer); 1818: a9 e3 ldi r26, 0x39 ; 57 181a: b1 e0 ldi r27, 0x01 ; 1 181c: 0d 90 ld r0, X+ 181e: 00 20 and r0, r0 1820: e9 f7 brne .-6 ; 0x181c 1822: 11 97 sbiw r26, 0x01 ; 1 1824: a9 53 subi r26, 0x39 ; 57 1826: b1 40 sbci r27, 0x01 ; 1 1828: ba 2e mov r11, r26 182a: 9d 01 movw r18, r26 182c: 33 27 eor r19, r19 #ifdef WITH_MENU #ifdef NO_NANO if ((Length > (4+Offset)) && (Index != 0)) #else if (Length > (4+Offset)) 182e: 80 2f mov r24, r16 1830: 90 e0 ldi r25, 0x00 ; 0 1832: 04 96 adiw r24, 0x04 ; 4 1834: 82 17 cp r24, r18 1836: 93 07 cpc r25, r19 1838: 14 f4 brge .+4 ; 0x183e #endif { Index++; /* take next prefix for better readable string */ 183a: 1f 5f subi r17, 0xFF ; 255 Offset += 3; /* decimal point 3 to the left */ 183c: 0d 5f subi r16, 0xFD ; 253 } #endif Prefix = MEM_read_byte((uint8_t *)(&PrefixTab[Index])); /* look up prefix in table */ 183e: e1 2f mov r30, r17 1840: f0 e0 ldi r31, 0x00 ; 0 1842: eb 5a subi r30, 0xAB ; 171 1844: fe 4f sbci r31, 0xFE ; 254 1846: a4 90 lpm r10, Z /* position of dot */ Exponent = Length - Offset; /* calculate position */ 1848: da 2f mov r29, r26 184a: d0 1b sub r29, r16 if (Exponent <= 0) /* we have to prepend "0." */ 184c: 1d 16 cp r1, r29 184e: 44 f0 brlt .+16 ; 0x1860 /* 0: factor 10 / -1: factor 100 */ // lcd_data('0'); lcd_data('.'); 1850: 8e e2 ldi r24, 0x2E ; 46 1852: 0e 94 3f 0a call 0x147e ; 0x147e } #else if (Exponent < 0) lcd_data('0'); /* extra 0 for factor 100 */ 1856: dd 23 and r29, r29 1858: 19 f0 breq .+6 ; 0x1860 185a: 80 e3 ldi r24, 0x30 ; 48 185c: 0e 94 3f 0a call 0x147e ; 0x147e } if (Offset == 0) Exponent = -1; /* disable dot if not needed */ 1860: 01 11 cpse r16, r1 1862: 01 c0 rjmp .+2 ; 0x1866 1864: df ef ldi r29, 0xFF ; 255 1866: 49 e3 ldi r20, 0x39 ; 57 1868: e4 2e mov r14, r20 186a: 41 e0 ldi r20, 0x01 ; 1 186c: f4 2e mov r15, r20 /* display value and add dot if requested */ Index = 0; while (Index < Length) /* loop through string */ 186e: 87 01 movw r16, r14 lcd_data(OutBuffer[Index]); /* display char */ Index++; /* next one */ if (Index == Exponent) { 1870: cd 2e mov r12, r29 1872: dd 24 eor r13, r13 1874: c7 fc sbrc r12, 7 1876: d0 94 com r13 1878: 80 2f mov r24, r16 187a: 8e 19 sub r24, r14 /* display value and add dot if requested */ Index = 0; while (Index < Length) /* loop through string */ 187c: 8b 15 cp r24, r11 187e: 78 f4 brcc .+30 ; 0x189e { lcd_data(OutBuffer[Index]); /* display char */ 1880: f8 01 movw r30, r16 1882: 81 91 ld r24, Z+ 1884: 8f 01 movw r16, r30 1886: 0e 94 3f 0a call 0x147e ; 0x147e 188a: 98 01 movw r18, r16 188c: 29 53 subi r18, 0x39 ; 57 188e: 31 40 sbci r19, 0x01 ; 1 Index++; /* next one */ if (Index == Exponent) { 1890: 2c 15 cp r18, r12 1892: 3d 05 cpc r19, r13 1894: 89 f7 brne .-30 ; 0x1878 lcd_data('.'); /* display dot */ 1896: 8e e2 ldi r24, 0x2E ; 46 1898: 0e 94 3f 0a call 0x147e ; 0x147e 189c: ed cf rjmp .-38 ; 0x1878 /* display prefix and unit */ if (Prefix != 0) { 189e: aa 20 and r10, r10 18a0: 19 f0 breq .+6 ; 0x18a8 lcd_data(Prefix); 18a2: 8a 2d mov r24, r10 18a4: 0e 94 3f 0a call 0x147e ; 0x147e } if (Unit != 0) { 18a8: cc 23 and r28, r28 18aa: 91 f0 breq .+36 ; 0x18d0 lcd_data(Unit); 18ac: 8c 2f mov r24, r28 18ae: 0e 94 3f 0a call 0x147e ; 0x147e 18b2: 0e c0 rjmp .+28 ; 0x18d0 Limit = 100; /* scale value down to 2 digits */ if (digits == 3) Limit = 1000; /* scale value down to 3 digits */ 18b4: 38 ee ldi r19, 0xE8 ; 232 18b6: c3 2e mov r12, r19 18b8: 33 e0 ldi r19, 0x03 ; 3 18ba: d3 2e mov r13, r19 18bc: e1 2c mov r14, r1 18be: f1 2c mov r15, r1 18c0: 78 cf rjmp .-272 ; 0x17b2 if (digits == 4) Limit = 10000; /* scale value down to 4 digits */ 18c2: 20 e1 ldi r18, 0x10 ; 16 18c4: c2 2e mov r12, r18 18c6: 27 e2 ldi r18, 0x27 ; 39 18c8: d2 2e mov r13, r18 18ca: e1 2c mov r14, r1 18cc: f1 2c mov r15, r1 18ce: 71 cf rjmp .-286 ; 0x17b2 if (Unit != 0) { lcd_data(Unit); } return; } 18d0: cd b7 in r28, 0x3d ; 61 18d2: de b7 in r29, 0x3e ; 62 18d4: ec e0 ldi r30, 0x0C ; 12 18d6: 0c 94 5f 39 jmp 0x72be ; 0x72be <__epilogue_restores__+0xc> 000018da : void Display_mV(uint16_t xx, uint8_t ll) { 18da: 0f 93 push r16 18dc: 06 2f mov r16, r22 DisplayValue((long)xx,-3,'V',ll); 18de: bc 01 movw r22, r24 18e0: 80 e0 ldi r24, 0x00 ; 0 18e2: 90 e0 ldi r25, 0x00 ; 0 18e4: 26 e5 ldi r18, 0x56 ; 86 18e6: 4d ef ldi r20, 0xFD ; 253 18e8: 0e 94 a8 0b call 0x1750 ; 0x1750 } 18ec: 0f 91 pop r16 18ee: 08 95 ret 000018f0 : void lcd_draw_pin(unsigned char index, char dx, char dy) { const unsigned char *pbmp; pbmp = (const unsigned char *)pgm_read_word(&bmp_number[index]); 18f0: e8 2f mov r30, r24 18f2: f0 e0 ldi r31, 0x00 ; 0 18f4: ee 0f add r30, r30 18f6: ff 1f adc r31, r31 18f8: e8 58 subi r30, 0x88 ; 136 18fa: ff 4f sbci r31, 0xFF ; 255 18fc: 85 91 lpm r24, Z+ 18fe: 94 91 lpm r25, Z lcd_pgm_bitmap(pbmp, icon_xx + dx, icon_yy + dy, 0); 1900: 20 91 00 01 lds r18, 0x0100 1904: 42 0f add r20, r18 1906: 20 91 12 01 lds r18, 0x0112 190a: 62 0f add r22, r18 190c: 20 e0 ldi r18, 0x00 ; 0 190e: 0e 94 ce 0a call 0x159c ; 0x159c 1912: 08 95 ret 00001914 : //***************************************************************************** // Draw the transistor pin numbers of transistor _trans to the last icon location // only the position of the base pin is selectable void lcd_draw_trans_pins( char dxb, char dyb) { 1914: cf 93 push r28 1916: df 93 push r29 1918: c8 2f mov r28, r24 191a: d6 2f mov r29, r22 // const unsigned char *pbmp; lcd_draw_pin(_trans->e, 30, 24); // relative to icon position 191c: e0 91 48 01 lds r30, 0x0148 1920: f0 91 49 01 lds r31, 0x0149 1924: 48 e1 ldi r20, 0x18 ; 24 1926: 6e e1 ldi r22, 0x1E ; 30 1928: 86 85 ldd r24, Z+14 ; 0x0e 192a: 0e 94 78 0c call 0x18f0 ; 0x18f0 lcd_draw_pin(_trans->b, dxb, dyb); // relative to icon position 192e: e0 91 48 01 lds r30, 0x0148 1932: f0 91 49 01 lds r31, 0x0149 1936: 4d 2f mov r20, r29 1938: 6c 2f mov r22, r28 193a: 84 85 ldd r24, Z+12 ; 0x0c 193c: 0e 94 78 0c call 0x18f0 ; 0x18f0 lcd_draw_pin(_trans->c, 30, 0); // relative to icon position 1940: e0 91 48 01 lds r30, 0x0148 1944: f0 91 49 01 lds r31, 0x0149 1948: 40 e0 ldi r20, 0x00 ; 0 194a: 6e e1 ldi r22, 0x1E ; 30 194c: 85 85 ldd r24, Z+13 ; 0x0d 194e: 0e 94 78 0c call 0x18f0 ; 0x18f0 } 1952: df 91 pop r29 1954: cf 91 pop r28 1956: 08 95 ret 00001958 : //***************************************************************************** // Show all Icons on the screen, up to four at one screen void ShowIcons(void) { 1958: cf 93 push r28 #define ShowTime 15000 /* 15 seconds wait time, or key press, or rotary encoder movement */ uint8_t cc; lcd_clear(); 195a: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_big_icon(BJT_NPN|LCD_UPPER_LEFT); 195e: 80 e3 ldi r24, 0x30 ; 48 1960: 0e 94 f5 09 call 0x13ea ; 0x13ea lcd_update_icon_opt(bmp_vakdiode, OPT_VREVERSE); 1964: 62 e0 ldi r22, 0x02 ; 2 1966: 80 e9 ldi r24, 0x90 ; 144 1968: 90 e0 ldi r25, 0x00 ; 0 196a: 0e 94 22 0a call 0x1444 ; 0x1444 lcd_big_icon(BJT_NPN|LCD_UPPER_RIGHT); 196e: 80 e2 ldi r24, 0x20 ; 32 1970: 0e 94 f5 09 call 0x13ea ; 0x13ea lcd_update_icon(bmp_pnp); // update for PNP 1974: 85 ec ldi r24, 0xC5 ; 197 1976: 90 e0 ldi r25, 0x00 ; 0 1978: 0e 94 3b 0a call 0x1476 ; 0x1476 lcd_set_cursor(5,0); 197c: 60 e0 ldi r22, 0x00 ; 0 197e: 85 e0 ldi r24, 0x05 ; 5 1980: 0e 94 a6 08 call 0x114c ; 0x114c lcd_MEM_string(NPN_str); 1984: 8b ea ldi r24, 0xAB ; 171 1986: 93 e0 ldi r25, 0x03 ; 3 1988: 0e 94 bf 0a call 0x157e ; 0x157e lcd_set_cursor(5,(LCD_LINE_LENGTH / 2)); 198c: 68 e0 ldi r22, 0x08 ; 8 198e: 85 e0 ldi r24, 0x05 ; 5 1990: 0e 94 a6 08 call 0x114c ; 0x114c lcd_MEM_string(PNP_str); 1994: 83 ea ldi r24, 0xA3 ; 163 1996: 93 e0 ldi r25, 0x03 ; 3 1998: 0e 94 bf 0a call 0x157e ; 0x157e wait_for_key_ms(ShowTime); 199c: 88 e9 ldi r24, 0x98 ; 152 199e: 9a e3 ldi r25, 0x3A ; 58 19a0: 0e 94 de 0e call 0x1dbc ; 0x1dbc lcd_clear(); 19a4: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_big_icon(N_JFET|LCD_LOWER_LEFT); 19a8: 83 e1 ldi r24, 0x13 ; 19 19aa: 0e 94 f5 09 call 0x13ea ; 0x13ea lcd_big_icon(N_JFET|LCD_LOWER_RIGHT); 19ae: 83 e0 ldi r24, 0x03 ; 3 19b0: 0e 94 f5 09 call 0x13ea ; 0x13ea lcd_update_icon(bmp_p_jfet); // update to P_JFET 19b4: 8e ec ldi r24, 0xCE ; 206 19b6: 90 e0 ldi r25, 0x00 ; 0 19b8: 0e 94 3b 0a call 0x1476 ; 0x1476 lcd_set_cursor(2,1); 19bc: 61 e0 ldi r22, 0x01 ; 1 19be: 82 e0 ldi r24, 0x02 ; 2 19c0: 0e 94 a6 08 call 0x114c ; 0x114c lcd_data('N'); 19c4: 8e e4 ldi r24, 0x4E ; 78 19c6: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('-'); 19ca: 8d e2 ldi r24, 0x2D ; 45 19cc: 0e 94 3f 0a call 0x147e ; 0x147e lcd_MEM_string(jfet_str); 19d0: 85 ec ldi r24, 0xC5 ; 197 19d2: 93 e0 ldi r25, 0x03 ; 3 19d4: 0e 94 bf 0a call 0x157e ; 0x157e lcd_set_cursor(2,1+(LCD_LINE_LENGTH / 2)); 19d8: 69 e0 ldi r22, 0x09 ; 9 19da: 82 e0 ldi r24, 0x02 ; 2 19dc: 0e 94 a6 08 call 0x114c ; 0x114c lcd_data('P'); 19e0: 80 e5 ldi r24, 0x50 ; 80 19e2: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('-'); 19e6: 8d e2 ldi r24, 0x2D ; 45 19e8: 0e 94 3f 0a call 0x147e ; 0x147e lcd_MEM_string(jfet_str); 19ec: 85 ec ldi r24, 0xC5 ; 197 19ee: 93 e0 ldi r25, 0x03 ; 3 19f0: 0e 94 bf 0a call 0x157e ; 0x157e wait_for_key_ms(ShowTime); 19f4: 88 e9 ldi r24, 0x98 ; 152 19f6: 9a e3 ldi r25, 0x3A ; 58 19f8: 0e 94 de 0e call 0x1dbc ; 0x1dbc lcd_clear(); 19fc: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_big_icon(N_E_IGBT|LCD_UPPER_LEFT); 1a00: 81 e3 ldi r24, 0x31 ; 49 1a02: 0e 94 f5 09 call 0x13ea ; 0x13ea lcd_big_icon(N_E_IGBT|LCD_UPPER_RIGHT); 1a06: 81 e2 ldi r24, 0x21 ; 33 1a08: 0e 94 f5 09 call 0x13ea ; 0x13ea lcd_update_icon(bmp_p_e_igbt); // update to P-E-IGBT 1a0c: 87 e2 ldi r24, 0x27 ; 39 1a0e: 91 e0 ldi r25, 0x01 ; 1 1a10: 0e 94 3b 0a call 0x1476 ; 0x1476 lcd_set_cursor(5,0); 1a14: 60 e0 ldi r22, 0x00 ; 0 1a16: 85 e0 ldi r24, 0x05 ; 5 1a18: 0e 94 a6 08 call 0x114c ; 0x114c lcd_data('N'); 1a1c: 8e e4 ldi r24, 0x4E ; 78 1a1e: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('-'); 1a22: 8d e2 ldi r24, 0x2D ; 45 1a24: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('E'); 1a28: 85 e4 ldi r24, 0x45 ; 69 1a2a: 0e 94 3f 0a call 0x147e ; 0x147e lcd_MEM_string(igbt_str); 1a2e: 8f eb ldi r24, 0xBF ; 191 1a30: 93 e0 ldi r25, 0x03 ; 3 1a32: 0e 94 bf 0a call 0x157e ; 0x157e lcd_set_cursor(6,(LCD_LINE_LENGTH / 2)); 1a36: 68 e0 ldi r22, 0x08 ; 8 1a38: 86 e0 ldi r24, 0x06 ; 6 1a3a: 0e 94 a6 08 call 0x114c ; 0x114c lcd_data('P'); 1a3e: 80 e5 ldi r24, 0x50 ; 80 1a40: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('-'); 1a44: 8d e2 ldi r24, 0x2D ; 45 1a46: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('E'); 1a4a: 85 e4 ldi r24, 0x45 ; 69 1a4c: 0e 94 3f 0a call 0x147e ; 0x147e lcd_MEM_string(igbt_str); 1a50: 8f eb ldi r24, 0xBF ; 191 1a52: 93 e0 ldi r25, 0x03 ; 3 1a54: 0e 94 bf 0a call 0x157e ; 0x157e wait_for_key_ms(ShowTime); 1a58: 88 e9 ldi r24, 0x98 ; 152 1a5a: 9a e3 ldi r25, 0x3A ; 58 1a5c: 0e 94 de 0e call 0x1dbc ; 0x1dbc lcd_clear(); 1a60: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_big_icon(N_E_IGBT|LCD_LOWER_LEFT); 1a64: 81 e1 ldi r24, 0x11 ; 17 1a66: 0e 94 f5 09 call 0x13ea ; 0x13ea lcd_update_icon(bmp_n_d_igbt); // update to N-D-IGBT 1a6a: 8b e1 ldi r24, 0x1B ; 27 1a6c: 91 e0 ldi r25, 0x01 ; 1 1a6e: 0e 94 3b 0a call 0x1476 ; 0x1476 lcd_big_icon(N_E_IGBT|LCD_LOWER_RIGHT); 1a72: 81 e0 ldi r24, 0x01 ; 1 1a74: 0e 94 f5 09 call 0x13ea ; 0x13ea lcd_update_icon(bmp_p_d_igbt); // update to P-D-IGBT 1a78: 87 ef ldi r24, 0xF7 ; 247 1a7a: 90 e0 ldi r25, 0x00 ; 0 1a7c: 0e 94 3b 0a call 0x1476 ; 0x1476 lcd_set_cursor(1,0); 1a80: 60 e0 ldi r22, 0x00 ; 0 1a82: 81 e0 ldi r24, 0x01 ; 1 1a84: 0e 94 a6 08 call 0x114c ; 0x114c lcd_data('N'); 1a88: 8e e4 ldi r24, 0x4E ; 78 1a8a: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('-'); 1a8e: 8d e2 ldi r24, 0x2D ; 45 1a90: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('D'); 1a94: 84 e4 ldi r24, 0x44 ; 68 1a96: 0e 94 3f 0a call 0x147e ; 0x147e lcd_MEM_string(igbt_str); 1a9a: 8f eb ldi r24, 0xBF ; 191 1a9c: 93 e0 ldi r25, 0x03 ; 3 1a9e: 0e 94 bf 0a call 0x157e ; 0x157e lcd_set_cursor(2,(LCD_LINE_LENGTH / 2)); 1aa2: 68 e0 ldi r22, 0x08 ; 8 1aa4: 82 e0 ldi r24, 0x02 ; 2 1aa6: 0e 94 a6 08 call 0x114c ; 0x114c lcd_data('P'); 1aaa: 80 e5 ldi r24, 0x50 ; 80 1aac: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('-'); 1ab0: 8d e2 ldi r24, 0x2D ; 45 1ab2: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('D'); 1ab6: 84 e4 ldi r24, 0x44 ; 68 1ab8: 0e 94 3f 0a call 0x147e ; 0x147e lcd_MEM_string(igbt_str); 1abc: 8f eb ldi r24, 0xBF ; 191 1abe: 93 e0 ldi r25, 0x03 ; 3 1ac0: 0e 94 bf 0a call 0x157e ; 0x157e wait_for_key_ms(ShowTime); 1ac4: 88 e9 ldi r24, 0x98 ; 152 1ac6: 9a e3 ldi r25, 0x3A ; 58 1ac8: 0e 94 de 0e call 0x1dbc ; 0x1dbc lcd_clear(); 1acc: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_big_icon(N_E_MOS|LCD_UPPER_LEFT); 1ad0: 82 e3 ldi r24, 0x32 ; 50 1ad2: 0e 94 f5 09 call 0x13ea ; 0x13ea lcd_big_icon(N_E_MOS|LCD_UPPER_RIGHT); 1ad6: 82 e2 ldi r24, 0x22 ; 34 1ad8: 0e 94 f5 09 call 0x13ea ; 0x13ea lcd_update_icon(bmp_p_e_mos); // update to P-E-MOS 1adc: 8d ee ldi r24, 0xED ; 237 1ade: 90 e0 ldi r25, 0x00 ; 0 1ae0: 0e 94 3b 0a call 0x1476 ; 0x1476 lcd_set_cursor(5,0); 1ae4: 60 e0 ldi r22, 0x00 ; 0 1ae6: 85 e0 ldi r24, 0x05 ; 5 1ae8: 0e 94 a6 08 call 0x114c ; 0x114c lcd_data('N'); 1aec: 8e e4 ldi r24, 0x4E ; 78 1aee: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('-'); 1af2: 8d e2 ldi r24, 0x2D ; 45 1af4: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('E'); 1af8: 85 e4 ldi r24, 0x45 ; 69 1afa: 0e 94 3f 0a call 0x147e ; 0x147e lcd_MEM_string(mosfet_str); 1afe: 8a ec ldi r24, 0xCA ; 202 1b00: 93 e0 ldi r25, 0x03 ; 3 1b02: 0e 94 bf 0a call 0x157e ; 0x157e lcd_set_cursor(6,(LCD_LINE_LENGTH / 2)); 1b06: 68 e0 ldi r22, 0x08 ; 8 1b08: 86 e0 ldi r24, 0x06 ; 6 1b0a: 0e 94 a6 08 call 0x114c ; 0x114c lcd_data('P'); 1b0e: 80 e5 ldi r24, 0x50 ; 80 1b10: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('-'); 1b14: 8d e2 ldi r24, 0x2D ; 45 1b16: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('E'); 1b1a: 85 e4 ldi r24, 0x45 ; 69 1b1c: 0e 94 3f 0a call 0x147e ; 0x147e lcd_MEM_string(mosfet_str); 1b20: 8a ec ldi r24, 0xCA ; 202 1b22: 93 e0 ldi r25, 0x03 ; 3 1b24: 0e 94 bf 0a call 0x157e ; 0x157e wait_for_key_ms(ShowTime); 1b28: 88 e9 ldi r24, 0x98 ; 152 1b2a: 9a e3 ldi r25, 0x3A ; 58 1b2c: 0e 94 de 0e call 0x1dbc ; 0x1dbc lcd_clear(); 1b30: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_big_icon(N_E_MOS|LCD_LOWER_LEFT); 1b34: 82 e1 ldi r24, 0x12 ; 18 1b36: 0e 94 f5 09 call 0x13ea ; 0x13ea lcd_update_icon(bmp_n_d_mos); // update to N-D-MOS 1b3a: 87 ee ldi r24, 0xE7 ; 231 1b3c: 90 e0 ldi r25, 0x00 ; 0 1b3e: 0e 94 3b 0a call 0x1476 ; 0x1476 lcd_big_icon(N_E_MOS|LCD_LOWER_RIGHT); 1b42: 82 e0 ldi r24, 0x02 ; 2 1b44: 0e 94 f5 09 call 0x13ea ; 0x13ea lcd_update_icon(bmp_p_d_mos); // update to P-D-MOS 1b48: 85 ed ldi r24, 0xD5 ; 213 1b4a: 90 e0 ldi r25, 0x00 ; 0 1b4c: 0e 94 3b 0a call 0x1476 ; 0x1476 lcd_set_cursor(1,1); 1b50: 61 e0 ldi r22, 0x01 ; 1 1b52: 81 e0 ldi r24, 0x01 ; 1 1b54: 0e 94 a6 08 call 0x114c ; 0x114c lcd_data('N'); 1b58: 8e e4 ldi r24, 0x4E ; 78 1b5a: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('-'); 1b5e: 8d e2 ldi r24, 0x2D ; 45 1b60: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('D'); 1b64: 84 e4 ldi r24, 0x44 ; 68 1b66: 0e 94 3f 0a call 0x147e ; 0x147e lcd_MEM_string(mosfet_str); 1b6a: 8a ec ldi r24, 0xCA ; 202 1b6c: 93 e0 ldi r25, 0x03 ; 3 1b6e: 0e 94 bf 0a call 0x157e ; 0x157e lcd_set_cursor(2,1+(LCD_LINE_LENGTH / 2)); 1b72: 69 e0 ldi r22, 0x09 ; 9 1b74: 82 e0 ldi r24, 0x02 ; 2 1b76: 0e 94 a6 08 call 0x114c ; 0x114c lcd_data('P'); 1b7a: 80 e5 ldi r24, 0x50 ; 80 1b7c: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('-'); 1b80: 8d e2 ldi r24, 0x2D ; 45 1b82: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('D'); 1b86: 84 e4 ldi r24, 0x44 ; 68 1b88: 0e 94 3f 0a call 0x147e ; 0x147e lcd_MEM_string(mosfet_str); 1b8c: 8a ec ldi r24, 0xCA ; 202 1b8e: 93 e0 ldi r25, 0x03 ; 3 1b90: 0e 94 bf 0a call 0x157e ; 0x157e wait_for_key_ms(ShowTime); 1b94: 88 e9 ldi r24, 0x98 ; 152 1b96: 9a e3 ldi r25, 0x3A ; 58 1b98: 0e 94 de 0e call 0x1dbc ; 0x1dbc lcd_big_icon(DIODES_C_A_A_C|LCD_LOWER_RIGHT); wait_for_key_ms(ShowTime); #endif lcd_clear(); 1b9c: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_line1(); 1ba0: 0e 94 7c 08 call 0x10f8 ; 0x10f8 lcd_MEM_string(Resistor_str); // -[=]- 1ba4: 83 e4 ldi r24, 0x43 ; 67 1ba6: 92 e0 ldi r25, 0x02 ; 2 1ba8: 0e 94 bf 0a call 0x157e ; 0x157e lcd_line2(); 1bac: 0e 94 85 08 call 0x110a ; 0x110a lcd_MEM_string(Inductor_str); // -ww- 1bb0: 8e e3 ldi r24, 0x3E ; 62 1bb2: 92 e0 ldi r25, 0x02 ; 2 1bb4: 0e 94 bf 0a call 0x157e ; 0x157e lcd_line3(); 1bb8: 0e 94 90 08 call 0x1120 ; 0x1120 lcd_MEM_string(CapZeich); // capacitor sign 1bbc: 86 e8 ldi r24, 0x86 ; 134 1bbe: 93 e0 ldi r25, 0x03 ; 3 1bc0: 0e 94 bf 0a call 0x157e ; 0x157e lcd_line4(); 1bc4: 0e 94 9b 08 call 0x1136 ; 0x1136 lcd_MEM_string(AnKat); //"->|-" 1bc8: 81 e5 ldi r24, 0x51 ; 81 1bca: 92 e0 ldi r25, 0x02 ; 2 1bcc: 0e 94 bf 0a call 0x157e ; 0x157e lcd_space(); 1bd0: 0e 94 8b 0a call 0x1516 ; 0x1516 lcd_MEM_string(KatAn); //"-|<-" 1bd4: 8d e4 ldi r24, 0x4D ; 77 1bd6: 92 e0 ldi r25, 0x02 ; 2 1bd8: 0e 94 bf 0a call 0x157e ; 0x157e // show character set for (cc=0;cc<(0x7f-0x20);cc++) { 1bdc: c0 e0 ldi r28, 0x00 ; 0 if ((cc%16) == 0) { 1bde: 8c 2f mov r24, r28 1be0: 8f 70 andi r24, 0x0F ; 15 1be2: 89 f4 brne .+34 ; 0x1c06 // begin new line if((cc%64) == 0) { 1be4: 8c 2f mov r24, r28 1be6: 8f 73 andi r24, 0x3F ; 63 1be8: 31 f4 brne .+12 ; 0x1bf6 wait_for_key_ms(ShowTime); 1bea: 88 e9 ldi r24, 0x98 ; 152 1bec: 9a e3 ldi r25, 0x3A ; 58 1bee: 0e 94 de 0e call 0x1dbc ; 0x1dbc lcd_clear(); 1bf2: 0e 94 f9 08 call 0x11f2 ; 0x11f2 } lcd_set_cursor(((cc/16)%4)*2,0); 1bf6: 60 e0 ldi r22, 0x00 ; 0 1bf8: 8c 2f mov r24, r28 1bfa: 86 95 lsr r24 1bfc: 86 95 lsr r24 1bfe: 86 95 lsr r24 1c00: 86 70 andi r24, 0x06 ; 6 1c02: 0e 94 a6 08 call 0x114c ; 0x114c } lcd_data(cc+0x20); 1c06: 80 e2 ldi r24, 0x20 ; 32 1c08: 8c 0f add r24, r28 1c0a: 0e 94 3f 0a call 0x147e ; 0x147e lcd_space(); lcd_MEM_string(KatAn); //"-|<-" // show character set for (cc=0;cc<(0x7f-0x20);cc++) { 1c0e: cf 5f subi r28, 0xFF ; 255 1c10: cf 35 cpi r28, 0x5F ; 95 1c12: 29 f7 brne .-54 ; 0x1bde } lcd_set_cursor(((cc/16)%4)*2,0); } lcd_data(cc+0x20); } /* end for cc */ wait_for_key_ms(ShowTime); 1c14: 88 e9 ldi r24, 0x98 ; 152 1c16: 9a e3 ldi r25, 0x3A ; 58 1c18: 0e 94 de 0e call 0x1dbc ; 0x1dbc lcd_clear(); 1c1c: 0e 94 f9 08 call 0x11f2 ; 0x11f2 wait_for_key_ms(ShowTime); lcd_clear(); #endif } 1c20: cf 91 pop r28 1c22: 08 95 ret 00001c24 : .section .text uart_putc: #ifdef WITH_UART ; push bitcnt ; in temp,_SFR_IO_ADDR(SREG) push Txbyte ; save character 1c24: 8f 93 push r24 push bitcnt ; save register used for bit count 1c26: 2f 93 push r18 ldi bitcnt,10 ;1+8+sb (sb is # of stop bits) 1c28: 2a e0 ldi r18, 0x0A ; 10 com Txbyte ;Inverte everything 1c2a: 80 95 com r24 sbi SER_DDR,SERIAL_BIT ; enable output of serial bit 1c2c: 3b 9a sbi 0x07, 3 ; 7 sec ;Start bit 1c2e: 08 94 sec 00001c30 : putchar0: brcc putchar1 ;If carry set 1c30: 10 f4 brcc .+4 ; 0x1c36 #ifdef SWUART_INVERT sbi SER_PORT,SERIAL_BIT ; send a '0' #else cbi SER_PORT,SERIAL_BIT ; send a '0' 1c32: 43 98 cbi 0x08, 3 ; 8 #endif rjmp putchar2 ;else 1c34: 02 c0 rjmp .+4 ; 0x1c3a 00001c36 : putchar1: #ifdef SWUART_INVERT cbi SER_PORT,SERIAL_BIT ; send a '1' #else sbi SER_PORT,SERIAL_BIT ; send a '1' 1c36: 43 9a sbi 0x08, 3 ; 8 ... 00001c3a : #endif nop putchar2: rcall wait100us ; about 9600 Baud 1c3a: 20 d0 rcall .+64 ; 0x1c7c #if F_CPU >= 8000000UL rcall wait3us 1c3c: 27 d0 rcall .+78 ; 0x1c8c #endif lsr Txbyte ;Get next bit 1c3e: 86 95 lsr r24 dec bitcnt ;If not all bit sent 1c40: 2a 95 dec r18 brne putchar0 ; send next 1c42: b1 f7 brne .-20 ; 0x1c30 ;else pop bitcnt ; restore register used for bit count 1c44: 2f 91 pop r18 pop Txbyte ; restore character send 1c46: 8f 91 pop r24 ; out _SFR_IO_ADDR(SREG),temp ; pop bitcnt #endif ret ; return 1c48: 08 95 ret 00001c4a : ; Every wait call needs only one instruction (rcall). ; I see no way to implement this function with C-language (too tricky) wait5s: rcall wait1s ; 12+x return-adresses 1c4a: 03 d0 rcall .+6 ; 0x1c52 00001c4c : wait4s: rcall wait1s ; 12+x return-adresses 1c4c: 02 d0 rcall .+4 ; 0x1c52 00001c4e : ; run to wait3s wait3s: rcall wait1s ;1s 12+x Return-Adresses 1c4e: 01 d0 rcall .+2 ; 0x1c52 00001c50 : ; run to wait2s ;3s wait2s: rcall wait1s ;1s 12+x Return-Adresses 1c50: 00 d0 rcall .+0 ; 0x1c52 00001c52 : ; run to wait1s ,2s wait1s: wait1000ms: rcall wait500ms ;500ms 11+x Return-Adresses 1c52: 00 d0 rcall .+0 ; 0x1c54 00001c54 : ;laueft in wait500ms ;1s wait500ms: rcall wait100ms ;100ms 10+x Return-Adresses 1c54: 03 d0 rcall .+6 ; 0x1c5c 00001c56 : wait400ms: rcall wait100ms ;200ms 10+x Return-Adresses 1c56: 02 d0 rcall .+4 ; 0x1c5c 00001c58 : wait300ms: rcall wait100ms ;300ms 10+x Return-Adresses 1c58: 01 d0 rcall .+2 ; 0x1c5c 00001c5a : ; laeuft in wait200ms ;500ms 10+x Return-Adresses wait200ms: rcall wait100ms ;100ms 10+x Return-Adresses 1c5a: 00 d0 rcall .+0 ; 0x1c5c 00001c5c : ; laeuft in wait100ms ;200ms wait100ms: wdr ; alle 100ms ein Watchdog reset! 1c5c: a8 95 wdr rcall wait50ms ; 50ms 9+x Return-Adresses 1c5e: 00 d0 rcall .+0 ; 0x1c60 00001c60 : ;laeuft in wait50us ;100ms wait50ms: rcall wait10ms ;10ms 8+x Return-Adresses 1c60: 03 d0 rcall .+6 ; 0x1c68 00001c62 : wait40ms: rcall wait10ms ;20ms 8+x Return-Adresses 1c62: 02 d0 rcall .+4 ; 0x1c68 00001c64 : ;laeuft in wait30us ;50ms wait30ms: rcall wait10ms ;10ms 8+x Return-Adresses 1c64: 01 d0 rcall .+2 ; 0x1c68 00001c66 : ;laeuft in wait20us ;30ms wait20ms: rcall wait10ms ;10ms 8+x Return-Adresses 1c66: 00 d0 rcall .+0 ; 0x1c68 00001c68 : ; laeuft in wait10ms ;20ms wait10ms: rcall wait5ms ;5ms 7+x Return-Adresses 1c68: 00 d0 rcall .+0 ; 0x1c6a 00001c6a : ; laueft in wait5ms ;10ms wait5ms: rcall wait1ms ;1ms 6+x Return-Adresses 1c6a: 03 d0 rcall .+6 ; 0x1c72 00001c6c : wait4ms: rcall wait1ms ;2ms 6+x Return-Adresses 1c6c: 02 d0 rcall .+4 ; 0x1c72 00001c6e : ; laueft in wait3ms ;5ms wait3ms: rcall wait1ms ;1ms 6+x Return-Adresses 1c6e: 01 d0 rcall .+2 ; 0x1c72 00001c70 : ; laeuft in wait2ms ;3ms wait2ms: rcall wait1ms ;1ms 6+x Return-Adresses 1c70: 00 d0 rcall .+0 ; 0x1c72 00001c72 : ; laeuft in wait1ms ;2ms wait1ms: rcall wait500us ;500us 5+x Return-Adresses 1c72: 00 d0 rcall .+0 ; 0x1c74 00001c74 : ;laeuft in wait500us ;1ms wait500us: rcall wait100us ;100us 4+x Return-Adresses 1c74: 03 d0 rcall .+6 ; 0x1c7c 00001c76 : wait400us: rcall wait100us ;200us 4+x Return-Adresses 1c76: 02 d0 rcall .+4 ; 0x1c7c 00001c78 : ;laeuft in wait300us ;500us wait300us: rcall wait100us ;100us 4+x Return-Adresses 1c78: 01 d0 rcall .+2 ; 0x1c7c 00001c7a : ;laeuft in wait200us ;300us wait200us: rcall wait100us ;100us 4+x Return-Adresses 1c7a: 00 d0 rcall .+0 ; 0x1c7c 00001c7c : ; laeuft in wait100us ;200us wait100us: rcall wait50us ; 50us 3+x Return-Adresses 1c7c: 00 d0 rcall .+0 ; 0x1c7e 00001c7e : ; laeuft in wait50us ;100us wait50us: rcall wait10us ;10us 2+x Return-Adresses 1c7e: 03 d0 rcall .+6 ; 0x1c86 00001c80 : wait40us: rcall wait10us ;20us 1c80: 02 d0 rcall .+4 ; 0x1c86 00001c82 : ; laeuft in wait30us ;50us wait30us: rcall wait10us ;10us 2+x Return-Adresses 1c82: 01 d0 rcall .+2 ; 0x1c86 00001c84 : ; laeuft in wait20us ;20us wait20us: rcall wait10us ;10us 2+x Return-Adresses 1c84: 00 d0 rcall .+0 ; 0x1c86 00001c86 : wait1us: #endif #if F_CPU == 8000000 ; 8MHz Version x = 2 rcall wait5us ;5us 1c86: 00 d0 rcall .+0 ; 0x1c88 00001c88 : ; run directly to wait5us ;10us wait5us: rcall wait1us ;1us 1c88: 03 d0 rcall .+6 ; 0x1c90 00001c8a : wait4us: rcall wait1us ;2us 1c8a: 02 d0 rcall .+4 ; 0x1c90 00001c8c : wait3us: rcall wait1us ;3us 1c8c: 01 d0 rcall .+2 ; 0x1c90 00001c8e : wait2us: rcall wait1us 1c8e: 00 d0 rcall .+0 ; 0x1c90 00001c90 : ; run directly to wait1us wait1us: nop 1c90: 00 00 nop wait500ns: nop #endif #endif ret 1c92: 08 95 ret 00001c94 : ;/* set the processor to sleep state */ ;/* wake up will be done with compare match interrupt of counter 2 */ ; void sleep_5ms(uint8_t spause){ sleep_5ms: ldi r25, 0x00 ; pause = spause; 1c94: 90 e0 ldi r25, 0x00 ; 0 cpi r24, 201 1c96: 89 3c cpi r24, 0xC9 ; 201 brcs wloop ; if (spause > 200) 1c98: 28 f0 brcs .+10 ; 0x1ca4 ;// spause = 202 = 2s ;// spause = 203 = 3s ;// spause = 204 = 4s ;// spause = 205 = 5s subi r24, 0xC8 ; 200 pause = (spause-200) * 200; 1c9a: 88 5c subi r24, 0xC8 ; 200 ldi r20, 0xC8 ; 200 1c9c: 48 ec ldi r20, 0xC8 ; 200 mul r24, r20 ; (spause-200) * 200 1c9e: 84 9f mul r24, r20 movw r24, r0 ; r24:25 = (spause-200) * 200 1ca0: c0 01 movw r24, r0 eor r1, r1 1ca2: 11 24 eor r1, r1 00001ca4 : wloop: sbiw r24, 0x00 ; 0 while (pause > 0) 1ca4: 00 97 sbiw r24, 0x00 ; 0 brne check_remain 1ca6: 09 f4 brne .+2 ; 0x1caa #if 3000 <= RESTART_DELAY_US sts TIMSK2, r1 ; TIMSK2 = (0<: check_remain: #if 3000 > RESTART_DELAY_US lds r18, TCCR1B ; if (TCCR1B & ((1< ; timer 1 is running, don't use sleep RCALL wait5ms ; wait5ms(); 1cb2: db df rcall .-74 ; 0x1c6a sbiw r24, 1 ; pause -= 1; 1cb4: 01 97 sbiw r24, 0x01 ; 1 rjmp next_loop 1cb6: 16 c0 rjmp .+44 ; 0x1ce4 00001cb8 : do_sleep: cpi r24, 0x01 ; 1 1cb8: 81 30 cpi r24, 0x01 ; 1 cpc r25, r1 1cba: 91 05 cpc r25, r1 breq only_one ; if (pause > 1) 1cbc: 19 f0 breq .+6 ; 0x1cc4 sbiw r24, 0x02 ; pause -= 2; 1cbe: 02 97 sbiw r24, 0x02 ; 2 ; // Startup time is too long with 1MHz Clock!!!! ldi r19, DELAY_10ms ; t2_offset = (10000 - RESTART_DELAY_US) / T2_PERIOD; /* set to 10ms above the actual counter */ 1cc0: 3e e3 ldi r19, 0x3E ; 62 rjmp set_cntr 1cc2: 03 c0 rjmp .+6 ; 0x1cca 00001cc4 : only_one: ldi r19, DELAY_5ms ; t2_offset = (5000 - RESTART_DELAY_US) / T2_PERIOD; /* set to 5ms above the actual counter */ 1cc4: 37 e1 ldi r19, 0x17 ; 23 ldi r24, 0x00 ; pause = 0; 1cc6: 80 e0 ldi r24, 0x00 ; 0 ldi r25, 0x00 ; 0 1cc8: 90 e0 ldi r25, 0x00 ; 0 00001cca : set_cntr: lds r18, TCNT2 1cca: 20 91 b2 00 lds r18, 0x00B2 add r18, r19 ; + t2_offset 1cce: 23 0f add r18, r19 sts OCR2A, r18 ; OCR2A = TCNT2 + t2_offset; /* set the compare value */ 1cd0: 20 93 b3 00 sts 0x00B3, r18 ldi r20, ((0<: ; // restart delay ist too long, use normal delay of 5ms RCALL wait5ms ; wait5ms(); sbiw r24, 1 ; pause -= 1; #endif next_loop: wdr ; wdt_reset(); 1ce4: a8 95 wdr rjmp wloop 1ce6: de cf rjmp .-68 ; 0x1ca4 00001ce8 : W5msReadADC: ACALL wait5ms; ;// runs directly to ReadADC, this will replace "ACALL ReadADC + ret" #else W20msReadADC: push r24; 1ce8: 8f 93 push r24 ldi r24, 4; /* 4 * 5ms */ 1cea: 84 e0 ldi r24, 0x04 ; 4 RCALL sleep_5ms; 1cec: d3 df rcall .-90 ; 0x1c94 rjmp to_read; 1cee: 07 c0 rjmp .+14 ; 0x1cfe 00001cf0 : W10msReadADC: push r24; 1cf0: 8f 93 push r24 ldi r24, 2; /* 2 * 5ms */ 1cf2: 82 e0 ldi r24, 0x02 ; 2 RCALL sleep_5ms; 1cf4: cf df rcall .-98 ; 0x1c94 rjmp to_read; 1cf6: 03 c0 rjmp .+6 ; 0x1cfe 00001cf8 : W5msReadADC: push r24; 1cf8: 8f 93 push r24 ldi r24, 1; /* 1 * 5ms */ 1cfa: 81 e0 ldi r24, 0x01 ; 1 RCALL sleep_5ms; 1cfc: cb df rcall .-106 ; 0x1c94 00001cfe : to_read: pop r24; 1cfe: 8f 91 pop r24 00001d00 : ;unsigned int ReadADC(uint8_t Probe) ReadADC: ; //returns result of ADC port Probe scaled to mV resolution (unsigned int) ; unsigned long Value; push r17; 1d00: 1f 93 push r17 ; unsigned int U; /* return value (mV) */ ; uint8_t Samples; /* loop counter */ ; unsigned long Value; /* ADC value */ mov r17, r24; Probe 1d02: 18 2f mov r17, r24 ori r17, (1 << REFS0) ; Probe |= (1 << REFS0); /* use internal reference anyway */ 1d04: 10 64 ori r17, 0x40 ; 64 00001d06 : get_sample: AOUT ADMUX, r17 ; ADMUX = Probe; /* set input channel and U reference */ 1d06: 10 93 7c 00 sts 0x007C, r17 #ifdef AUTOSCALE_ADC /* if voltage reference changed run a dummy conversion */ mov r30, r17; 1d0a: e1 2f mov r30, r17 andi r30, (1 << REFS1) ; Samples = Probe & (1 << REFS1); /* get REFS1 bit flag */ 1d0c: e0 78 andi r30, 0x80 ; 128 lds r24, ADCconfig+RefFlag ; 1d0e: 80 91 30 01 lds r24, 0x0130 cp r30, r24; 1d12: e8 17 cp r30, r24 breq no_ref_change ; if (Samples != ADCconfig.RefFlag) 1d14: 59 f0 breq .+22 ; 0x1d2c sts ADCconfig+RefFlag, r30 ; ADCconfig.RefFlag = Samples; /* update flag */ 1d16: e0 93 30 01 sts 0x0130, r30 #ifdef NO_AREF_CAP RCALL wait100us ; wait100us(); /* time for voltage stabilization */ 1d1a: b0 df rcall .-160 ; 0x1c7c #else ldi r24, 2 ; /* 2 * 5ms */ RCALL sleep_5ms ; wait_about10ms() #endif #endif /* end NO_AREF_CAP */ StartADCwait ; // allways do one dummy read of ADC, 112us 1d1c: 8e e9 ldi r24, 0x9E ; 158 1d1e: 80 93 7a 00 sts 0x007A, r24 1d22: 83 e0 ldi r24, 0x03 ; 3 1d24: 83 bf out 0x33, r24 ; 51 1d26: 88 95 sleep 1d28: 82 e0 ldi r24, 0x02 ; 2 1d2a: 83 bf out 0x33, r24 ; 51 00001d2c : #endif /* end AUTOSCALE_ADC */ ;unsigned int ReadADC (uint8_t Probe) { no_ref_change: /* * sample ADC readings */ ldi r18, 0x00; Value = 0UL; /* reset sampling variable */ 1d2c: 20 e0 ldi r18, 0x00 ; 0 ldi r19, 0x00; 1d2e: 30 e0 ldi r19, 0x00 ; 0 movw r20, r18; 1d30: a9 01 movw r20, r18 ldi r30, 0x00; Samples = 0; /* number of samples to take */ 1d32: e0 e0 ldi r30, 0x00 ; 0 rjmp r2ae8 ; 1d34: 1f c0 rjmp .+62 ; 0x1d74 00001d36 : ; while (Samples < ADCconfig.Samples) /* take samples */ Loop: StartADCwait /* start ADC and wait */ 1d36: 8e e9 ldi r24, 0x9E ; 158 1d38: 80 93 7a 00 sts 0x007A, r24 1d3c: 83 e0 ldi r24, 0x03 ; 3 1d3e: 83 bf out 0x33, r24 ; 51 1d40: 88 95 sleep 1d42: 82 e0 ldi r24, 0x02 ; 2 1d44: 83 bf out 0x33, r24 ; 51 lds r22, ADCL; Value += ADCW; /* add ADC reading */ 1d46: 60 91 78 00 lds r22, 0x0078 lds r23, ADCH; 1d4a: 70 91 79 00 lds r23, 0x0079 add r18, r22; 1d4e: 26 0f add r18, r22 adc r19, r23; 1d50: 37 1f adc r19, r23 adc r20, r1; 1d52: 41 1d adc r20, r1 adc r21, r1; 1d54: 51 1d adc r21, r1 #ifdef AUTOSCALE_ADC ; /* auto-switch voltage reference for low readings */ ; if ((Samples == 4) && (ADCconfig.U_Bandgap > 255) && ((uint16_t)Value < 1024) && !(Probe & (1 << REFS1))) { cpi r30, 0x04; Samples == 4 1d56: e4 30 cpi r30, 0x04 ; 4 brne cnt_next ; if ((Samples == 4) && 1d58: 61 f4 brne .+24 ; 0x1d72 lds r24, ADCconfig+3; 1d5a: 80 91 32 01 lds r24, 0x0132 cpi r24,0; 1d5e: 80 30 cpi r24, 0x00 ; 0 breq cnt_next ; if ( && (ADCconfig.U_Bandgap > 255) ) 1d60: 41 f0 breq .+16 ; 0x1d72 ldi r24, hi8(1024) ; Value < 1024 1d62: 84 e0 ldi r24, 0x04 ; 4 cpi r18, lo8(1024) 1d64: 20 30 cpi r18, 0x00 ; 0 cpc r19, r24; 1d66: 38 07 cpc r19, r24 brcc cnt_next ; if ( && && ((uint16_t)Value < 1024) ) 1d68: 20 f4 brcc .+8 ; 0x1d72 sbrc r17, REFS1; 1d6a: 17 fd sbrc r17, 7 rjmp cnt_next ; if ( && && && !(Probe & (1 << REFS1))) 1d6c: 02 c0 rjmp .+4 ; 0x1d72 ori r17, (1 << REFS1); Probe |= (1 << REFS1); /* select internal bandgap reference */ 1d6e: 10 68 ori r17, 0x80 ; 128 #if (PROCESSOR_TYP == 644) || (PROCESSOR_TYP == 1280) cbr r17, (1< 00001d72 : #endif /* end AUTOSCALE_ADC */ cnt_next: subi r30, 0xFF; Samples++; /* one more done */ 1d72: ef 5f subi r30, 0xFF ; 255 00001d74 : r2ae8: lds r24, ADCconfig+Samples; 1d74: 80 91 2f 01 lds r24, 0x012F cp r30, r24 ; while (Samples < ADCconfig.Samples) /* take samples */ 1d78: e8 17 cp r30, r24 brcs Loop ; 1d7a: e8 f2 brcs .-70 ; 0x1d36 lds r22, ADCconfig+U_AVCC ; U = ADCconfig.U_AVCC; /* Vcc reference */ 1d7c: 60 91 33 01 lds r22, 0x0133 lds r23, ADCconfig+U_AVCC+1; 1d80: 70 91 34 01 lds r23, 0x0134 #ifdef AUTOSCALE_ADC ; /* * convert ADC reading to voltage * - single sample: U = ADC reading * U_ref / 1024 */ ; /* get voltage of reference used */ sbrs r17, REFS1 ; if (Probe & (1 << REFS1)) 1d84: 17 ff sbrs r17, 7 rjmp r2b02 ; 1d86: 04 c0 rjmp .+8 ; 0x1d90 lds r22, ADCconfig+U_Bandgap ; U = ADCconfig.U_Bandgap; /* bandgap reference */ 1d88: 60 91 31 01 lds r22, 0x0131 lds r23, ADCconfig+U_Bandgap+1; 1d8c: 70 91 32 01 lds r23, 0x0132 00001d90 : #endif /* end AUTOSCALE_ADC */ ; /* convert to voltage; */ r2b02: ldi r24, 0x00 ; Value *= U; /* ADC readings * U_ref */ 1d90: 80 e0 ldi r24, 0x00 ; 0 ldi r25, 0x00; 0 1d92: 90 e0 ldi r25, 0x00 ; 0 ACALL __mulsi3; ; sum(ADCreads) * ADC_reference 1d94: 0e 94 65 38 call 0x70ca ; 0x70ca <__mulsi3> ldi r18, lo8(1023) ; Value /= 1023; /* / 1024 for 10bit ADC */ 1d98: 2f ef ldi r18, 0xFF ; 255 ldi r19, hi8(1023); 1d9a: 33 e0 ldi r19, 0x03 ; 3 ldi r20, 0x00; 0 1d9c: 40 e0 ldi r20, 0x00 ; 0 ldi r21, 0x00; 0 1d9e: 50 e0 ldi r21, 0x00 ; 0 ACALL __udivmodsi4; R22-25 / R18-21 1da0: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> movw r22, r18; 1da4: b9 01 movw r22, r18 movw r24, r20; 1da6: ca 01 movw r24, r20 ; /* de-sample to get average voltage */ lds r18,ADCconfig+Samples ; Value /= ADCconfig.Samples; 1da8: 20 91 2f 01 lds r18, 0x012F ldi r19, 0x00; 0 1dac: 30 e0 ldi r19, 0x00 ; 0 ldi r20, 0x00; 0 1dae: 40 e0 ldi r20, 0x00 ; 0 ldi r21, 0x00; 0 1db0: 50 e0 ldi r21, 0x00 ; 0 ACALL __udivmodsi4; R22-25 / R18-21 1db2: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> movw r24, r18 ;;// return ((unsigned int)(Value / (1023 * (unsigned long)ADCconfig.Samples))); 1db6: c9 01 movw r24, r18 pop r17; 1db8: 1f 91 pop r17 ret; 1dba: 08 95 ret 00001dbc : /* wait max_time or previous key press */ /* return value: !=0 == key is pressed for x*10ms, 0 == no key pressed, time has expired */ /* Additionally the movement of rotary encoder is monitored, if */ /* the constant WITH_ROTARY_SWITCH is defined. */ /* *********************************************************** */ uint8_t wait_for_key_ms(int max_time) { 1dbc: ef 92 push r14 1dbe: ff 92 push r15 1dc0: 0f 93 push r16 1dc2: 1f 93 push r17 1dc4: cf 93 push r28 1dc6: df 93 push r29 1dc8: f8 2e mov r15, r24 1dca: e9 2e mov r14, r25 1dcc: c5 e6 ldi r28, 0x65 ; 101 if ((RST_PIN_REG & (1< } wdt_reset(); // wait_time++; if (count_time > 0) { // count only, if counter > 0 count_time -= 10; // 10 ms are done, count down if (count_time == 0) count_time = -1; // never count to zero, zero is endless! 1dd2: cf 2d mov r28, r15 1dd4: de 2d mov r29, r14 1dd6: 05 e5 ldi r16, 0x55 ; 85 1dd8: 10 e0 ldi r17, 0x00 ; 0 1dda: 1b c0 rjmp .+54 ; 0x1e12 WaitRotary(); // wait the predefined time } if (ww < WWend) break; #else if ((RST_PIN_REG & (1< 1de2: c1 50 subi r28, 0x01 ; 1 rotary.state[(rotary.ind+ROT_MSK-2)&ROT_MSK] = ' ' - '0'; // for debugging #endif #endif kk = 100; while (kk >= 0) { /* wait up to 500ms until key is released */ 1de4: a1 f7 brne .-24 ; 0x1dce 1de6: f5 cf rjmp .-22 ; 0x1dd2 for (ww=0; ww < (WWend*2) ;ww++) { check_rotary(); // check for change of switch state of the rotary encoder WaitRotary(); // wait the predefined time, total 10ms } #else wait_about10ms(); 1de8: 82 e0 ldi r24, 0x02 ; 2 1dea: 0e 94 4a 0e call 0x1c94 ; 0x1c94 #endif key_pressed += key_pressed; // multiply with 2 is shift to left 1dee: 00 0f add r16, r16 if ((RST_PIN_REG & (1< // If the key is pressed again... if (key_cs == 0) { 1dfa: 11 11 cpse r17, r1 1dfc: 03 c0 rjmp .+6 ; 0x1e04 // first time, when key down is detected key_cs = 4; // must be 7 times for 10ms hold down count_time = max_time; // begin new time period 1dfe: cf 2d mov r28, r15 1e00: de 2d mov r29, r14 key_pressed &= 0x3f; if(key_pressed == 0x3f) { // If the key is pressed again... if (key_cs == 0) { // first time, when key down is detected key_cs = 4; // must be 7 times for 10ms hold down 1e02: 14 e0 ldi r17, 0x04 ; 4 count_time = max_time; // begin new time period } key_cs++; // count the time, the key is hold down 1e04: 1f 5f subi r17, 0xFF ; 255 if (key_cs >= MAX_CS) break; 1e06: 16 39 cpi r17, 0x96 ; 150 1e08: 90 f4 brcc .+36 ; 0x1e2e } else { // key_pressed is zero, if the key is not pressed for 80 ms if ((key_pressed == 0) && (key_cs != 0)) break; // return, if key is released again } wdt_reset(); 1e0a: a8 95 wdr // wait_time++; if (count_time > 0) { // count only, if counter > 0 1e0c: 1c 16 cp r1, r28 1e0e: 1d 06 cpc r1, r29 1e10: 44 f0 brlt .+16 ; 0x1e22 key_pressed = 0x55; count_time = max_time; #ifdef WITH_ROTARY_SWITCH wait_time = 0; #endif while (count_time >= 0) { 1e12: d7 ff sbrs r29, 7 1e14: e9 cf rjmp .-46 ; 0x1de8 1e16: 0b c0 rjmp .+22 ; 0x1e2e } key_cs++; // count the time, the key is hold down if (key_cs >= MAX_CS) break; } else { // key_pressed is zero, if the key is not pressed for 80 ms if ((key_pressed == 0) && (key_cs != 0)) break; // return, if key is released again 1e18: 01 11 cpse r16, r1 1e1a: f7 cf rjmp .-18 ; 0x1e0a 1e1c: 11 23 and r17, r17 1e1e: a9 f3 breq .-22 ; 0x1e0a 1e20: 06 c0 rjmp .+12 ; 0x1e2e } wdt_reset(); // wait_time++; if (count_time > 0) { // count only, if counter > 0 count_time -= 10; // 10 ms are done, count down 1e22: 2a 97 sbiw r28, 0x0a ; 10 if (count_time == 0) count_time = -1; // never count to zero, zero is endless! 1e24: 20 97 sbiw r28, 0x00 ; 0 1e26: a9 f7 brne .-22 ; 0x1e12 1e28: cf ef ldi r28, 0xFF ; 255 1e2a: df ef ldi r29, 0xFF ; 255 1e2c: f2 cf rjmp .-28 ; 0x1e12 if ((wait_time > 20) && (rotary.count != 0)) break; if (wait_time > 20) wait_time = 0; // reset time window #endif } /* end while (count_time >= 0) */ return(key_cs); // return period key is pressed within the specified time } /* end wait_for_key_5ms( ) */ 1e2e: 81 2f mov r24, r17 1e30: cd b7 in r28, 0x3d ; 61 1e32: de b7 in r29, 0x3e ; 62 1e34: e6 e0 ldi r30, 0x06 ; 6 1e36: 0c 94 65 39 jmp 0x72ca ; 0x72ca <__epilogue_restores__+0x18> 00001e3a : #ifdef WAIT_LINE2_CLEAR /* *********************************************************** */ /* wait 5 seconds or previous key press, then clear last line of LCD and */ /* set the cursor to the beginning of last line */ /* *********************************************************** */ void wait_for_key_5s_line2(void) { 1e3a: cf 93 push r28 uint8_t current_line; current_line = lcd_save_position(); 1e3c: 0e 94 cd 08 call 0x119a ; 0x119a 1e40: c8 2f mov r28, r24 if (last_line_used != 0) { 1e42: 80 91 4a 01 lds r24, 0x014A 1e46: 88 23 and r24, r24 1e48: f9 f0 breq .+62 ; 0x1e88 if (current_line == (LCD_LINES-1)) { 1e4a: c3 30 cpi r28, 0x03 ; 3 1e4c: 59 f4 brne .+22 ; 0x1e64 // add a + sign at the last location of screen lcd_set_cursor(((LCD_LINES - 1) * PAGES_PER_LINE), (LCD_LINE_LENGTH - 1)); 1e4e: 6f e0 ldi r22, 0x0F ; 15 1e50: 86 e0 ldi r24, 0x06 ; 6 1e52: 0e 94 a6 08 call 0x114c ; 0x114c lcd_data('+'); 1e56: 8b e2 ldi r24, 0x2B ; 43 1e58: 0e 94 3f 0a call 0x147e ; 0x147e lcd_set_cursor(((LCD_LINES - 1) * PAGES_PER_LINE), (LCD_LINE_LENGTH - 1)); 1e5c: 6f e0 ldi r22, 0x0F ; 15 1e5e: 86 e0 ldi r24, 0x06 ; 6 1e60: 0e 94 a6 08 call 0x114c ; 0x114c do { if (wait_for_key_ms(SHORT_WAIT_TIME) > 0) break; // continue waiting, if the key is not pressed, but rotary switch is rotated } while (rotary.incre > 0); #else wait_for_key_ms(SHORT_WAIT_TIME); // wait until time is elapsed or key is pressed 1e64: 80 e4 ldi r24, 0x40 ; 64 1e66: 9f e1 ldi r25, 0x1F ; 31 1e68: 0e 94 de 0e call 0x1dbc ; 0x1dbc #endif if ((current_line == (LCD_LINES - 1)) && (last_line_used == 1)) { 1e6c: c3 30 cpi r28, 0x03 ; 3 1e6e: 51 f4 brne .+20 ; 0x1e84 1e70: 80 91 4a 01 lds r24, 0x014A 1e74: 81 30 cpi r24, 0x01 ; 1 1e76: 31 f4 brne .+12 ; 0x1e84 lcd_set_cursor((LCD_LINES-1) * PAGES_PER_LINE,0); 1e78: 60 e0 ldi r22, 0x00 ; 0 1e7a: 86 e0 ldi r24, 0x06 ; 6 1e7c: 0e 94 a6 08 call 0x114c ; 0x114c lcd_clear_line(); // clear the whole line 1e80: 0e 94 a1 0a call 0x1542 ; 0x1542 } lcd_restore_position(); 1e84: 0e 94 d6 08 call 0x11ac ; 0x11ac } /* end if last_line_used */ } /* end wait_for_key_5s_line2() */ 1e88: cf 91 pop r28 1e8a: 08 95 ret 00001e8c : RefVoltage: #ifdef AUTO_CAL ldi r24, lo8(ref_offset) ; 1 1e8c: 8c e0 ldi r24, 0x0C ; 12 ldi r25, hi8(ref_offset) ; 0 1e8e: 90 e0 ldi r25, 0x00 ; 0 ;; ACALL eeprom_read_word ; eeprom_read_word((uint16_t *)(&ref_offset)); ;; lds r18, ref_mv ;; lds r19, ref_mv+1 ;; add r18, r24 ; referenz = ref_mv + ;; adc r19, r25 ACALL eeprom_read_byte ; eeprom_read_word((uint16_t *)(&ref_offset)); done as two read_byte 1e90: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> mov r19, r24 1e94: 38 2f mov r19, r24 ldi r24, lo8(ref_offset+1) 1e96: 8d e0 ldi r24, 0x0D ; 13 ldi r25, hi8(ref_offset+1) 1e98: 90 e0 ldi r25, 0x00 ; 0 ACALL eeprom_read_byte 1e9a: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> lds r18, ref_mv 1e9e: 20 91 37 01 lds r18, 0x0137 add r18, r19 1ea2: 23 0f add r18, r19 lds r19, ref_mv+1 1ea4: 30 91 38 01 lds r19, 0x0138 adc r19, r24 1ea8: 38 1f adc r19, r24 lds r18, ref_mv lds r19, ref_mv+1 subi r18, -REF_C_KORR ; referenz = ref_mv + REF_C_KORR; adc r19, zero_reg #endif sts ref_mv_offs, r18 1eaa: 20 93 1c 01 sts 0x011C, r18 sts ref_mv_offs+1, r19 1eae: 30 93 1d 01 sts 0x011D, r19 #ifdef AUTO_RH ldi r24, hi8(Ref_Tab_Beginn) ; 3 1eb2: 83 e0 ldi r24, 0x03 ; 3 cpi r18, lo8(Ref_Tab_Beginn) ; 232 1eb4: 28 3e cpi r18, 0xE8 ; 232 cpc r19, r24 1eb6: 38 07 cpc r19, r24 brcs ad210e ; if (referenz >= Ref_Tab_Beginn) 1eb8: 20 f0 brcs .+8 ; 0x1ec2 movw r24, r18 1eba: c9 01 movw r24, r18 subi r24, lo8(Ref_Tab_Beginn) ; 232 referenz -= Ref_Tab_Beginn; 1ebc: 88 5e subi r24, 0xE8 ; 232 sbci r25, hi8(Ref_Tab_Beginn) ; 3 1ebe: 93 40 sbci r25, 0x03 ; 3 rjmp ad2112 1ec0: 02 c0 rjmp .+4 ; 0x1ec6 00001ec2 : ad210e: ldi r24, 0x00 ; referenz = 0; // limit to begin of table 1ec2: 80 e0 ldi r24, 0x00 ; 0 ldi r25, 0x00 ; 0 1ec4: 90 e0 ldi r25, 0x00 ; 0 00001ec6 : ad2112: ldi r22, lo8(Ref_Tab_Abstand) ; 50 tabind = referenz / Ref_Tab_Abstand; 1ec6: 62 e3 ldi r22, 0x32 ; 50 ldi r23, hi8(Ref_Tab_Abstand) ; 0 1ec8: 70 e0 ldi r23, 0x00 ; 0 ACALL __udivmodhi4 1eca: 0e 94 75 38 call 0x70ea ; 0x70ea <__udivmodhi4> ; r22 = tabind = referenz / Ref_Tab_Abstand; ; r24 = tabres = referenz % Ref_Tab_Abstand; cpi r22, 0x08 ; if (tabind > 7) 1ece: 68 30 cpi r22, 0x08 ; 8 brcs ad2120 1ed0: 08 f0 brcs .+2 ; 0x1ed4 ldi r22, 0x07 ; tabind = 7; // limit to end of table 1ed2: 67 e0 ldi r22, 0x07 ; 7 00001ed4 : ad2120: ; // interpolate the table of factors LDIZ RHtab 1ed4: e8 ef ldi r30, 0xF8 ; 248 1ed6: f4 e0 ldi r31, 0x04 ; 4 add r30, r22 1ed8: e6 0f add r30, r22 adc r31, zero_reg 1eda: f1 1d adc r31, r1 add r30, r22 1edc: e6 0f add r30, r22 adc r31, zero_reg 1ede: f1 1d adc r31, r1 lpm r20, Z+ ; y1 = pgm_read_word(&RHtab[tabind]); 1ee0: 45 91 lpm r20, Z+ lpm r21, Z+ 1ee2: 55 91 lpm r21, Z+ lpm r18, Z+ ; y2 = pgm_read_word(&RHtab[tabind+1]); 1ee4: 25 91 lpm r18, Z+ lpm r19, Z+ 1ee6: 35 91 lpm r19, Z+ ldi r22, Ref_Tab_Abstand ; 50 1ee8: 62 e3 ldi r22, 0x32 ; 50 sub r22, r24 ; tabres = Ref_Tab_Abstand-tabres; 1eea: 68 1b sub r22, r24 ; // interpolate the table of factors ; // RHmultip is the interpolated factor to compute capacity from load time with 470k ;; ldi r23, 0x00 ; 0 sub r20, r18 ; y1 - y2 1eec: 42 1b sub r20, r18 #if FLASHEND > 0x1fff sbc r21, r19 ; hi8(y1 - y2) is usually allway zero 1eee: 53 0b sbc r21, r19 #endif mul r22, r20 ; lo8(tabres) * lo8(y1-y2) 1ef0: 64 9f mul r22, r20 movw r24, r0 ; r24:25 = * 1ef2: c0 01 movw r24, r0 #if FLASHEND > 0x1fff mul r22, r21 ; lo8(tabres) * hi8(y1-y2) 1ef4: 65 9f mul r22, r21 add r25, r0 ; r25 + lo8(*) 1ef6: 90 0d add r25, r0 #endif ;; mul r23, r20 ; hi8(tabres) * lo8(y1*y2) , allways zero ;; add r25, r0 ; r25 + lo8(*) eor r1, r1 1ef8: 11 24 eor r1, r1 adiw r24, (Ref_Tab_Abstand/2) ; 25 1efa: 49 96 adiw r24, 0x19 ; 25 ldi r22, lo8(Ref_Tab_Abstand) ; 50 1efc: 62 e3 ldi r22, 0x32 ; 50 ldi r23, hi8(Ref_Tab_Abstand) ; 0 1efe: 70 e0 ldi r23, 0x00 ; 0 ACALL __udivmodhi4 ; ((y1 - y2) * tabres + (Ref_Tab_Abstand/2)) / Ref_Tab_Abstand 1f00: 0e 94 75 38 call 0x70ea ; 0x70ea <__udivmodhi4> add r22, r18 ; + y2 1f04: 62 0f add r22, r18 adc r23, r19 1f06: 73 1f adc r23, r19 sts RHmultip+1, r23 1f08: 70 93 7e 01 sts 0x017E, r23 sts RHmultip, r22 1f0c: 60 93 7d 01 sts 0x017D, r22 ldi r23, hi8(DEFAULT_RH_FAKT) sts RHmultip, r22 sts RHmultip+1, r23 #endif #ifdef AUTO_CAL ldi r24, lo8(RefDiff) 1f10: 8e e0 ldi r24, 0x0E ; 14 ldi r25, hi8(RefDiff) 1f12: 90 e0 ldi r25, 0x00 ; 0 ACALL eeprom_read_byte ; (int8_t)eeprom_read_byte((uint8_t *)&RefDiff)); 1f14: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> eor r25, r25 ; set zero for sign extend 1f18: 99 27 eor r25, r25 sbrc r24, 7 ; minus? 1f1a: 87 fd sbrc r24, 7 com r25 ; yes, set to 0xff 1f1c: 90 95 com r25 lds r22, ref_mv ; ADCconfig.U_Bandgap = (ref_mv + (int8_t)eeprom_read_byte((uint8_t *)&RefDiff)); 1f1e: 60 91 37 01 lds r22, 0x0137 lds r23, ref_mv+1 1f22: 70 91 38 01 lds r23, 0x0138 add r24, r22 1f26: 86 0f add r24, r22 adc r25, r23 1f28: 97 1f adc r25, r23 lds r25, ref_mv+1 add r24, r22 adc r25, r23 #endif #define U_Bandgap 2 sts ADCconfig+U_Bandgap+1, r25 1f2a: 90 93 32 01 sts 0x0132, r25 sts ADCconfig+U_Bandgap, r24 1f2e: 80 93 31 01 sts 0x0131, r24 sts adc_internal_reference+1, r25 ; adc_internal_reference = ADCconfig.U_Bandgap; 1f32: 90 93 7a 01 sts 0x017A, r25 sts adc_internal_reference, r24 1f36: 80 93 79 01 sts 0x0179, r24 ret 1f3a: 08 95 ret 00001f3c : .section .text ; // get_log interpolate a table with the function -log(1 - (permil/1000)) ; uint16_t get_log(uint16_t permil) { get_log: push r28 1f3c: cf 93 push r28 push r29 1f3e: df 93 push r29 ldi r18, lo8(Log_Tab_Distance) ;0x14 1f40: 24 e1 ldi r18, 0x14 ; 20 ldi r19, hi8(Log_Tab_Distance) ;0x00 1f42: 30 e0 ldi r19, 0x00 ; 0 movw r22, r18 1f44: b9 01 movw r22, r18 call __udivmodhi4 ; tabind = permil / Log_Tab_Distance; // index to table 1f46: 0e 94 75 38 call 0x70ea ; 0x70ea <__udivmodhi4> movw r26, r24 1f4a: dc 01 movw r26, r24 ; r26:27 = tabres = permil % Log_Tab_Distance; // fraction of table distance ; // interpolate the table of factors ; y1 = pgm_read_word(&LogTab[tabind]); // get the lower table value LDIZ LogTab; 1f4c: ea e0 ldi r30, 0x0A ; 10 1f4e: f5 e0 ldi r31, 0x05 ; 5 add r30, r22 1f50: e6 0f add r30, r22 adc r31, r23 1f52: f7 1f adc r31, r23 add r30, r22 1f54: e6 0f add r30, r22 adc r31, r23 ; &LogTab[tabind] 1f56: f7 1f adc r31, r23 lpm r28, Z+ ; y1 = pgm_read_word(&LogTab[tabind]); // get the lower table value 1f58: c5 91 lpm r28, Z+ lpm r29, Z+ 1f5a: d5 91 lpm r29, Z+ lpm r20, Z+ ; y2 = pgm_read_word(&LogTab[tabind+1]); // get the higher table value 1f5c: 45 91 lpm r20, Z+ lpm r21, Z+ 1f5e: 55 91 lpm r21, Z+ ; result = ((y2 - y1) * tabres ) / Log_Tab_Distance + y1; // interpolate sub r20, r28 ; (y2 - y1) 1f60: 4c 1b sub r20, r28 ;; sbc r21, r29 ; hi8(y2 - y1) is allways zero mul r20, r26 ; * tabres (maximum 19) 1f62: 4a 9f mul r20, r26 movw r24, r0 ; r24:25 = ((y2 - y1) * tabres ) 1f64: c0 01 movw r24, r0 ;; mul r20, r27 ; hi8(tabres) allways zero ;; add r25, r0 ;; mul r21, r26 ; hi8(y2 - Y1) always zero ;; add r25, r0 eor r1, r1 1f66: 11 24 eor r1, r1 movw r22, r18 ; Log_Tab_Distance 1f68: b9 01 movw r22, r18 call __udivmodhi4 ; ((y2 - y1) * tabres ) / Log_Tab_Distance 1f6a: 0e 94 75 38 call 0x70ea ; 0x70ea <__udivmodhi4> add r22, r28 ; result = ((y2 - y1) * tabres ) / Log_Tab_Distance + y1; // interpolate 1f6e: 6c 0f add r22, r28 adc r23, r29 1f70: 7d 1f adc r23, r29 movw r24, r22 ; return(result); 1f72: cb 01 movw r24, r22 pop r29 1f74: df 91 pop r29 pop r28 1f76: cf 91 pop r28 ret 1f78: 08 95 ret 00001f7a <__vector_7>: #define MAIN_C #include "Transistortester.h" #ifndef INHIBIT_SLEEP_MODE // prepare sleep mode EMPTY_INTERRUPT(TIMER2_COMPA_vect); 1f7a: 18 95 reti 00001f7c <__vector_21>: EMPTY_INTERRUPT(ADC_vect); 1f7c: 18 95 reti 00001f7e : } // end main /* init_parts initialize all parts to nothing found */ void init_parts(void) { PartFound = PART_NONE; // no part found 1f7e: 10 92 20 01 sts 0x0120, r1 NumOfDiodes = 0; // Number of diodes = 0 1f82: 10 92 1e 01 sts 0x011E, r1 ptrans.count = 0; // Number of found P type transistors 1f86: 10 92 74 01 sts 0x0174, r1 ntrans.count = 0; // Number of found N type transistors 1f8a: 10 92 5a 01 sts 0x015A, r1 PartMode = PART_MODE_NONE; 1f8e: 10 92 1f 01 sts 0x011F, r1 WithReference = 0; // no precision reference voltage 1f92: 10 92 47 01 sts 0x0147, r1 ResistorsFound = 0; // no resistors found 1f96: 10 92 7b 01 sts 0x017B, r1 ResistorChecked[0] = 0; 1f9a: 10 92 5f 01 sts 0x015F, r1 ResistorChecked[1] = 0; 1f9e: 10 92 60 01 sts 0x0160, r1 ResistorChecked[2] = 0; 1fa2: 10 92 61 01 sts 0x0161, r1 cap.ca = 0; 1fa6: 10 92 8f 01 sts 0x018F, r1 cap.cb = 0; 1faa: 10 92 90 01 sts 0x0190, r1 #if FLASHEND > 0x1fff inductor_lpre = 0; // mark as zero 1fae: 10 92 02 01 sts 0x0102, r1 #endif cap.cval_max = 0; // set max to zero 1fb2: 10 92 83 01 sts 0x0183, r1 1fb6: 10 92 84 01 sts 0x0184, r1 1fba: 10 92 85 01 sts 0x0185, r1 1fbe: 10 92 86 01 sts 0x0186, r1 cap.cpre_max = -12; // set max to pF unit 1fc2: 84 ef ldi r24, 0xF4 ; 244 1fc4: 80 93 92 01 sts 0x0192, r24 1fc8: 08 95 ret 00001fca : * - 0 if not shorted * - 1 if shorted */ uint8_t ShortedProbes(uint8_t Probe1, uint8_t Probe2) { 1fca: a1 e0 ldi r26, 0x01 ; 1 1fcc: b0 e0 ldi r27, 0x00 ; 0 1fce: eb ee ldi r30, 0xEB ; 235 1fd0: ff e0 ldi r31, 0x0F ; 15 1fd2: 0c 94 4b 39 jmp 0x7296 ; 0x7296 <__prologue_saves__+0x1c> * Set up a voltage divider between the two probes: * - Probe1: Rl pull-up * - Probe2: Rl pull-down */ ADC_DDR = TXD_MSK; // all-Pins to Input 1fd6: 98 e0 ldi r25, 0x08 ; 8 1fd8: 97 b9 out 0x07, r25 ; 7 ADC_PORT = TXD_VAL; // all ADC-Ports to GND 1fda: 98 b9 out 0x08, r25 ; 8 addr = &PinRLRHADCtab[Probe1]; 1fdc: e8 2f mov r30, r24 1fde: f0 e0 ldi r31, 0x00 ; 0 1fe0: e4 5a subi r30, 0xA4 ; 164 1fe2: fe 4f sbci r31, 0xFE ; 254 pp = pgm_read_byte(addr); 1fe4: 94 91 lpm r25, Z R_PORT = pp; 1fe6: 95 b9 out 0x05, r25 ; 5 addr += (int8_t)(Probe2-Probe1); 1fe8: 26 2f mov r18, r22 1fea: 28 1b sub r18, r24 1fec: e2 0f add r30, r18 1fee: f1 1d adc r31, r1 1ff0: 27 fd sbrc r18, 7 1ff2: fa 95 dec r31 R_DDR = pp | pgm_read_byte(addr); // pgm_read_byte(PinRHtab[Probe1]) | pgm_read_byte(PinRLtab[Probe2]); 1ff4: e4 91 lpm r30, Z 1ff6: e9 2b or r30, r25 1ff8: e4 b9 out 0x04, r30 ; 4 /* read voltages */ U1 = ReadADC(Probe1); 1ffa: 69 83 std Y+1, r22 ; 0x01 1ffc: 0e 94 80 0e call 0x1d00 ; 0x1d00 2000: 8c 01 movw r16, r24 U2 = ReadADC(Probe2); 2002: 69 81 ldd r22, Y+1 ; 0x01 2004: 86 2f mov r24, r22 2006: 0e 94 80 0e call 0x1d00 ; 0x1d00 * We expect both probe voltages to be about the same and * to be half of Vcc (allowed difference +/- 20mV). */ #define MAX_UH_DIFF 30 URH = ADCconfig.U_AVCC / 2; 200a: 20 91 33 01 lds r18, 0x0133 200e: 30 91 34 01 lds r19, 0x0134 2012: 36 95 lsr r19 2014: 27 95 ror r18 URH -= ((long)U_VCC * (long)(PIN_RP-PIN_RM)) / (4*(unsigned long)(R_L_VAL+PIN_RM)); // differenz of Pin resistance high (22) and low (20) if ((U1 > (URH - MAX_UH_DIFF)) && (U1 < (URH + MAX_UH_DIFF))) 2016: a9 01 movw r20, r18 2018: 41 52 subi r20, 0x21 ; 33 201a: 51 09 sbc r21, r1 201c: 40 17 cp r20, r16 201e: 51 07 cpc r21, r17 2020: 60 f4 brcc .+24 ; 0x203a 2022: 25 5e subi r18, 0xE5 ; 229 2024: 3f 4f sbci r19, 0xFF ; 255 2026: 02 17 cp r16, r18 2028: 13 07 cpc r17, r19 202a: 38 f4 brcc .+14 ; 0x203a { if ((U2 > (URH - MAX_UH_DIFF)) && (U2 < (URH + MAX_UH_DIFF))) 202c: 48 17 cp r20, r24 202e: 59 07 cpc r21, r25 2030: 20 f4 brcc .+8 ; 0x203a 2032: 41 e0 ldi r20, 0x01 ; 1 2034: 82 17 cp r24, r18 2036: 93 07 cpc r25, r19 2038: 08 f0 brcs .+2 ; 0x203c * - 1 if shorted */ uint8_t ShortedProbes(uint8_t Probe1, uint8_t Probe2) { uint8_t Flag1 = 0; /* return value */ 203a: 40 e0 ldi r20, 0x00 ; 0 Flag1 = 1; } } /* reset port */ R_DDR = 0; 203c: 14 b8 out 0x04, r1 ; 4 return Flag1; } 203e: 84 2f mov r24, r20 2040: 21 96 adiw r28, 0x01 ; 1 2042: e4 e0 ldi r30, 0x04 ; 4 2044: 0c 94 67 39 jmp 0x72ce ; 0x72ce <__epilogue_restores__+0x1c> 00002048 : * - 0 if no probes are short-circuited * - number of probe pairs short-circuited (3 = all) */ uint8_t AllProbesShorted(void) { 2048: cf 93 push r28 uint8_t Flag2; /* return value */ /* check all possible combinations */ Flag2 = ShortedProbes(TP1, TP2); 204a: 61 e0 ldi r22, 0x01 ; 1 204c: 80 e0 ldi r24, 0x00 ; 0 204e: 0e 94 e5 0f call 0x1fca ; 0x1fca 2052: c8 2f mov r28, r24 Flag2 += ShortedProbes(TP1, TP3); 2054: 62 e0 ldi r22, 0x02 ; 2 2056: 80 e0 ldi r24, 0x00 ; 0 2058: 0e 94 e5 0f call 0x1fca ; 0x1fca 205c: c8 0f add r28, r24 Flag2 += ShortedProbes(TP2, TP3); 205e: 62 e0 ldi r22, 0x02 ; 2 2060: 81 e0 ldi r24, 0x01 ; 1 2062: 0e 94 e5 0f call 0x1fca ; 0x1fca return Flag2; } 2066: 8c 0f add r24, r28 2068: cf 91 pop r28 206a: 08 95 ret 0000206c : // Selftest of the device and calibration #ifdef WITH_SELFTEST void AutoCheck(uint8_t test_mode) { 206c: a3 e1 ldi r26, 0x13 ; 19 206e: b0 e0 ldi r27, 0x00 ; 0 2070: ec e3 ldi r30, 0x3C ; 60 2072: f0 e1 ldi r31, 0x10 ; 16 2074: 0c 94 3d 39 jmp 0x727a ; 0x727a <__prologue_saves__> 2078: 18 2f mov r17, r24 #ifdef AUTOSCALE_ADC int8_t udiff; // difference between ADC Voltage with VCC or Bandgap reference int8_t udiff2; #endif #endif PartFound = PART_NONE; // no part found before 207a: 10 92 20 01 sts 0x0120, r1 if ((test_mode & 0xf0) == 0) { 207e: 80 7f andi r24, 0xF0 ; 240 2080: e9 f4 brne .+58 ; 0x20bc // probed should be shorted already to begin selftest if (AllProbesShorted() != 3) return; 2082: 0e 94 24 10 call 0x2048 ; 0x2048 2086: 83 30 cpi r24, 0x03 ; 3 2088: 09 f0 breq .+2 ; 0x208c 208a: 14 c4 rjmp .+2088 ; 0x28b4 lcd_clear(); 208c: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_MEM_string(SELFTEST); // "Selftest mode.." 2090: 86 e8 ldi r24, 0x86 ; 134 2092: 94 e0 ldi r25, 0x04 ; 4 2094: 0e 94 bf 0a call 0x157e ; 0x157e lcd_line2(); 2098: 0e 94 85 08 call 0x110a ; 0x110a lcd_data('?'); // wait for key pressed for confirmation 209c: 8f e3 ldi r24, 0x3F ; 63 209e: 0e 94 3f 0a call 0x147e ; 0x147e if (wait_for_key_ms(2000) > 10) goto begin_selftest; // key is pressed again 20a2: 80 ed ldi r24, 0xD0 ; 208 20a4: 97 e0 ldi r25, 0x07 ; 7 20a6: 0e 94 de 0e call 0x1dbc ; 0x1dbc 20aa: 8b 30 cpi r24, 0x0B ; 11 20ac: f8 f4 brcc .+62 ; 0x20ec if (tt < 150) goto begin_selftest; // is shorted before time limit goto no_zero_resistance; // skip measuring of the zero resistance #endif } // no key pressed for 2s lcd_clear(); 20ae: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_MEM2_string(VERSION_str); //"Version ..." 20b2: 80 e3 ldi r24, 0x30 ; 48 20b4: 92 e0 ldi r25, 0x02 ; 2 20b6: 0e 94 bf 0a call 0x157e ; 0x157e return; 20ba: fc c3 rjmp .+2040 ; 0x28b4 int8_t udiff; // difference between ADC Voltage with VCC or Bandgap reference int8_t udiff2; #endif #endif PartFound = PART_NONE; // no part found before if ((test_mode & 0xf0) == 0) { 20bc: a6 e9 ldi r26, 0x96 ; 150 20be: fa 2e mov r15, r26 20c0: 00 e0 ldi r16, 0x00 ; 0 #ifdef WITH_MENU } else { // report to user, that probes should be shorted ww = 0; for (tt=0;tt<150;tt++) { /* wait about 30 seconds for shorted probes */ lcd_clear(); 20c2: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_MEM2_string(SHORT_PROBES_str); // message "Short probes!" to LCD 20c6: 8d ee ldi r24, 0xED ; 237 20c8: 93 e0 ldi r25, 0x03 ; 3 20ca: 0e 94 bf 0a call 0x157e ; 0x157e if (AllProbesShorted() == 3) { 20ce: 0e 94 24 10 call 0x2048 ; 0x2048 20d2: 83 30 cpi r24, 0x03 ; 3 20d4: 21 f4 brne .+8 ; 0x20de ww++; // all probes now shorted 20d6: 0f 5f subi r16, 0xFF ; 255 } else { ww = 0; // connection not stable, retry } if (ww > 3) break; // connection seems to be stable 20d8: 04 30 cpi r16, 0x04 ; 4 20da: 10 f0 brcs .+4 ; 0x20e0 20dc: 07 c0 rjmp .+14 ; 0x20ec lcd_clear(); lcd_MEM2_string(SHORT_PROBES_str); // message "Short probes!" to LCD if (AllProbesShorted() == 3) { ww++; // all probes now shorted } else { ww = 0; // connection not stable, retry 20de: 00 e0 ldi r16, 0x00 ; 0 } if (ww > 3) break; // connection seems to be stable lcd_refresh(); // write the pixels to display, ST7920 only wait_about200ms(); // wait 200ms and try again 20e0: 88 e2 ldi r24, 0x28 ; 40 20e2: 0e 94 4a 0e call 0x1c94 ; 0x1c94 20e6: fa 94 dec r15 if (wait_for_key_ms(2000) > 10) goto begin_selftest; // key is pressed again #ifdef WITH_MENU } else { // report to user, that probes should be shorted ww = 0; for (tt=0;tt<150;tt++) { /* wait about 30 seconds for shorted probes */ 20e8: 61 f7 brne .-40 ; 0x20c2 20ea: 72 c0 rjmp .+228 ; 0x21d0 lcd_clear(); lcd_MEM2_string(VERSION_str); //"Version ..." return; begin_selftest: lcd_line2(); 20ec: 0e 94 85 08 call 0x110a ; 0x110a lcd_MEM2_string(R0_str); // "R0=" 20f0: 8c ee ldi r24, 0xEC ; 236 20f2: 91 e0 ldi r25, 0x01 ; 1 20f4: 0e 94 bf 0a call 0x157e ; 0x157e eeprom_write_byte((uint8_t *)(&EE_ESR_ZEROtab[2]), (uint8_t)0); // clear zero offset 20f8: 60 e0 ldi r22, 0x00 ; 0 20fa: 83 e0 ldi r24, 0x03 ; 3 20fc: 90 e0 ldi r25, 0x00 ; 0 20fe: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> eeprom_write_byte((uint8_t *)(&EE_ESR_ZEROtab[3]), (uint8_t)0); // clear zero offset 2102: 60 e0 ldi r22, 0x00 ; 0 2104: 84 e0 ldi r24, 0x04 ; 4 2106: 90 e0 ldi r25, 0x00 ; 0 2108: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> eeprom_write_byte((uint8_t *)(&EE_ESR_ZEROtab[1]), (uint8_t)0); // clear zero offset 210c: 60 e0 ldi r22, 0x00 ; 0 210e: 82 e0 ldi r24, 0x02 ; 2 2110: 90 e0 ldi r25, 0x00 ; 0 2112: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> adcmv[0] = GetESR(TP3, TP1); 2116: 60 e0 ldi r22, 0x00 ; 0 2118: 82 e0 ldi r24, 0x02 ; 2 211a: 0e 94 1c 24 call 0x4838 ; 0x4838 211e: 5c 01 movw r10, r24 2120: 9a 83 std Y+2, r25 ; 0x02 2122: 89 83 std Y+1, r24 ; 0x01 adcmv[1] = GetESR(TP3, TP2); 2124: 61 e0 ldi r22, 0x01 ; 1 2126: 82 e0 ldi r24, 0x02 ; 2 2128: 0e 94 1c 24 call 0x4838 ; 0x4838 212c: 6c 01 movw r12, r24 212e: 9c 83 std Y+4, r25 ; 0x04 2130: 8b 83 std Y+3, r24 ; 0x03 adcmv[2] = GetESR(TP2, TP1); 2132: 60 e0 ldi r22, 0x00 ; 0 2134: 81 e0 ldi r24, 0x01 ; 1 2136: 0e 94 1c 24 call 0x4838 ; 0x4838 213a: 7c 01 movw r14, r24 213c: 9e 83 std Y+6, r25 ; 0x06 213e: 8d 83 std Y+5, r24 ; 0x05 DisplayValue(adcmv[0],-2,' ',3); 2140: b5 01 movw r22, r10 2142: 88 27 eor r24, r24 2144: 77 fd sbrc r23, 7 2146: 80 95 com r24 2148: 98 2f mov r25, r24 214a: 03 e0 ldi r16, 0x03 ; 3 214c: 20 e2 ldi r18, 0x20 ; 32 214e: 4e ef ldi r20, 0xFE ; 254 2150: 0e 94 a8 0b call 0x1750 ; 0x1750 DisplayValue(adcmv[1],-2,' ',3); 2154: b6 01 movw r22, r12 2156: 88 27 eor r24, r24 2158: 77 fd sbrc r23, 7 215a: 80 95 com r24 215c: 98 2f mov r25, r24 215e: 20 e2 ldi r18, 0x20 ; 32 2160: 4e ef ldi r20, 0xFE ; 254 2162: 0e 94 a8 0b call 0x1750 ; 0x1750 DisplayValue(adcmv[2],-2,LCD_CHAR_OMEGA,3); 2166: b7 01 movw r22, r14 2168: 88 27 eor r24, r24 216a: 77 fd sbrc r23, 7 216c: 80 95 com r24 216e: 98 2f mov r25, r24 2170: 24 e0 ldi r18, 0x04 ; 4 2172: 4e ef ldi r20, 0xFE ; 254 2174: 0e 94 a8 0b call 0x1750 ; 0x1750 if (adcmv[0] >= 90) { 2178: 2a e5 ldi r18, 0x5A ; 90 217a: a2 16 cp r10, r18 217c: b1 04 cpc r11, r1 217e: 24 f0 brlt .+8 ; 0x2188 adcmv[0] = ESR_ZERO; // set back to default value 2180: 84 e1 ldi r24, 0x14 ; 20 2182: 90 e0 ldi r25, 0x00 ; 0 2184: 9a 83 std Y+2, r25 ; 0x02 2186: 89 83 std Y+1, r24 ; 0x01 } eeprom_write_byte((uint8_t *)(&EE_ESR_ZEROtab[2]), (uint8_t)adcmv[0]); // fix zero offset 2188: 69 81 ldd r22, Y+1 ; 0x01 218a: 83 e0 ldi r24, 0x03 ; 3 218c: 90 e0 ldi r25, 0x00 ; 0 218e: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> if (adcmv[1] >= 90) { 2192: 8a e5 ldi r24, 0x5A ; 90 2194: c8 16 cp r12, r24 2196: d1 04 cpc r13, r1 2198: 24 f0 brlt .+8 ; 0x21a2 adcmv[1] = ESR_ZERO; // set back to default value 219a: 84 e1 ldi r24, 0x14 ; 20 219c: 90 e0 ldi r25, 0x00 ; 0 219e: 9c 83 std Y+4, r25 ; 0x04 21a0: 8b 83 std Y+3, r24 ; 0x03 } eeprom_write_byte((uint8_t *)(&EE_ESR_ZEROtab[3]), (uint8_t)adcmv[1]); // fix zero offset 21a2: 6b 81 ldd r22, Y+3 ; 0x03 21a4: 84 e0 ldi r24, 0x04 ; 4 21a6: 90 e0 ldi r25, 0x00 ; 0 21a8: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> if (adcmv[2] >= 90) { 21ac: 9a e5 ldi r25, 0x5A ; 90 21ae: e9 16 cp r14, r25 21b0: f1 04 cpc r15, r1 21b2: 24 f0 brlt .+8 ; 0x21bc adcmv[2] = ESR_ZERO; // set back to default value 21b4: 84 e1 ldi r24, 0x14 ; 20 21b6: 90 e0 ldi r25, 0x00 ; 0 21b8: 9e 83 std Y+6, r25 ; 0x06 21ba: 8d 83 std Y+5, r24 ; 0x05 } eeprom_write_byte((uint8_t *)(&EE_ESR_ZEROtab[1]), (uint8_t)adcmv[2]); // fix zero offset 21bc: 6d 81 ldd r22, Y+5 ; 0x05 21be: 82 e0 ldi r24, 0x02 ; 2 21c0: 90 e0 ldi r25, 0x00 ; 0 21c2: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> last_line_used = 2; 21c6: 82 e0 ldi r24, 0x02 ; 2 21c8: 80 93 4a 01 sts 0x014A, r24 wait_for_key_5s_line2(); // wait up to 5 seconds and clear line 2 21cc: 0e 94 1d 0f call 0x1e3a ; 0x1e3a #ifdef WITH_MENU no_zero_resistance: #endif #ifdef EXTENDED_TESTS #define TEST_COUNT 8 if((test_mode & 0x0f) == 1) { /* full test requested */ 21d0: 1f 70 andi r17, 0x0F ; 15 21d2: 1f 87 std Y+15, r17 ; 0x0f 21d4: 11 30 cpi r17, 0x01 ; 1 21d6: 09 f0 breq .+2 ; 0x21da 21d8: 5b c0 rjmp .+182 ; 0x2290 21da: 01 e0 ldi r16, 0x01 ; 1 21dc: 10 e0 ldi r17, 0x00 ; 0 R_PORT = 1< u2lcd(tt); //lcd_string(utoa(tt, outval, 10)); //output Test number 221c: c8 01 movw r24, r16 221e: 0e 94 00 0b call 0x1600 ; 0x1600 lcd_space(); 2222: 0e 94 8b 0a call 0x1516 ; 0x1516 //############################################ if (tt == 1) { // output of reference voltage and factors for capacity measurement 2226: e1 e0 ldi r30, 0x01 ; 1 2228: be 12 cpse r11, r30 222a: 39 c0 rjmp .+114 ; 0x229e Calibrate_UR(); // get Reference voltage, Pin resistance 222c: 0e 94 1e 21 call 0x423c ; 0x423c lcd_MEM2_string(URefT); //"URef=" 2230: 8f e1 ldi r24, 0x1F ; 31 2232: 92 e0 ldi r25, 0x02 ; 2 2234: 0e 94 bf 0a call 0x157e ; 0x157e Display_mV(ref_mv,4); 2238: 64 e0 ldi r22, 0x04 ; 4 223a: 80 91 37 01 lds r24, 0x0137 223e: 90 91 38 01 lds r25, 0x0138 2242: 0e 94 6d 0c call 0x18da ; 0x18da lcd_line2(); //Cursor to column 1, row 2 2246: 0e 94 85 08 call 0x110a ; 0x110a lcd_MEM2_string(RHfakt); //"RHf=" 224a: 8a e1 ldi r24, 0x1A ; 26 224c: 92 e0 ldi r25, 0x02 ; 2 224e: 0e 94 bf 0a call 0x157e ; 0x157e u2lcd(RHmultip); //lcd_string(utoa(RHmultip, outval, 10)); 2252: 80 91 7d 01 lds r24, 0x017D 2256: 90 91 7e 01 lds r25, 0x017E 225a: 0e 94 00 0b call 0x1600 ; 0x1600 ADCconfig.Samples = R_ANZ_MESS; // set number of ADC reads near to maximum 225e: 8e eb ldi r24, 0xBE ; 190 2260: 80 93 2f 01 sts 0x012F, r24 lcd_space(); i2lcd(adcmv[1]); // lcd_string(itoa(adcmv[1], outval, 10)); //output voltage 2 lcd_space(); i2lcd(adcmv[2]); // lcd_string(itoa(adcmv[2], outval, 10)); //output voltage 3 } ADC_DDR = TXD_MSK; // all-Pins to Input 2264: a7 b8 out 0x07, r10 ; 7 ADC_PORT = TXD_VAL; // all ADC-Ports to GND 2266: a8 b8 out 0x08, r10 ; 8 R_DDR = 0; // all R-Ports to Input 2268: 14 b8 out 0x04, r1 ; 4 R_PORT = 0; 226a: 15 b8 out 0x05, r1 ; 5 taste = wait_for_key_ms(1000); // wait up to 1 second or key is pressed 226c: 88 ee ldi r24, 0xE8 ; 232 226e: 93 e0 ldi r25, 0x03 ; 3 2270: 0e 94 de 0e call 0x1dbc ; 0x1dbc if ((tt != 4) && (taste > 10)) { 2274: f4 e0 ldi r31, 0x04 ; 4 2276: bf 16 cp r11, r31 2278: 31 f2 breq .-116 ; 0x2206 227a: 8b 30 cpi r24, 0x0B ; 11 227c: 20 f2 brcs .-120 ; 0x2206 // don't finish repetition for T4 with pressed key break; // if key is pressed, don't repeat } } //end for ww //wait_about1s(); wait_for_key_ms(1000); // wait up to 1 second or key is pressed 227e: 88 ee ldi r24, 0xE8 ; 232 2280: 93 e0 ldi r25, 0x03 ; 3 2282: 0e 94 de 0e call 0x1dbc ; 0x1dbc 2286: 0f 5f subi r16, 0xFF ; 255 2288: 1f 4f sbci r17, 0xFF ; 255 #endif #ifdef EXTENDED_TESTS #define TEST_COUNT 8 if((test_mode & 0x0f) == 1) { /* full test requested */ for(tt=1;tt #ifdef WITH_MENU no_zero_resistance: #endif #ifdef EXTENDED_TESTS #define TEST_COUNT 8 if((test_mode & 0x0f) == 1) { /* full test requested */ 2290: 18 e7 ldi r17, 0x78 ; 120 2292: 36 c1 rjmp .+620 ; 0x2500 lcd_clear(); lcd_MEM2_string(SHORT_PROBES_str); // message "Short probes!" to LCD if (AllProbesShorted() == 3) { ww++; // all probes now shorted } else { ww = 0; // connection not stable, retry 2294: 81 2c mov r8, r1 2296: b0 2e mov r11, r16 adcmv[0] -= u680; R_PORT = 1< lcd_MEM2_string(RHfakt); //"RHf=" u2lcd(RHmultip); //lcd_string(utoa(RHmultip, outval, 10)); ADCconfig.Samples = R_ANZ_MESS; // set number of ADC reads near to maximum } //############################################ if (tt == 2) { // how equal are the RL resistors? 229e: f2 e0 ldi r31, 0x02 ; 2 22a0: bf 12 cpse r11, r31 22a2: 44 c0 rjmp .+136 ; 0x232c u680 = ((long)ADCconfig.U_AVCC * (PIN_RM + R_L_VAL) / (PIN_RM + R_L_VAL + R_L_VAL + PIN_RP)); 22a4: 20 91 33 01 lds r18, 0x0133 22a8: 30 91 34 01 lds r19, 0x0134 22ac: a8 e5 ldi r26, 0x58 ; 88 22ae: bb e1 ldi r27, 0x1B ; 27 22b0: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 22b4: a7 01 movw r20, r14 22b6: 96 01 movw r18, r12 22b8: 0e 94 bf 38 call 0x717e ; 0x717e <__divmodsi4> R_PORT = 1< adcmv[0] -= u680; 22d2: 28 89 ldd r18, Y+16 ; 0x10 22d4: 39 89 ldd r19, Y+17 ; 0x11 22d6: 4a 89 ldd r20, Y+18 ; 0x12 22d8: 5b 89 ldd r21, Y+19 ; 0x13 22da: 82 1b sub r24, r18 22dc: 93 0b sbc r25, r19 22de: 9a 83 std Y+2, r25 ; 0x02 22e0: 89 83 std Y+1, r24 ; 0x01 R_DDR = (1< adcmv[1] -= u680; 22f4: 28 89 ldd r18, Y+16 ; 0x10 22f6: 39 89 ldd r19, Y+17 ; 0x11 22f8: 4a 89 ldd r20, Y+18 ; 0x12 22fa: 5b 89 ldd r21, Y+19 ; 0x13 22fc: 82 1b sub r24, r18 22fe: 93 0b sbc r25, r19 2300: 9c 83 std Y+4, r25 ; 0x04 2302: 8b 83 std Y+3, r24 ; 0x03 R_PORT = 1< adcmv[2] -= u680; 231a: 28 89 ldd r18, Y+16 ; 0x10 231c: 39 89 ldd r19, Y+17 ; 0x11 231e: 82 1b sub r24, r18 2320: 93 0b sbc r25, r19 2322: 9e 83 std Y+6, r25 ; 0x06 2324: 8d 83 std Y+5, r24 ; 0x05 lcd_MEM_string(RLRL); // "RLRL" 2326: 84 e0 ldi r24, 0x04 ; 4 2328: 92 e0 ldi r25, 0x02 ; 2 232a: c5 c0 rjmp .+394 ; 0x24b6 } //############################################ if (tt == 3) { // how equal are the RH resistors 232c: 93 e0 ldi r25, 0x03 ; 3 232e: b9 12 cpse r11, r25 2330: 2c c0 rjmp .+88 ; 0x238a R_PORT = 1< adcmv[3] = ADCconfig.U_AVCC / 2; 233e: 20 91 33 01 lds r18, 0x0133 2342: 30 91 34 01 lds r19, 0x0134 2346: 36 95 lsr r19 2348: 27 95 ror r18 234a: 38 87 std Y+8, r19 ; 0x08 234c: 2f 83 std Y+7, r18 ; 0x07 adcmv[0] -= adcmv[3]; 234e: 82 1b sub r24, r18 2350: 93 0b sbc r25, r19 2352: 9a 83 std Y+2, r25 ; 0x02 2354: 89 83 std Y+1, r24 ; 0x01 R_DDR = (1< adcmv[1] -= adcmv[3]; 2360: 2f 81 ldd r18, Y+7 ; 0x07 2362: 38 85 ldd r19, Y+8 ; 0x08 2364: 82 1b sub r24, r18 2366: 93 0b sbc r25, r19 2368: 9c 83 std Y+4, r25 ; 0x04 236a: 8b 83 std Y+3, r24 ; 0x03 R_PORT = 1< adcmv[2] -= adcmv[3]; 2378: 2f 81 ldd r18, Y+7 ; 0x07 237a: 38 85 ldd r19, Y+8 ; 0x08 237c: 82 1b sub r24, r18 237e: 93 0b sbc r25, r19 2380: 9e 83 std Y+6, r25 ; 0x06 2382: 8d 83 std Y+5, r24 ; 0x05 lcd_MEM_string(RHRH); // "RHRH" 2384: 86 ef ldi r24, 0xF6 ; 246 2386: 91 e0 ldi r25, 0x01 ; 1 2388: 96 c0 rjmp .+300 ; 0x24b6 } //############################################ if (tt == 4) { // Text release probes 238a: 84 e0 ldi r24, 0x04 ; 4 238c: b8 12 cpse r11, r24 238e: 09 c0 rjmp .+18 ; 0x23a2 lcd_MEM_string(RELPROBE); // "Release Probes" 2390: 86 e7 ldi r24, 0x76 ; 118 2392: 94 e0 ldi r25, 0x04 ; 4 2394: 0e 94 bf 0a call 0x157e ; 0x157e if (AllProbesShorted() != 0) ww = MAX_REP-2; 2398: 0e 94 24 10 call 0x2048 ; 0x2048 239c: 81 11 cpse r24, r1 239e: 87 c2 rjmp .+1294 ; 0x28ae 23a0: 91 c0 rjmp .+290 ; 0x24c4 } //############################################ if (tt == 5) { // can we switch the ADC pins to GND across R_H resistor? 23a2: 95 e0 ldi r25, 0x05 ; 5 23a4: b9 12 cpse r11, r25 23a6: 16 c0 rjmp .+44 ; 0x23d4 R_PORT = 0; 23a8: 15 b8 out 0x05, r1 ; 5 R_DDR = 1< 23b2: 9a 83 std Y+2, r25 ; 0x02 23b4: 89 83 std Y+1, r24 ; 0x01 R_DDR = 1< 23be: 9c 83 std Y+4, r25 ; 0x04 23c0: 8b 83 std Y+3, r24 ; 0x03 R_DDR = 1< 23ca: 9e 83 std Y+6, r25 ; 0x06 23cc: 8d 83 std Y+5, r24 ; 0x05 lcd_MEM_string(RH1L); // "RH_Lo=" 23ce: 86 e1 ldi r24, 0x16 ; 22 23d0: 92 e0 ldi r25, 0x02 ; 2 23d2: 71 c0 rjmp .+226 ; 0x24b6 } //############################################ if (tt == 6) { // can we switch the ADC pins to VCC across the R_H resistor? 23d4: e6 e0 ldi r30, 0x06 ; 6 23d6: be 12 cpse r11, r30 23d8: 2a c0 rjmp .+84 ; 0x242e R_DDR = 1< 23e4: 20 91 33 01 lds r18, 0x0133 23e8: 30 91 34 01 lds r19, 0x0134 23ec: 82 1b sub r24, r18 23ee: 93 0b sbc r25, r19 23f0: 9a 83 std Y+2, r25 ; 0x02 23f2: 89 83 std Y+1, r24 ; 0x01 R_DDR = 1< 23fe: 20 91 33 01 lds r18, 0x0133 2402: 30 91 34 01 lds r19, 0x0134 2406: 82 1b sub r24, r18 2408: 93 0b sbc r25, r19 240a: 9c 83 std Y+4, r25 ; 0x04 240c: 8b 83 std Y+3, r24 ; 0x03 R_DDR = 1< 2418: 20 91 33 01 lds r18, 0x0133 241c: 30 91 34 01 lds r19, 0x0134 2420: 82 1b sub r24, r18 2422: 93 0b sbc r25, r19 2424: 9e 83 std Y+6, r25 ; 0x06 2426: 8d 83 std Y+5, r24 ; 0x05 lcd_MEM_string(RH1H); // "RH_Hi=" 2428: 82 e1 ldi r24, 0x12 ; 18 242a: 92 e0 ldi r25, 0x02 ; 2 242c: 44 c0 rjmp .+136 ; 0x24b6 } if (tt == 7) { // is the voltage of all R_H / R_L dividers correct? 242e: f7 e0 ldi r31, 0x07 ; 7 2430: bf 12 cpse r11, r31 2432: 44 c0 rjmp .+136 ; 0x24bc u680 = ((long)ADCconfig.U_AVCC * (PIN_RM + R_L_VAL) / (PIN_RM + R_L_VAL + (unsigned long)R_H_VAL*100)); 2434: 20 91 33 01 lds r18, 0x0133 2438: 30 91 34 01 lds r19, 0x0134 243c: a8 e5 ldi r26, 0x58 ; 88 243e: bb e1 ldi r27, 0x1B ; 27 2440: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 2444: a2 01 movw r20, r4 2446: 91 01 movw r18, r2 2448: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> R_PORT = 1< adcmv[0] -= u680; 2460: 28 89 ldd r18, Y+16 ; 0x10 2462: 39 89 ldd r19, Y+17 ; 0x11 2464: 4a 89 ldd r20, Y+18 ; 0x12 2466: 5b 89 ldd r21, Y+19 ; 0x13 2468: 82 1b sub r24, r18 246a: 93 0b sbc r25, r19 246c: 9a 83 std Y+2, r25 ; 0x02 246e: 89 83 std Y+1, r24 ; 0x01 R_PORT = 1< adcmv[1] -= u680; 2482: 28 89 ldd r18, Y+16 ; 0x10 2484: 39 89 ldd r19, Y+17 ; 0x11 2486: 4a 89 ldd r20, Y+18 ; 0x12 2488: 5b 89 ldd r21, Y+19 ; 0x13 248a: 82 1b sub r24, r18 248c: 93 0b sbc r25, r19 248e: 9c 83 std Y+4, r25 ; 0x04 2490: 8b 83 std Y+3, r24 ; 0x03 R_PORT = 1< adcmv[2] -= u680; 24a6: 28 89 ldd r18, Y+16 ; 0x10 24a8: 39 89 ldd r19, Y+17 ; 0x11 24aa: 82 1b sub r24, r18 24ac: 93 0b sbc r25, r19 24ae: 9e 83 std Y+6, r25 ; 0x06 24b0: 8d 83 std Y+5, r24 ; 0x05 lcd_MEM_string(RHRL); // "RH/RL" 24b2: 80 ef ldi r24, 0xF0 ; 240 24b4: 91 e0 ldi r25, 0x01 ; 1 24b6: 0e 94 bf 0a call 0x157e ; 0x157e 24ba: 04 c0 rjmp .+8 ; 0x24c4 } //############################################ if (tt > 1) { // output 3 voltages 24bc: e1 e0 ldi r30, 0x01 ; 1 24be: be 16 cp r11, r30 24c0: 09 f4 brne .+2 ; 0x24c4 24c2: d0 ce rjmp .-608 ; 0x2264 lcd_line2(); //Cursor to column 1, row 2 24c4: 0e 94 85 08 call 0x110a ; 0x110a i2lcd(adcmv[0]); // lcd_string(itoa(adcmv[0], outval, 10)); //output voltage 1 24c8: 89 81 ldd r24, Y+1 ; 0x01 24ca: 9a 81 ldd r25, Y+2 ; 0x02 24cc: 0e 94 f5 0a call 0x15ea ; 0x15ea lcd_space(); 24d0: 0e 94 8b 0a call 0x1516 ; 0x1516 i2lcd(adcmv[1]); // lcd_string(itoa(adcmv[1], outval, 10)); //output voltage 2 24d4: 8b 81 ldd r24, Y+3 ; 0x03 24d6: 9c 81 ldd r25, Y+4 ; 0x04 24d8: 0e 94 f5 0a call 0x15ea ; 0x15ea lcd_space(); 24dc: 0e 94 8b 0a call 0x1516 ; 0x1516 i2lcd(adcmv[2]); // lcd_string(itoa(adcmv[2], outval, 10)); //output voltage 3 24e0: 8d 81 ldd r24, Y+5 ; 0x05 24e2: 9e 81 ldd r25, Y+6 ; 0x06 24e4: 0e 94 f5 0a call 0x15ea ; 0x15ea 24e8: bd ce rjmp .-646 ; 0x2264 #endif /* end EXTENDED_TESTS */ for (ww=0;ww<120;ww++) { // wait up to 1 minute for releasing the probes if (AllProbesShorted() == 0) break; lcd_clear_line2(); // clear total line2 24ea: 0e 94 ac 0a call 0x1558 ; 0x1558 lcd_MEM_string(RELPROBE); // "Release Probes" 24ee: 86 e7 ldi r24, 0x76 ; 118 24f0: 94 e0 ldi r25, 0x04 ; 4 24f2: 0e 94 bf 0a call 0x157e ; 0x157e lcd_refresh(); // write the pixels to display, ST7920 only wait_about500ms(); 24f6: 84 e6 ldi r24, 0x64 ; 100 24f8: 0e 94 4a 0e call 0x1c94 ; 0x1c94 24fc: 11 50 subi r17, 0x01 ; 1 wait_for_key_5s_line2(); // wait up to 5 seconds and clear line 2 #endif /* PROCESSOR_TYP == 1280 */ } /* end if((test_mode & 0x0f) == 1) */ #endif /* end EXTENDED_TESTS */ for (ww=0;ww<120;ww++) { 24fe: 21 f0 breq .+8 ; 0x2508 // wait up to 1 minute for releasing the probes if (AllProbesShorted() == 0) break; 2500: 0e 94 24 10 call 0x2048 ; 0x2048 2504: 81 11 cpse r24, r1 2506: f1 cf rjmp .-30 ; 0x24ea wait_about500ms(); } lcd_clear(); 2508: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_MEM_string(RIHI); // "RiHi=" 250c: 85 ee ldi r24, 0xE5 ; 229 250e: 91 e0 ldi r25, 0x01 ; 1 2510: 0e 94 bf 0a call 0x157e ; 0x157e DisplayValue(RRpinPL,-1,LCD_CHAR_OMEGA,3); 2514: 60 91 35 01 lds r22, 0x0135 2518: 70 91 36 01 lds r23, 0x0136 251c: 80 e0 ldi r24, 0x00 ; 0 251e: 90 e0 ldi r25, 0x00 ; 0 2520: 03 e0 ldi r16, 0x03 ; 3 2522: 24 e0 ldi r18, 0x04 ; 4 2524: 4f ef ldi r20, 0xFF ; 255 2526: 0e 94 a8 0b call 0x1750 ; 0x1750 lcd_line2(); 252a: 0e 94 85 08 call 0x110a ; 0x110a lcd_MEM_string(RILO); // "RiLo=" 252e: 8e ed ldi r24, 0xDE ; 222 2530: 91 e0 ldi r25, 0x01 ; 1 2532: 0e 94 bf 0a call 0x157e ; 0x157e DisplayValue(RRpinMI,-1,LCD_CHAR_OMEGA,3); 2536: 60 91 45 01 lds r22, 0x0145 253a: 70 91 46 01 lds r23, 0x0146 253e: 80 e0 ldi r24, 0x00 ; 0 2540: 90 e0 ldi r25, 0x00 ; 0 2542: 24 e0 ldi r18, 0x04 ; 4 2544: 4f ef ldi r20, 0xFF ; 255 2546: 0e 94 a8 0b call 0x1750 ; 0x1750 last_line_used = 2; 254a: 82 e0 ldi r24, 0x02 ; 2 254c: 80 93 4a 01 sts 0x014A, r24 wait_for_key_5s_line2(); // wait up to 5 seconds and clear line 2 2550: 0e 94 1d 0f call 0x1e3a ; 0x1e3a //measure Zero offset for Capacity measurement PartFound = PART_NONE; 2554: 10 92 20 01 sts 0x0120, r1 lcd_clear(); 2558: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_MEM_string(C0_str); //output "C0 " 255c: 8a ed ldi r24, 0xDA ; 218 255e: 91 e0 ldi r25, 0x01 ; 1 2560: 0e 94 bf 0a call 0x157e ; 0x157e ReadCapacity(TP3, TP1); 2564: 60 e0 ldi r22, 0x00 ; 0 2566: 82 e0 ldi r24, 0x02 ; 2 2568: 0e 94 ed 1d call 0x3bda ; 0x3bda adcmv[5] = (unsigned int) cap.cval_uncorrected.dw; //save capacity value of empty Pin 1:3 256c: 00 91 87 01 lds r16, 0x0187 2570: 10 91 88 01 lds r17, 0x0188 2574: 1c 87 std Y+12, r17 ; 0x0c 2576: 0b 87 std Y+11, r16 ; 0x0b ReadCapacity(TP3, TP2); 2578: 61 e0 ldi r22, 0x01 ; 1 257a: 82 e0 ldi r24, 0x02 ; 2 257c: 0e 94 ed 1d call 0x3bda ; 0x3bda adcmv[6] = (unsigned int) cap.cval_uncorrected.dw; //save capacity value of empty Pin 2:3 2580: c0 90 87 01 lds r12, 0x0187 2584: d0 90 88 01 lds r13, 0x0188 2588: de 86 std Y+14, r13 ; 0x0e 258a: cd 86 std Y+13, r12 ; 0x0d ReadCapacity(TP2, TP1); 258c: 60 e0 ldi r22, 0x00 ; 0 258e: 81 e0 ldi r24, 0x01 ; 1 2590: 0e 94 ed 1d call 0x3bda ; 0x3bda adcmv[2] = (unsigned int) cap.cval_uncorrected.dw; //save capacity value of empty Pin 1:2 2594: e0 90 87 01 lds r14, 0x0187 2598: f0 90 88 01 lds r15, 0x0188 259c: fe 82 std Y+6, r15 ; 0x06 259e: ed 82 std Y+5, r14 ; 0x05 ReadCapacity(TP1, TP3); 25a0: 62 e0 ldi r22, 0x02 ; 2 25a2: 80 e0 ldi r24, 0x00 ; 0 25a4: 0e 94 ed 1d call 0x3bda ; 0x3bda adcmv[1] = (unsigned int) cap.cval_uncorrected.dw; //save capacity value of empty Pin 3:1 25a8: 80 91 87 01 lds r24, 0x0187 25ac: 90 91 88 01 lds r25, 0x0188 25b0: 9c 83 std Y+4, r25 ; 0x04 25b2: 8b 83 std Y+3, r24 ; 0x03 ReadCapacity(TP2, TP3); 25b4: 62 e0 ldi r22, 0x02 ; 2 25b6: 81 e0 ldi r24, 0x01 ; 1 25b8: 0e 94 ed 1d call 0x3bda ; 0x3bda adcmv[4] = (unsigned int) cap.cval_uncorrected.dw; //save capacity value of empty Pin 3:2 25bc: 80 91 87 01 lds r24, 0x0187 25c0: 90 91 88 01 lds r25, 0x0188 25c4: 9a 87 std Y+10, r25 ; 0x0a 25c6: 89 87 std Y+9, r24 ; 0x09 ReadCapacity(TP1, TP2); 25c8: 61 e0 ldi r22, 0x01 ; 1 25ca: 80 e0 ldi r24, 0x00 ; 0 25cc: 0e 94 ed 1d call 0x3bda ; 0x3bda adcmv[0] = (unsigned int) cap.cval_uncorrected.dw; //save capacity value of empty Pin 2:1 25d0: 80 91 87 01 lds r24, 0x0187 25d4: 90 91 88 01 lds r25, 0x0188 25d8: 9a 83 std Y+2, r25 ; 0x02 25da: 89 83 std Y+1, r24 ; 0x01 #ifdef WITH_MENU if (((test_mode & 0x0f) == 1) || (UnCalibrated == 2)) 25dc: ef 85 ldd r30, Y+15 ; 0x0f 25de: e1 30 cpi r30, 0x01 ; 1 25e0: 21 f0 breq .+8 ; 0x25ea 25e2: 20 91 44 01 lds r18, 0x0144 25e6: 22 30 cpi r18, 0x02 ; 2 25e8: 21 f4 brne .+8 ; 0x25f2 #else if (UnCalibrated == 2) #endif { adcmv[3] = adcmv[0] + 2; // mark as uncalibrated until Cap > 100nF has success 25ea: 02 96 adiw r24, 0x02 ; 2 25ec: 98 87 std Y+8, r25 ; 0x08 25ee: 8f 83 std Y+7, r24 ; 0x07 25f0: 04 c0 rjmp .+8 ; 0x25fa } else { adcmv[3] = adcmv[0]; // mark as calibrated, short calibration is finished 25f2: 98 87 std Y+8, r25 ; 0x08 25f4: 8f 83 std Y+7, r24 ; 0x07 UnCalibrated = 0; // clear the UnCalibrated Flag 25f6: 10 92 44 01 sts 0x0144, r1 lcd_cursor_off(); // switch cursor off } DisplayValue(adcmv[5],0,' ',3); //output cap0 1:3 25fa: b8 01 movw r22, r16 25fc: 88 27 eor r24, r24 25fe: 77 fd sbrc r23, 7 2600: 80 95 com r24 2602: 98 2f mov r25, r24 2604: 03 e0 ldi r16, 0x03 ; 3 2606: 20 e2 ldi r18, 0x20 ; 32 2608: 40 e0 ldi r20, 0x00 ; 0 260a: 0e 94 a8 0b call 0x1750 ; 0x1750 DisplayValue(adcmv[6],0,' ',3); //output cap0 2:3 260e: b6 01 movw r22, r12 2610: 88 27 eor r24, r24 2612: 77 fd sbrc r23, 7 2614: 80 95 com r24 2616: 98 2f mov r25, r24 2618: 20 e2 ldi r18, 0x20 ; 32 261a: 40 e0 ldi r20, 0x00 ; 0 261c: 0e 94 a8 0b call 0x1750 ; 0x1750 DisplayValue(adcmv[2],-12,'F',3); //output cap0 1:2 2620: b7 01 movw r22, r14 2622: 88 27 eor r24, r24 2624: 77 fd sbrc r23, 7 2626: 80 95 com r24 2628: 98 2f mov r25, r24 262a: 26 e4 ldi r18, 0x46 ; 70 262c: 44 ef ldi r20, 0xF4 ; 244 262e: 0e 94 a8 0b call 0x1750 ; 0x1750 2632: 6e 01 movw r12, r28 2634: ff e0 ldi r31, 0x0F ; 15 2636: cf 0e add r12, r31 2638: d1 1c adc r13, r1 263a: fe 01 movw r30, r28 263c: 31 96 adiw r30, 0x01 ; 1 #ifdef AUTO_CAL for (ww=0;ww<7;ww++) { //checking loop if ((adcmv[ww] > 190) || (adcmv[ww] < 10)) goto no_c0save; 263e: 81 91 ld r24, Z+ 2640: 91 91 ld r25, Z+ 2642: 0a 97 sbiw r24, 0x0a ; 10 2644: 85 3b cpi r24, 0xB5 ; 181 2646: 91 05 cpc r25, r1 2648: f0 f4 brcc .+60 ; 0x2686 } DisplayValue(adcmv[5],0,' ',3); //output cap0 1:3 DisplayValue(adcmv[6],0,' ',3); //output cap0 2:3 DisplayValue(adcmv[2],-12,'F',3); //output cap0 1:2 #ifdef AUTO_CAL for (ww=0;ww<7;ww++) { //checking loop 264a: ec 15 cp r30, r12 264c: fd 05 cpc r31, r13 264e: b9 f7 brne .-18 ; 0x263e 2650: a5 e0 ldi r26, 0x05 ; 5 2652: ea 2e mov r14, r26 2654: a0 e0 ldi r26, 0x00 ; 0 2656: fa 2e mov r15, r26 2658: 8e 01 movw r16, r28 265a: 0f 5f subi r16, 0xFF ; 255 265c: 1f 4f sbci r17, 0xFF ; 255 if ((adcmv[ww] > 190) || (adcmv[ww] < 10)) goto no_c0save; } for (ww=0;ww<7;ww++) { // write all zero offsets to the EEprom (void) eeprom_write_byte((uint8_t *)(&c_zero_tab[ww]),adcmv[ww]+(COMP_SLEW1 / (CC0 + CABLE_CAP + COMP_SLEW2))); 265e: f8 01 movw r30, r16 2660: 60 81 ld r22, Z 2662: 0e 5f subi r16, 0xFE ; 254 2664: 1f 4f sbci r17, 0xFF ; 255 2666: 6e 5e subi r22, 0xEE ; 238 2668: c7 01 movw r24, r14 266a: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> 266e: ff ef ldi r31, 0xFF ; 255 2670: ef 1a sub r14, r31 2672: ff 0a sbc r15, r31 DisplayValue(adcmv[2],-12,'F',3); //output cap0 1:2 #ifdef AUTO_CAL for (ww=0;ww<7;ww++) { //checking loop if ((adcmv[ww] > 190) || (adcmv[ww] < 10)) goto no_c0save; } for (ww=0;ww<7;ww++) { 2674: 0c 15 cp r16, r12 2676: 1d 05 cpc r17, r13 2678: 91 f7 brne .-28 ; 0x265e // write all zero offsets to the EEprom (void) eeprom_write_byte((uint8_t *)(&c_zero_tab[ww]),adcmv[ww]+(COMP_SLEW1 / (CC0 + CABLE_CAP + COMP_SLEW2))); } lcd_line2(); 267a: 0e 94 85 08 call 0x110a ; 0x110a lcd_MEM_string(OK_str); // output "OK" 267e: 8b ed ldi r24, 0xDB ; 219 2680: 93 e0 ldi r25, 0x03 ; 3 2682: 0e 94 bf 0a call 0x157e ; 0x157e no_c0save: #endif last_line_used = 2; 2686: 82 e0 ldi r24, 0x02 ; 2 2688: 80 93 4a 01 sts 0x014A, r24 wait_for_key_5s_line2(); // wait up to 5 seconds and clear line 2 268c: 0e 94 1d 0f call 0x1e3a ; 0x1e3a #ifdef AUTO_CAL #ifdef WITH_MENU if (((test_mode & 0x0f) == 1) || (UnCalibrated == 2)) 2690: 2f 85 ldd r18, Y+15 ; 0x0f 2692: 21 30 cpi r18, 0x01 ; 1 2694: 29 f0 breq .+10 ; 0x26a0 2696: 80 91 44 01 lds r24, 0x0144 269a: 82 30 cpi r24, 0x02 ; 2 269c: 09 f0 breq .+2 ; 0x26a0 269e: f0 c0 rjmp .+480 ; 0x2880 } DisplayValue(adcmv[5],0,' ',3); //output cap0 1:3 DisplayValue(adcmv[6],0,' ',3); //output cap0 2:3 DisplayValue(adcmv[2],-12,'F',3); //output cap0 1:2 #ifdef AUTO_CAL for (ww=0;ww<7;ww++) { //checking loop 26a0: e0 e4 ldi r30, 0x40 ; 64 26a2: be 2e mov r11, r30 26a4: 10 e0 ldi r17, 0x00 ; 0 //measure offset Voltage of analog Comparator for Capacity measurement ReadCapacity(TP3, TP1); // look for capacitor > 100nF #endif while (cap.cpre < -9) { cap.cpre++; cap.cval /= 10; 26a6: fa e0 ldi r31, 0x0A ; 10 26a8: cf 2e mov r12, r31 26aa: d1 2c mov r13, r1 26ac: e1 2c mov r14, r1 26ae: f1 2c mov r15, r1 for (ww=0;ww<64;ww++) { #if (TPCAP >= 0) PartFound = PART_NONE; CalibrationCap(); // measure with internal calibration capacitor #else lcd_clear(); 26b0: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_testpin(TP1); 26b4: 80 e0 ldi r24, 0x00 ; 0 26b6: 0e 94 87 0a call 0x150e ; 0x150e lcd_MEM_string(CapZeich); // "-||-" 26ba: 86 e8 ldi r24, 0x86 ; 134 26bc: 93 e0 ldi r25, 0x03 ; 3 26be: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(TP3); 26c2: 82 e0 ldi r24, 0x02 ; 2 26c4: 0e 94 87 0a call 0x150e ; 0x150e lcd_MEM2_string(MinCap_str); // " >100nF!" 26c8: 8d e4 ldi r24, 0x4D ; 77 26ca: 91 e0 ldi r25, 0x01 ; 1 26cc: 0e 94 bf 0a call 0x157e ; 0x157e PartFound = PART_NONE; 26d0: 10 92 20 01 sts 0x0120, r1 //measure offset Voltage of analog Comparator for Capacity measurement ReadCapacity(TP3, TP1); // look for capacitor > 100nF 26d4: 60 e0 ldi r22, 0x00 ; 0 26d6: 82 e0 ldi r24, 0x02 ; 2 26d8: 0e 94 ed 1d call 0x3bda ; 0x3bda 26dc: 00 91 91 01 lds r16, 0x0191 26e0: 60 91 7f 01 lds r22, 0x017F 26e4: 70 91 80 01 lds r23, 0x0180 26e8: 80 91 81 01 lds r24, 0x0181 26ec: 90 91 82 01 lds r25, 0x0182 #endif while (cap.cpre < -9) { 26f0: 07 3f cpi r16, 0xF7 ; 247 26f2: 44 f4 brge .+16 ; 0x2704 cap.cpre++; cap.cval /= 10; 26f4: a7 01 movw r20, r14 26f6: 96 01 movw r18, r12 26f8: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> PartFound = PART_NONE; //measure offset Voltage of analog Comparator for Capacity measurement ReadCapacity(TP3, TP1); // look for capacitor > 100nF #endif while (cap.cpre < -9) { cap.cpre++; 26fc: 0f 5f subi r16, 0xFF ; 255 cap.cval /= 10; 26fe: b9 01 movw r22, r18 2700: ca 01 movw r24, r20 2702: f6 cf rjmp .-20 ; 0x26f0 2704: 00 93 91 01 sts 0x0191, r16 2708: 60 93 7f 01 sts 0x017F, r22 270c: 70 93 80 01 sts 0x0180, r23 2710: 80 93 81 01 sts 0x0181, r24 2714: 90 93 82 01 sts 0x0182, r25 } if ((cap.cpre == -9) && (cap.cval > 95) && (cap.cval < 22000) && 2718: 07 3f cpi r16, 0xF7 ; 247 271a: 09 f0 breq .+2 ; 0x271e 271c: 9a c0 rjmp .+308 ; 0x2852 271e: dc 01 movw r26, r24 2720: cb 01 movw r24, r22 2722: 80 56 subi r24, 0x60 ; 96 2724: 91 09 sbc r25, r1 2726: a1 09 sbc r26, r1 2728: b1 09 sbc r27, r1 272a: 80 39 cpi r24, 0x90 ; 144 272c: 95 45 sbci r25, 0x55 ; 85 272e: a1 05 cpc r26, r1 2730: b1 05 cpc r27, r1 2732: 08 f0 brcs .+2 ; 0x2736 2734: 8e c0 rjmp .+284 ; 0x2852 (load_diff > -150) && (load_diff < 150)) { 2736: 60 91 93 01 lds r22, 0x0193 273a: 70 91 94 01 lds r23, 0x0194 273e: cb 01 movw r24, r22 2740: 8b 56 subi r24, 0x6B ; 107 2742: 9f 4f sbci r25, 0xFF ; 255 2744: 8b 32 cpi r24, 0x2B ; 43 2746: 91 40 sbci r25, 0x01 ; 1 2748: 08 f0 brcs .+2 ; 0x274c 274a: 83 c0 rjmp .+262 ; 0x2852 cap_found++; 274c: 1f 5f subi r17, 0xFF ; 255 } else { cap_found = 0; // wait for stable connection } if (cap_found > 4) { 274e: 15 30 cpi r17, 0x05 ; 5 2750: 08 f4 brcc .+2 ; 0x2754 2752: 80 c0 rjmp .+256 ; 0x2854 // value of capacitor is correct (void) eeprom_write_word((uint16_t *)(&ref_offset), load_diff); // hold zero offset + slew rate dependend offset 2754: 8c e0 ldi r24, 0x0C ; 12 2756: 90 e0 ldi r25, 0x00 ; 0 2758: 0e 94 f3 39 call 0x73e6 ; 0x73e6 <__eewr_word_m328p> lcd_clear(); 275c: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_MEM2_string(REF_C_str); // "REF_C=" 2760: 86 e4 ldi r24, 0x46 ; 70 2762: 91 e0 ldi r25, 0x01 ; 1 2764: 0e 94 bf 0a call 0x157e ; 0x157e i2lcd(load_diff); // lcd_string(itoa(load_diff, outval, 10)); //output REF_C_KORR 2768: 80 91 93 01 lds r24, 0x0193 276c: 90 91 94 01 lds r25, 0x0194 2770: 0e 94 f5 0a call 0x15ea ; 0x15ea RefVoltage(); // new ref_mv_offs and RHmultip 2774: 0e 94 46 0f call 0x1e8c ; 0x1e8c #define CAP_ADC TPCAP /* Cap >100nF is integrated at TPCAP */ TCAP_PORT &= ~(1<100nF at TP3 */ ADC_PORT = TXD_VAL; //ADC-Port 1 to GND 2778: 88 e0 ldi r24, 0x08 ; 8 277a: 88 b9 out 0x08, r24 ; 8 ADC_DDR = 1< } while (adcmv[0] > 980); 278a: 85 3d cpi r24, 0xD5 ; 213 278c: 93 40 sbci r25, 0x03 ; 3 278e: d4 f7 brge .-12 ; 0x2784 #if (TPCAP >= 0) TCAP_DDR &= ~(1< 27a0: 8c 01 movw r16, r24 ADCconfig.U_Bandgap = adc_internal_reference; 27a2: 80 91 79 01 lds r24, 0x0179 27a6: 90 91 7a 01 lds r25, 0x017A 27aa: 90 93 32 01 sts 0x0132, r25 27ae: 80 93 31 01 sts 0x0131, r24 adcmv[1] = ReadADC(CAP_ADC); // get cap voltage with internal reference 27b2: 82 e0 ldi r24, 0x02 ; 2 27b4: 0e 94 80 0e call 0x1d00 ; 0x1d00 adcmv[1] += adcmv[1]; // double the value 27b8: 7c 01 movw r14, r24 27ba: ee 0c add r14, r14 27bc: ff 1c adc r15, r15 ADCconfig.U_Bandgap = 0; // do not use internal Ref 27be: 10 92 32 01 sts 0x0132, r1 27c2: 10 92 31 01 sts 0x0131, r1 adcmv[2] = ReadADC(CAP_ADC); // get cap voltage with VCC reference 27c6: 82 e0 ldi r24, 0x02 ; 2 27c8: 0e 94 80 0e call 0x1d00 ; 0x1d00 ADCconfig.U_Bandgap = adc_internal_reference; 27cc: c0 90 79 01 lds r12, 0x0179 27d0: d0 90 7a 01 lds r13, 0x017A 27d4: d0 92 32 01 sts 0x0132, r13 27d8: c0 92 31 01 sts 0x0131, r12 udiff = (int8_t)(((signed long)(adcmv[0] + adcmv[2] - adcmv[1])) * adc_internal_reference / adcmv[1])+REF_R_KORR; 27dc: 08 0f add r16, r24 27de: 19 1f adc r17, r25 27e0: 0e 19 sub r16, r14 27e2: 1f 09 sbc r17, r15 lcd_line2(); 27e4: 0e 94 85 08 call 0x110a ; 0x110a lcd_MEM2_string(REF_R_str); // "REF_R=" 27e8: 8f e3 ldi r24, 0x3F ; 63 27ea: 91 e0 ldi r25, 0x01 ; 1 27ec: 0e 94 bf 0a call 0x157e ; 0x157e udiff2 = udiff + (int8_t)eeprom_read_byte((uint8_t *)(&RefDiff)); 27f0: 8e e0 ldi r24, 0x0E ; 14 27f2: 90 e0 ldi r25, 0x00 ; 0 27f4: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> adcmv[1] = ReadADC(CAP_ADC); // get cap voltage with internal reference adcmv[1] += adcmv[1]; // double the value ADCconfig.U_Bandgap = 0; // do not use internal Ref adcmv[2] = ReadADC(CAP_ADC); // get cap voltage with VCC reference ADCconfig.U_Bandgap = adc_internal_reference; udiff = (int8_t)(((signed long)(adcmv[0] + adcmv[2] - adcmv[1])) * adc_internal_reference / adcmv[1])+REF_R_KORR; 27f8: 73 e0 ldi r23, 0x03 ; 3 27fa: b7 2e mov r11, r23 27fc: b8 0e add r11, r24 27fe: 96 01 movw r18, r12 2800: d8 01 movw r26, r16 2802: 0e 94 53 38 call 0x70a6 ; 0x70a6 <__usmulhisi3> 2806: 97 01 movw r18, r14 2808: 44 27 eor r20, r20 280a: 37 fd sbrc r19, 7 280c: 40 95 com r20 280e: 54 2f mov r21, r20 2810: 0e 94 bf 38 call 0x717e ; 0x717e <__divmodsi4> lcd_line2(); lcd_MEM2_string(REF_R_str); // "REF_R=" udiff2 = udiff + (int8_t)eeprom_read_byte((uint8_t *)(&RefDiff)); 2814: b2 0e add r11, r18 (void) eeprom_write_byte((uint8_t *)(&RefDiff), (uint8_t)udiff2); // hold offset for true reference Voltage 2816: 6b 2d mov r22, r11 2818: 8e e0 ldi r24, 0x0E ; 14 281a: 90 e0 ldi r25, 0x00 ; 0 281c: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> i2lcd(udiff2); // output correction voltage 2820: 8b 2d mov r24, r11 2822: 99 27 eor r25, r25 2824: 87 fd sbrc r24, 7 2826: 90 95 com r25 2828: 0e 94 f5 0a call 0x15ea ; 0x15ea RefVoltage(); // set new ADCconfig.U_Bandgap 282c: 0e 94 46 0f call 0x1e8c ; 0x1e8c #endif /* end AUTOSCALE_ADC */ last_line_used = 2; 2830: 82 e0 ldi r24, 0x02 ; 2 2832: 80 93 4a 01 sts 0x014A, r24 wait_for_key_5s_line2(); // wait up to 5 seconds and clear line 2 2836: 0e 94 1d 0f call 0x1e3a ; 0x1e3a UnCalibrated = 0; // clear the UnCalibrated Flag 283a: 10 92 44 01 sts 0x0144, r1 lcd_cursor_off(); // switch cursor off cap_found = eeprom_read_byte((uint8_t *)&c_zero_tab[0]); // read first capacity zero offset 283e: 85 e0 ldi r24, 0x05 ; 5 2840: 90 e0 ldi r25, 0x00 ; 0 2842: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> eeprom_write_byte((uint8_t *)&c_zero_tab[3], cap_found); // mark as calibrated permanent 2846: 68 2f mov r22, r24 2848: 88 e0 ldi r24, 0x08 ; 8 284a: 90 e0 ldi r25, 0x00 ; 0 284c: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> break; // leave the ww for loop 2850: 17 c0 rjmp .+46 ; 0x2880 2852: 10 e0 ldi r17, 0x00 ; 0 } /* end if (cap_found > 4) */ lcd_line2(); 2854: 0e 94 85 08 call 0x110a ; 0x110a DisplayValue(cap.cval,cap.cpre,'F',4); 2858: 60 91 7f 01 lds r22, 0x017F 285c: 70 91 80 01 lds r23, 0x0180 2860: 80 91 81 01 lds r24, 0x0181 2864: 90 91 82 01 lds r25, 0x0182 2868: 04 e0 ldi r16, 0x04 ; 4 286a: 26 e4 ldi r18, 0x46 ; 70 286c: 40 91 91 01 lds r20, 0x0191 2870: 0e 94 a8 0b call 0x1750 ; 0x1750 lcd_refresh(); // write the pixels to display, ST7920 only wait_about200ms(); // wait additional time 2874: 88 e2 ldi r24, 0x28 ; 40 2876: 0e 94 4a 0e call 0x1c94 ; 0x1c94 287a: ba 94 dec r11 // of the menu function, not with the automatically call (test_mode = 1). { // for full test or first time calibration, use external capacitor // Message C > 100nF at TP1 and TP3 cap_found = 0; for (ww=0;ww<64;ww++) { 287c: 09 f0 breq .+2 ; 0x2880 287e: 18 cf rjmp .-464 ; 0x26b0 } // end for ww } /* end if((test_mode & 0x0f) == 1) */ #endif /* end AUTO_CAL */ ADCconfig.Samples = ANZ_MESS; // set to configured number of ADC samples 2880: 89 e1 ldi r24, 0x19 ; 25 2882: 80 93 2f 01 sts 0x012F, r24 // if key is pressed, don't repeat break; } } /* end for ww */ #endif /* end FREQUENCY_50HZ */ lcd_clear(); 2886: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_MEM2_string(VERSION_str); //"Version ..." 288a: 80 e3 ldi r24, 0x30 ; 48 288c: 92 e0 ldi r25, 0x02 ; 2 288e: 0e 94 bf 0a call 0x157e ; 0x157e lcd_line2(); 2892: 0e 94 85 08 call 0x110a ; 0x110a lcd_MEM_string(ATE); //"Selftest End" 2896: 8d e6 ldi r24, 0x6D ; 109 2898: 94 e0 ldi r25, 0x04 ; 4 289a: 0e 94 bf 0a call 0x157e ; 0x157e PartFound = PART_NONE; 289e: 10 92 20 01 sts 0x0120, r1 last_line_used = 2; 28a2: 82 e0 ldi r24, 0x02 ; 2 28a4: 80 93 4a 01 sts 0x014A, r24 wait_for_key_5s_line2(); // wait up to 5 seconds and clear line 2 28a8: 0e 94 1d 0f call 0x1e3a ; 0x1e3a 28ac: 03 c0 rjmp .+6 ; 0x28b4 lcd_MEM_string(RHRH); // "RHRH" } //############################################ if (tt == 4) { // Text release probes lcd_MEM_string(RELPROBE); // "Release Probes" if (AllProbesShorted() != 0) ww = MAX_REP-2; 28ae: 52 e0 ldi r21, 0x02 ; 2 28b0: 85 2e mov r8, r21 28b2: 08 ce rjmp .-1008 ; 0x24c4 lcd_line2(); lcd_MEM_string(ATE); //"Selftest End" PartFound = PART_NONE; last_line_used = 2; wait_for_key_5s_line2(); // wait up to 5 seconds and clear line 2 } /* end AutoCheck */ 28b4: 63 96 adiw r28, 0x13 ; 19 28b6: e2 e1 ldi r30, 0x12 ; 18 28b8: 0c 94 59 39 jmp 0x72b2 ; 0x72b2 <__epilogue_restores__> 000028bc : void mark_as_uncalibrated( void) { uint8_t ii; if (!UnCalibrated) { 28bc: 80 91 44 01 lds r24, 0x0144 28c0: 81 11 cpse r24, r1 28c2: 0d c0 rjmp .+26 ; 0x28de // equipment has changed, zero capacity value is too high or zero resistance is too high // but the device is marked as Calibrated. ii = eeprom_read_byte((uint8_t *)&c_zero_tab[0]); // read first zero offset 28c4: 85 e0 ldi r24, 0x05 ; 5 28c6: 90 e0 ldi r25, 0x00 ; 0 28c8: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> ii++; 28cc: 61 e0 ldi r22, 0x01 ; 1 28ce: 68 0f add r22, r24 // make the unused c_zero_tab[3] different to c_zero_tab[0] to mark uncalibrated eeprom_write_byte((uint8_t *)&c_zero_tab[3], ii); // mark uncalibrated permanent 28d0: 88 e0 ldi r24, 0x08 ; 8 28d2: 90 e0 ldi r25, 0x00 ; 0 28d4: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> UnCalibrated = 1; // set back to uncalibrated 28d8: 81 e0 ldi r24, 0x01 ; 1 28da: 80 93 44 01 sts 0x0144, r24 28de: 08 95 ret 000028e0 : /* Get residual current in reverse direction of a diode */ //================================================================= void GetIr(uint8_t hipin, uint8_t lopin) { 28e0: cf 92 push r12 28e2: df 92 push r13 28e4: ff 92 push r15 28e6: 0f 93 push r16 28e8: 1f 93 push r17 28ea: cf 93 push r28 28ec: df 93 push r29 28ee: 1f 92 push r1 28f0: cd b7 in r28, 0x3d ; 61 28f2: de b7 in r29, 0x3e ; 62 ADC_DDR = HiADC | TXD_MSK; // switch High Pin direct to VCC R_PORT = 0; // switch R-Port to GND LoPinR_L = pgm_read_byte(&PinRHRLADCtab[lopin]); //R_L mask for LowPin R_L load #else uint8_t LoPinR_L; HiADC = pgm_read_byte(&PinRLRHADCtab[hipin]+3); // Table of ADC pins including | TXD_VAL 28f4: e8 2f mov r30, r24 28f6: f0 e0 ldi r31, 0x00 ; 0 28f8: e1 5a subi r30, 0xA1 ; 161 28fa: fe 4f sbci r31, 0xFE ; 254 28fc: e4 91 lpm r30, Z ADC_PORT = HiADC; // switch ADC port to high level 28fe: e8 b9 out 0x08, r30 ; 8 ADC_DDR = HiADC | TXD_MSK; // switch High Pin direct to VCC 2900: e8 60 ori r30, 0x08 ; 8 2902: e7 b9 out 0x07, r30 ; 7 R_PORT = 0; // switch R-Port to GND 2904: 15 b8 out 0x05, r1 ; 5 LoPinR_L = pgm_read_byte(&PinRLRHADCtab[lopin]); //R_L mask for LowPin R_L load 2906: e6 2f mov r30, r22 2908: f0 e0 ldi r31, 0x00 ; 0 290a: e4 5a subi r30, 0xA4 ; 164 290c: fe 4f sbci r31, 0xFE ; 254 290e: e4 91 lpm r30, Z // R_H Pin must always be one pin number higher #endif R_DDR = LoPinR_L; // switch R_L port for LowPin to output (GND) 2910: e4 b9 out 0x04, r30 ; 4 u_res = U_VCC; 2912: 08 e8 ldi r16, 0x88 ; 136 2914: 13 e1 ldi r17, 0x13 ; 19 u_res_old = u_res; u_res = W20msReadADC(lopin); // read voltage #if (((PIN_RL1 + 1) != PIN_RH1) || ((PIN_RL2 + 1) != PIN_RH2) || ((PIN_RL3 + 1) != PIN_RH3)) R_DDR = pgm_read_byte(&PinRHRLADCtab[lopin+3]); //R_H mask for LowPin R_H load #else R_DDR = LoPinR_L + LoPinR_L; // switch R_H port for LowPin to output (GND) 2916: fe 2e mov r15, r30 2918: ff 0c add r15, r15 R_DDR = LoPinR_L; // switch R_L port for LowPin to output (GND) u_res = U_VCC; // first load the parallel capacity with 680 Ohm resistor, then measure current with 470k do { u_res_old = u_res; u_res = W20msReadADC(lopin); // read voltage 291a: 86 2f mov r24, r22 291c: 69 83 std Y+1, r22 ; 0x01 291e: 0e 94 74 0e call 0x1ce8 ; 0x1ce8 2922: 6c 01 movw r12, r24 #if (((PIN_RL1 + 1) != PIN_RH1) || ((PIN_RL2 + 1) != PIN_RH2) || ((PIN_RL3 + 1) != PIN_RH3)) R_DDR = pgm_read_byte(&PinRHRLADCtab[lopin+3]); //R_H mask for LowPin R_H load #else R_DDR = LoPinR_L + LoPinR_L; // switch R_H port for LowPin to output (GND) 2924: f4 b8 out 0x04, r15 ; 4 #endif } while (u_res < u_res_old); 2926: 69 81 ldd r22, Y+1 ; 0x01 2928: 80 17 cp r24, r16 292a: 91 07 cpc r25, r17 292c: 10 f4 brcc .+4 ; 0x2932 R_DDR = LoPinR_L; // switch R_L port for LowPin to output (GND) u_res = U_VCC; // first load the parallel capacity with 680 Ohm resistor, then measure current with 470k do { u_res_old = u_res; u_res = W20msReadADC(lopin); // read voltage 292e: 8c 01 movw r16, r24 2930: f4 cf rjmp .-24 ; 0x291a R_DDR = pgm_read_byte(&PinRHRLADCtab[lopin+3]); //R_H mask for LowPin R_H load #else R_DDR = LoPinR_L + LoPinR_L; // switch R_H port for LowPin to output (GND) #endif } while (u_res < u_res_old); if (u_res == 0) return; // no Output, if no current in reverse direction 2932: 00 97 sbiw r24, 0x00 ; 0 2934: 01 f1 breq .+64 ; 0x2976 #if (LCD_LINES > 3) #define IR_DIGITS 3 lcd_line4(); // use Line 4 for Ir output 2936: 0e 94 9b 08 call 0x1136 ; 0x1136 lcd_MEM_string(Ir_str); // output text "Ir=" 293a: 86 e6 ldi r24, 0x66 ; 102 293c: 93 e0 ldi r25, 0x03 ; 3 293e: 0e 94 bf 0a call 0x157e ; 0x157e #ifdef WITH_IRMICRO unsigned int ir_micro; if (u_res < 2500) { #endif /* R_H_VAL has units of 10 Ohm, u_res has units of mV, ir_nano has units of nA */ ir_nano = (unsigned long)(u_res * 100000UL) / R_H_VAL; 2942: d6 01 movw r26, r12 2944: 20 ea ldi r18, 0xA0 ; 160 2946: 36 e8 ldi r19, 0x86 ; 134 2948: 41 e0 ldi r20, 0x01 ; 1 294a: 50 e0 ldi r21, 0x00 ; 0 294c: 0e 94 5a 38 call 0x70b4 ; 0x70b4 <__muluhisi3> 2950: 28 e9 ldi r18, 0x98 ; 152 2952: 37 eb ldi r19, 0xB7 ; 183 2954: 40 e0 ldi r20, 0x00 ; 0 2956: 50 e0 ldi r21, 0x00 ; 0 2958: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 295c: ca 01 movw r24, r20 295e: b9 01 movw r22, r18 DisplayValue(ir_nano,-9,'A',2); // output two digits of current with nA units 2960: 88 27 eor r24, r24 2962: 99 27 eor r25, r25 2964: 02 e0 ldi r16, 0x02 ; 2 2966: 21 e4 ldi r18, 0x41 ; 65 2968: 47 ef ldi r20, 0xF7 ; 247 296a: 0e 94 a8 0b call 0x1750 ; 0x1750 /* RR680MI has units of 0.1 Ohm, u_res has units of mV, ir_micro has units of uA */ ir_micro = (unsigned long)(u_res * 10000UL) / RR680MI; DisplayValue(ir_micro,-6,'A',IR_DIGITS); // output 2 or 3 digits of current in uA units } #endif ADC_DDR = TXD_MSK; // switch off 296e: 88 e0 ldi r24, 0x08 ; 8 2970: 87 b9 out 0x07, r24 ; 7 ADC_PORT = TXD_VAL; // switch off 2972: 88 b9 out 0x08, r24 ; 8 R_DDR = 0; // switch off current 2974: 14 b8 out 0x04, r1 ; 4 return ; } 2976: 0f 90 pop r0 2978: df 91 pop r29 297a: cf 91 pop r28 297c: 1f 91 pop r17 297e: 0f 91 pop r16 2980: ff 90 pop r15 2982: df 90 pop r13 2984: cf 90 pop r12 2986: 08 95 ret 00002988 : // Calibrate_UR(); // get Ref Voltages and Pin resistance // lcd_line1(); // Cursor to 1. row, column 1 #ifdef BAT_CHECK void Battery_check(void) { 2988: 0f 93 push r16 298a: 1f 93 push r17 298c: cf 93 push r28 298e: df 93 push r29 uint16_t bat_voltage; uint16_t bat_adc; // Battery check is selected ReadADC(TPBAT); //Dummy-Readout 2990: 85 e0 ldi r24, 0x05 ; 5 2992: 0e 94 80 0e call 0x1d00 ; 0x1d00 bat_adc = W5msReadADC(TPBAT); //with 5V reference 2996: 85 e0 ldi r24, 0x05 ; 5 2998: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 299c: ec 01 movw r28, r24 // A good result can be get with multiply by 4 and divide by 10 (about 0.75%). #if BAT_NUMERATOR <= (0xffff/U_VCC) bat_voltage = (bat_adc*BAT_NUMERATOR)/BAT_DENOMINATOR + BAT_OUT; #else #if (BAT_NUMERATOR == 133) && (BAT_DENOMINATOR == 33) bat_voltage = (bat_adc*4)+BAT_OUT; // usually output only 2 digits 299e: 8c 01 movw r16, r24 29a0: 00 0f add r16, r16 29a2: 11 1f adc r17, r17 29a4: 00 0f add r16, r16 29a6: 11 1f adc r17, r17 29a8: 0a 56 subi r16, 0x6A ; 106 29aa: 1f 4f sbci r17, 0xFF ; 255 #else bat_voltage = ((unsigned long)bat_adc*BAT_NUMERATOR)/BAT_DENOMINATOR + BAT_OUT; #endif #endif #if FLASHEND > 0x1fff if (bat_voltage < 900) { 29ac: 04 38 cpi r16, 0x84 ; 132 29ae: 83 e0 ldi r24, 0x03 ; 3 29b0: 18 07 cpc r17, r24 29b2: 18 f4 brcc .+6 ; 0x29ba // no battery present, don't check, lcd_MEM_string(DC_Pwr_Mode_str); // "DC Pwr Mode" 29b4: 8f ec ldi r24, 0xCF ; 207 29b6: 93 e0 ldi r25, 0x03 ; 3 29b8: 22 c0 rjmp .+68 ; 0x29fe return; } #endif lcd_MEM_string(Bat_str); //output: "Bat. " 29ba: 8e ed ldi r24, 0xDE ; 222 29bc: 93 e0 ldi r25, 0x03 ; 3 29be: 0e 94 bf 0a call 0x157e ; 0x157e Display_mV(bat_voltage,2); // Display 2 Digits of this 10mV units 29c2: 62 e0 ldi r22, 0x02 ; 2 29c4: c8 01 movw r24, r16 29c6: 0e 94 6d 0c call 0x18da ; 0x18da lcd_space(); 29ca: 0e 94 8b 0a call 0x1516 ; 0x1516 #define WARN_LEVEL (((unsigned long)(BAT_POOR+100)*(unsigned long)BAT_DENOMINATOR)/BAT_NUMERATOR) #endif #define POOR_LEVEL (((unsigned long)(BAT_POOR)*(unsigned long)BAT_DENOMINATOR)/BAT_NUMERATOR) // check the battery voltage if (bat_adc < WARN_LEVEL) { 29ce: ca 3f cpi r28, 0xFA ; 250 29d0: 86 e0 ldi r24, 0x06 ; 6 29d2: d8 07 cpc r29, r24 29d4: 90 f4 brcc .+36 ; 0x29fa //Vcc < 7,3V; show Warning if(bat_adc < POOR_LEVEL) { 29d6: c3 33 cpi r28, 0x33 ; 51 29d8: d6 40 sbci r29, 0x06 ; 6 29da: 60 f4 brcc .+24 ; 0x29f4 //Vcc <6,3V; no proper operation is possible lcd_MEM_string(BatEmpty); //Battery empty! 29dc: 81 ee ldi r24, 0xE1 ; 225 29de: 94 e0 ldi r25, 0x04 ; 4 29e0: 0e 94 bf 0a call 0x157e ; 0x157e lcd_refresh(); // write the pixels to display, ST7920 only wait_about5s(); 29e4: 8d ec ldi r24, 0xCD ; 205 29e6: 0e 94 4a 0e call 0x1c94 ; 0x1c94 PORTD = 0; //switch power off 29ea: 1b b8 out 0x0b, r1 ; 11 wait_about2s(); 29ec: 8a ec ldi r24, 0xCA ; 202 29ee: 0e 94 4a 0e call 0x1c94 ; 0x1c94 return; 29f2: 07 c0 rjmp .+14 ; 0x2a02 } lcd_MEM_string(BatWeak); //Battery weak 29f4: 88 ee ldi r24, 0xE8 ; 232 29f6: 94 e0 ldi r25, 0x04 ; 4 29f8: 02 c0 rjmp .+4 ; 0x29fe } else { // Battery-voltage OK lcd_MEM_string(OK_str); // "OK" 29fa: 8b ed ldi r24, 0xDB ; 219 29fc: 93 e0 ldi r25, 0x03 ; 3 29fe: 0e 94 bf 0a call 0x157e ; 0x157e } }; 2a02: df 91 pop r29 2a04: cf 91 pop r28 2a06: 1f 91 pop r17 2a08: 0f 91 pop r16 2a0a: 08 95 ret 00002a0c : #include #include "Transistortester.h" //****************************************************************** void CheckPins(uint8_t HighPin, uint8_t LowPin, uint8_t TristatePin) { 2a0c: a9 e1 ldi r26, 0x19 ; 25 2a0e: b0 e0 ldi r27, 0x00 ; 0 2a10: ec e0 ldi r30, 0x0C ; 12 2a12: f5 e1 ldi r31, 0x15 ; 21 2a14: 0c 94 3d 39 jmp 0x727a ; 0x727a <__prologue_saves__> 2a18: b8 2e mov r11, r24 2a1a: a6 2e mov r10, r22 2a1c: 84 2e mov r8, r20 /* switch HighPin directls to VCC switch R_L port for LowPin to GND TristatePin remains switched to input , no action required */ wdt_reset(); 2a1e: a8 95 wdr addr = &PinRLRHADCtab[LowPin]; // Address of combined RL / RH / ADC pin table 2a20: e6 2f mov r30, r22 2a22: f0 e0 ldi r31, 0x00 ; 0 2a24: e4 5a subi r30, 0xA4 ; 164 2a26: fe 4f sbci r31, 0xFE ; 254 LoPinRL = pgm_read_byte(addr); // instruction for LowPin R_L 2a28: 54 90 lpm r5, Z addr += 3; // address of PinRHtab[LowPin] LoPinRH = pgm_read_byte(addr); // instruction for LowPin R_H #else LoPinRH = LoPinRL + LoPinRL; // instruction for LowPin R_H #endif addr += 3; // address of PinADCtab[LowPin] 2a2a: 33 96 adiw r30, 0x03 ; 3 addr += 6; // address of PinADCtab[LowPin] #else addr += 3; // address of PinADCtab[LowPin], table PinRHtab is missing #endif #endif LoADCp = pgm_read_byte(addr); // instruction for ADC Low-Pin, including | TXD_VAL 2a2c: 24 91 lpm r18, Z 2a2e: 2d 87 std Y+13, r18 ; 0x0d addr = &PinRLRHADCtab[TristatePin]; 2a30: e4 2f mov r30, r20 2a32: f0 e0 ldi r31, 0x00 ; 0 2a34: e4 5a subi r30, 0xA4 ; 164 2a36: fe 4f sbci r31, 0xFE ; 254 TriPinRL = pgm_read_byte(addr); // instruction for TristatePin R_L 2a38: 74 90 lpm r7, Z TriPinRH = pgm_read_byte(addr); // instruction for TristatePin R_H #else TriPinRH = TriPinRL + TriPinRL; // instruction for TristatePin R_H #endif addr = &PinRLRHADCtab[HighPin]; 2a3a: e8 2f mov r30, r24 2a3c: f0 e0 ldi r31, 0x00 ; 0 2a3e: e4 5a subi r30, 0xA4 ; 164 2a40: fe 4f sbci r31, 0xFE ; 254 HiPinRL = pgm_read_byte(addr); // instruction for HighPin R_L 2a42: 94 90 lpm r9, Z addr += 3; // address of PinRHtab[HighPin] HiPinRH = pgm_read_byte(addr); // instruction for HighPin R_H #else HiPinRH = HiPinRL + HiPinRL; // instruction for HighPin R_H #endif addr += 3; // address of PinADCtab[HighPin] 2a44: 33 96 adiw r30, 0x03 ; 3 HiADCp = pgm_read_byte(addr); // instruction for ADC High-Pin, including | TXD_VAL 2a46: 44 90 lpm r4, Z HiADCm = HiADCp | TXD_MSK; 2a48: 34 2d mov r19, r4 2a4a: 38 60 ori r19, 0x08 ; 8 2a4c: 3c 87 std Y+12, r19 ; 0x0c LoADCm = LoADCp | TXD_MSK; 2a4e: 28 60 ori r18, 0x08 ; 8 2a50: 62 2e mov r6, r18 adc.vCEs = adc.lp2; } else { if ((adc.vCEs+288) > adc.lp2) goto checkDiode; // no significant change } #else R_PORT = TriPinRL; //resistor-Port TriState to 1 2a52: 75 b8 out 0x05, r7 ; 5 R_DDR = LoPinRL | TriPinRL; // resistor-Port Low-Pin to 0 2a54: 07 2d mov r16, r7 2a56: 05 29 or r16, r5 2a58: 04 b9 out 0x04, r16 ; 4 ADC_DDR = HiADCm; //High-Pin to output 2a5a: 37 b9 out 0x07, r19 ; 7 ADC_PORT = HiADCp; //High-Pin fix to Vcc 2a5c: 48 b8 out 0x08, r4 ; 8 //for some MOSFET the gate (TristatePin) must be discharged adc.vCEs = W5msReadADC(LowPin); // lp1 is the voltage at 680 Ohm with + Gate 2a5e: 86 2f mov r24, r22 2a60: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 2a64: 98 87 std Y+8, r25 ; 0x08 2a66: 8f 83 std Y+7, r24 ; 0x07 R_DDR = LoPinRL; 2a68: 54 b8 out 0x04, r5 ; 4 adc.lp_otr = W5msReadADC(LowPin); //read voltage of Low-Pin , without Gate current (+) 2a6a: 8a 2d mov r24, r10 2a6c: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 2a70: 1c 01 movw r2, r24 R_DDR = 0; 2a72: 14 b8 out 0x04, r1 ; 4 wait5ms(); // release all current (clear TRIAC and Thyristor) 2a74: 0e 94 35 0e call 0x1c6a ; 0x1c6a R_PORT = 0; 2a78: 15 b8 out 0x05, r1 ; 5 R_DDR = LoPinRL | TriPinRL; // start current again 2a7a: 04 b9 out 0x04, r16 ; 4 adc.lp2 = W5msReadADC(LowPin); // lp2 is the voltage at 680 Ohm with - Gate 2a7c: 8a 2d mov r24, r10 2a7e: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 if (adc.lp2 < adc.vCEs) { 2a82: 4f 81 ldd r20, Y+7 ; 0x07 2a84: 58 85 ldd r21, Y+8 ; 0x08 2a86: 84 17 cp r24, r20 2a88: 95 07 cpc r25, r21 2a8a: 38 f5 brcc .+78 ; 0x2ada // current is lower with Gate switched to 0 if ((adc.lp2+288) > adc.vCEs) goto checkDiode; // no significant change 2a8c: 80 5e subi r24, 0xE0 ; 224 2a8e: 9e 4f sbci r25, 0xFE ; 254 2a90: 48 17 cp r20, r24 2a92: 59 07 cpc r21, r25 2a94: 08 f4 brcc .+2 ; 0x2a98 2a96: ec c4 rjmp .+2520 ; 0x3470 // switch to common emitter for NPN or N-channel FET ADC_DDR = LoADCm; //Low-Pin to output 2a98: 67 b8 out 0x07, r6 ; 7 ADC_PORT = TXD_VAL; //Low-Pin fix to GND 2a9a: 88 e0 ldi r24, 0x08 ; 8 2a9c: 88 b9 out 0x08, r24 ; 8 R_PORT = HiPinRL; //resistor-Port High-Pin to +, TriState to 0 2a9e: 95 b8 out 0x05, r9 ; 5 R_DDR = HiPinRL | TriPinRL; // resistor-Port High-Pin to 1 2aa0: 89 2d mov r24, r9 2aa2: 87 29 or r24, r7 2aa4: 84 b9 out 0x04, r24 ; 4 adc.vCEs = ADCconfig.U_AVCC - W5msReadADC(HighPin); // voltage at 680 Ohm with - Gate 2aa6: 80 91 33 01 lds r24, 0x0133 2aaa: 90 91 34 01 lds r25, 0x0134 2aae: 98 87 std Y+8, r25 ; 0x08 2ab0: 8f 83 std Y+7, r24 ; 0x07 2ab2: 8b 2d mov r24, r11 2ab4: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 2ab8: af 81 ldd r26, Y+7 ; 0x07 2aba: b8 85 ldd r27, Y+8 ; 0x08 2abc: a8 1b sub r26, r24 2abe: b9 0b sbc r27, r25 2ac0: b8 87 std Y+8, r27 ; 0x08 2ac2: af 83 std Y+7, r26 ; 0x07 R_DDR = HiPinRL; // resistor-Port High-Pin to 1, TriState open 2ac4: 94 b8 out 0x04, r9 ; 4 adc.lp_otr = ADCconfig.U_AVCC - W5msReadADC(HighPin); // voltage at 680 Ohm with open Gate 2ac6: 20 90 33 01 lds r2, 0x0133 2aca: 30 90 34 01 lds r3, 0x0134 2ace: 8b 2d mov r24, r11 2ad0: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 2ad4: 28 1a sub r2, r24 2ad6: 39 0a sbc r3, r25 2ad8: 08 c0 rjmp .+16 ; 0x2aea } else { if ((adc.vCEs+288) > adc.lp2) goto checkDiode; // no significant change 2ada: 2f 81 ldd r18, Y+7 ; 0x07 2adc: 38 85 ldd r19, Y+8 ; 0x08 2ade: 20 5e subi r18, 0xE0 ; 224 2ae0: 3e 4f sbci r19, 0xFE ; 254 2ae2: 82 17 cp r24, r18 2ae4: 93 07 cpc r25, r19 2ae6: 08 f4 brcc .+2 ; 0x2aea 2ae8: c3 c4 rjmp .+2438 ; 0x3470 // a TRIAC is marked as two transistors at least (2 or 3) // both of NPN transistors (normal and inverse) are found, if ntrans.count == 2 // both of PNP transistors (normal and inverse) are found, if ptrans.count == 2 // If Transistor with protection diode is checked, all results are found, // if ntrans.count == 1 and ptrans.count == 1 if ((ntrans.count + ptrans.count) > 1) { 2aea: 20 91 5a 01 lds r18, 0x015A 2aee: 80 91 74 01 lds r24, 0x0174 2af2: 90 e0 ldi r25, 0x00 ; 0 2af4: 82 0f add r24, r18 2af6: 91 1d adc r25, r1 2af8: 02 97 sbiw r24, 0x02 ; 2 2afa: 4c f0 brlt .+18 ; 0x2b0e // all transistors found, no more search is needed // but TRIAC can be detected as NPNp with same pins as PNPn if (!((ntrans.count == 1) && (ntrans.b == ptrans.b))) { 2afc: 21 30 cpi r18, 0x01 ; 1 2afe: 09 f0 breq .+2 ; 0x2b02 2b00: b7 c4 rjmp .+2414 ; 0x3470 2b02: 90 91 57 01 lds r25, 0x0157 2b06: 80 91 71 01 lds r24, 0x0171 2b0a: 98 13 cpse r25, r24 2b0c: b1 c4 rjmp .+2402 ; 0x3470 TriPinRL = pgm_read_byte(addr); // instruction for TristatePin R_L #if (((PIN_RL1 + 1) != PIN_RH1) || ((PIN_RL2 + 1) != PIN_RH2) || ((PIN_RL3 + 1) != PIN_RH3)) addr += 3; // address of PinRLtab[TristatePin] TriPinRH = pgm_read_byte(addr); // instruction for TristatePin R_H #else TriPinRH = TriPinRL + TriPinRL; // instruction for TristatePin R_H 2b0e: 17 2d mov r17, r7 2b10: 11 0f add r17, r17 // Additional checking of adc.lp1 will prevent to detect a PNP as P-JFET. // if((PartMode <= PART_MODE_P_JFET) && (adc.lp_otr > 455) && (adc.vCEs > 455)) // if((adc.lp_otr > 455) && (adc.vCEs > 455)) // if((adc.vCEs > 115) && ((adc.vCEs+100) > adc.lp_otr)) if((adc.vCEs > 115) && ((adc.vCEs+adc.vCEs+20) > adc.lp_otr)) 2b12: ef 81 ldd r30, Y+7 ; 0x07 2b14: f8 85 ldd r31, Y+8 ; 0x08 2b16: e4 37 cpi r30, 0x74 ; 116 2b18: f1 05 cpc r31, r1 2b1a: 08 f4 brcc .+2 ; 0x2b1e 2b1c: ac c0 rjmp .+344 ; 0x2c76 2b1e: cf 01 movw r24, r30 2b20: 88 0f add r24, r24 2b22: 99 1f adc r25, r25 2b24: 44 96 adiw r24, 0x14 ; 20 2b26: 28 16 cp r2, r24 2b28: 39 06 cpc r3, r25 2b2a: 08 f0 brcs .+2 ; 0x2b2e 2b2c: a4 c0 rjmp .+328 ; 0x2c76 { //there is more than 650uA current without TristatePin current // can be JFET or D-FET //Test if N-JFET or if self-conducting N-MOSFET #ifdef EXACT_OTR ADC_DDR = HiADCm; //High-Pin to output 2b2e: fc 85 ldd r31, Y+12 ; 0x0c 2b30: f7 b9 out 0x07, r31 ; 7 ADC_PORT = HiADCp; //High-Pin fix to Vcc 2b32: 48 b8 out 0x08, r4 ; 8 #endif R_DDR = LoPinRL | TriPinRH; //switch R_H for Tristate-Pin (probably Gate) to GND 2b34: 81 2f mov r24, r17 2b36: 85 29 or r24, r5 2b38: 84 b9 out 0x04, r24 ; 4 adc.lp1 = W10msReadADC(LowPin); //measure voltage at the assumed Source 2b3a: 8a 2d mov r24, r10 2b3c: 0e 94 78 0e call 0x1cf0 ; 0x1cf0 2b40: 7c 01 movw r14, r24 adc.tp1 = ReadADC(TristatePin); // measure Gate voltage 2b42: 88 2d mov r24, r8 2b44: 0e 94 80 0e call 0x1d00 ; 0x1d00 2b48: 6c 01 movw r12, r24 R_PORT = TriPinRH; //switch R_H for Tristate-Pin (probably Gate) to VCC 2b4a: 15 b9 out 0x05, r17 ; 5 adc.lp2 = W10msReadADC(LowPin); //measure voltage at the assumed Source again 2b4c: 8a 2d mov r24, r10 2b4e: 0e 94 78 0e call 0x1cf0 ; 0x1cf0 lcd_space(); DisplayValue(adc.lp2,-3,' ',3); DisplayValue(adc.lp1,-3,' ',3); #endif //If it is a self-conducting MOSFET or JFET, then must be: adc.lp2 > adc.lp1 if(adc.lp2>(adc.lp1+599)) { 2b52: 97 01 movw r18, r14 2b54: 29 5a subi r18, 0xA9 ; 169 2b56: 3d 4f sbci r19, 0xFD ; 253 2b58: 19 29 or r17, r9 2b5a: 28 17 cp r18, r24 2b5c: 39 07 cpc r19, r25 2b5e: d8 f5 brcc .+118 ; 0x2bd6 //measure voltage at the Gate, differ between MOSFET and JFET ADC_PORT = TXD_VAL; 2b60: 88 e0 ldi r24, 0x08 ; 8 2b62: 88 b9 out 0x08, r24 ; 8 ADC_DDR = LoADCm; //Low-Pin fix to GND 2b64: 67 b8 out 0x07, r6 ; 7 R_DDR = TriPinRH | HiPinRL; //High-Pin to output 2b66: 14 b9 out 0x04, r17 ; 4 R_PORT = TriPinRH | HiPinRL; //switch R_L for High-Pin to VCC 2b68: 15 b9 out 0x05, r17 ; 5 adc.lp2 = W10msReadADC(TristatePin); //read voltage of assumed Gate 2b6a: 88 2d mov r24, r8 2b6c: 0e 94 78 0e call 0x1cf0 ; 0x1cf0 if(adc.lp2>3911) { //MOSFET 2b70: 88 34 cpi r24, 0x48 ; 72 2b72: 9f 40 sbci r25, 0x0F ; 15 2b74: 28 f0 brcs .+10 ; 0x2b80 PartFound = PART_FET; //N-Kanal-MOSFET 2b76: 84 e0 ldi r24, 0x04 ; 4 2b78: 80 93 20 01 sts 0x0120, r24 PartMode = PART_MODE_MOS|N_CHANNEL|D_MODE; //Depletion-MOSFET 2b7c: 82 e2 ldi r24, 0x22 ; 34 2b7e: 04 c0 rjmp .+8 ; 0x2b88 } else { //JFET (pn-passage between Gate and Source is conducting ) PartFound = PART_FET; //N-Kanal-JFET 2b80: 84 e0 ldi r24, 0x04 ; 4 2b82: 80 93 20 01 sts 0x0120, r24 PartMode = PART_MODE_JFET|N_CHANNEL|D_MODE; 2b86: 84 e2 ldi r24, 0x24 ; 36 2b88: 80 93 1f 01 sts 0x011F, r24 lcd_data('N'); lcd_data('J'); #endif // if ((PartReady == 0) || (adc.lp1 > ntrans.uBE)) // there is no way to find out the right Source / Drain ntrans.uBE = adc.lp1; 2b8c: f0 92 50 01 sts 0x0150, r15 2b90: e0 92 4f 01 sts 0x014F, r14 if(adc.lp1 > adc.tp1) { 2b94: ce 14 cp r12, r14 2b96: df 04 cpc r13, r15 2b98: 40 f4 brcc .+16 ; 0x2baa ntrans.gthvoltage = adc.lp1 - adc.tp1; //voltage GS (Source - Gate) 2b9a: c7 01 movw r24, r14 2b9c: 8c 19 sub r24, r12 2b9e: 9d 09 sbc r25, r13 2ba0: 90 93 56 01 sts 0x0156, r25 2ba4: 80 93 55 01 sts 0x0155, r24 2ba8: 04 c0 rjmp .+8 ; 0x2bb2 } else { ntrans.gthvoltage = 0; //voltage GS (Source - Gate) 2baa: 10 92 56 01 sts 0x0156, r1 2bae: 10 92 55 01 sts 0x0155, r1 } ntrans.current = (unsigned int)(((unsigned long)adc.lp1 * 10000) / RR680MI); // Id 1uA 2bb2: 97 01 movw r18, r14 2bb4: a0 e1 ldi r26, 0x10 ; 16 2bb6: b7 e2 ldi r27, 0x27 ; 39 2bb8: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 2bbc: 20 91 1a 01 lds r18, 0x011A 2bc0: 30 91 1b 01 lds r19, 0x011B 2bc4: 40 e0 ldi r20, 0x00 ; 0 2bc6: 50 e0 ldi r21, 0x00 ; 0 2bc8: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 2bcc: 30 93 52 01 sts 0x0152, r19 2bd0: 20 93 51 01 sts 0x0151, r18 2bd4: 44 c4 rjmp .+2184 ; 0x345e ntrans.count++; // count as two, the inverse is identical goto saveNresult; // save Pin numbers and exit } ADC_PORT = TXD_VAL; // direct outputs to GND 2bd6: 88 e0 ldi r24, 0x08 ; 8 2bd8: 88 b9 out 0x08, r24 ; 8 //Test, if P-JFET or if self-conducting P-MOSFET ADC_DDR = LoADCm; //switch Low-Pin (assumed Drain) direct to GND, 2bda: 67 b8 out 0x07, r6 ; 7 //R_H for Tristate-Pin (assumed Gate) is already switched to VCC R_DDR = TriPinRH | HiPinRL; //High-Pin to output 2bdc: 14 b9 out 0x04, r17 ; 4 R_PORT = TriPinRH | HiPinRL; //High-Pin across R_L to Vcc 2bde: 15 b9 out 0x05, r17 ; 5 adc.hp1 = W10msReadADC(HighPin); //measure voltage at assumed Source 2be0: 8b 2d mov r24, r11 2be2: 0e 94 78 0e call 0x1cf0 ; 0x1cf0 2be6: 8c 01 movw r16, r24 adc.tp1 = ReadADC(TristatePin); // measure Gate voltage 2be8: 88 2d mov r24, r8 2bea: 0e 94 80 0e call 0x1d00 ; 0x1d00 2bee: 7c 01 movw r14, r24 R_PORT = HiPinRL; //switch R_H for Tristate-Pin (assumed Gate) to GND 2bf0: 95 b8 out 0x05, r9 ; 5 adc.hp2 = W10msReadADC(HighPin); //read voltage at assumed Source again 2bf2: 8b 2d mov r24, r11 2bf4: 0e 94 78 0e call 0x1cf0 ; 0x1cf0 //if it is a self-conducting P_MOSFET or P-JFET , then must be: adc.hp1 > adc.hp2 if(adc.hp1>(adc.hp2+599)) { 2bf8: 89 5a subi r24, 0xA9 ; 169 2bfa: 9d 4f sbci r25, 0xFD ; 253 2bfc: 80 17 cp r24, r16 2bfe: 91 07 cpc r25, r17 2c00: 08 f0 brcs .+2 ; 0x2c04 2c02: 36 c4 rjmp .+2156 ; 0x3470 //read voltage at the Gate , to differ between MOSFET and JFET ADC_PORT = HiADCp; //switch High-Pin directly to VCC 2c04: 48 b8 out 0x08, r4 ; 8 ADC_DDR = HiADCm; //switch High-Pin to output 2c06: 3c 85 ldd r19, Y+12 ; 0x0c 2c08: 37 b9 out 0x07, r19 ; 7 adc.tp2 = W10msReadADC(TristatePin); //read voltage at the assumed Gate 2c0a: 88 2d mov r24, r8 2c0c: 0e 94 78 0e call 0x1cf0 ; 0x1cf0 if(adc.tp2<977) { //MOSFET 2c10: 81 3d cpi r24, 0xD1 ; 209 2c12: 93 40 sbci r25, 0x03 ; 3 2c14: 28 f4 brcc .+10 ; 0x2c20 PartFound = PART_FET; //P-Kanal-MOSFET 2c16: 84 e0 ldi r24, 0x04 ; 4 2c18: 80 93 20 01 sts 0x0120, r24 PartMode = PART_MODE_MOS|P_CHANNEL|D_MODE; //Depletion-MOSFET 2c1c: 82 e3 ldi r24, 0x32 ; 50 2c1e: 04 c0 rjmp .+8 ; 0x2c28 } else { //JFET (pn-passage between Gate and Source is conducting) PartFound = PART_FET; //P-Kanal-JFET 2c20: 84 e0 ldi r24, 0x04 ; 4 2c22: 80 93 20 01 sts 0x0120, r24 PartMode = PART_MODE_JFET|P_CHANNEL|D_MODE; 2c26: 84 e3 ldi r24, 0x34 ; 52 2c28: 80 93 1f 01 sts 0x011F, r24 } #if DebugOut == 5 lcd_data('P'); lcd_data('J'); #endif if(adc.tp1 > adc.hp1) { 2c2c: 0e 15 cp r16, r14 2c2e: 1f 05 cpc r17, r15 2c30: 38 f4 brcc .+14 ; 0x2c40 ptrans.gthvoltage = adc.tp1 - adc.hp1; //voltage GS (Gate - Source) 2c32: e0 1a sub r14, r16 2c34: f1 0a sbc r15, r17 2c36: f0 92 70 01 sts 0x0170, r15 2c3a: e0 92 6f 01 sts 0x016F, r14 2c3e: 04 c0 rjmp .+8 ; 0x2c48 } else { ptrans.gthvoltage = 0; 2c40: 10 92 70 01 sts 0x0170, r1 2c44: 10 92 6f 01 sts 0x016F, r1 } ptrans.current = (unsigned int)(((unsigned long)(ADCconfig.U_AVCC - adc.hp1) * 10000) / RR680PL); // Id 1uA 2c48: 20 91 33 01 lds r18, 0x0133 2c4c: 30 91 34 01 lds r19, 0x0134 2c50: 20 1b sub r18, r16 2c52: 31 0b sbc r19, r17 2c54: a0 e1 ldi r26, 0x10 ; 16 2c56: b7 e2 ldi r27, 0x27 ; 39 2c58: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 2c5c: 20 91 21 01 lds r18, 0x0121 2c60: 30 91 22 01 lds r19, 0x0122 2c64: 40 e0 ldi r20, 0x00 ; 0 2c66: 50 e0 ldi r21, 0x00 ; 0 2c68: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 2c6c: 30 93 6c 01 sts 0x016C, r19 2c70: 20 93 6b 01 sts 0x016B, r18 2c74: bc c1 rjmp .+888 ; 0x2fee //there is more than 650uA current without TristatePin current #ifdef COMMON_COLLECTOR // Test circuit with common collector (Emitter follower) PNP ADC_PORT = TXD_VAL; 2c76: 88 e0 ldi r24, 0x08 ; 8 2c78: 88 b9 out 0x08, r24 ; 8 ADC_DDR = LoADCm; // Collector direct to GND 2c7a: 67 b8 out 0x07, r6 ; 7 R_PORT = HiPinRL; // switch R_L port for HighPin (Emitter) to VCC 2c7c: 95 b8 out 0x05, r9 ; 5 R_DDR = TriPinRL | HiPinRL; // Base resistor R_L to GND 2c7e: 59 2d mov r21, r9 2c80: 57 29 or r21, r7 2c82: 59 87 std Y+9, r21 ; 0x09 2c84: 54 b9 out 0x04, r21 ; 4 adc.hp1 = W5msReadADC(HighPin); // voltage at the Emitter resistor 2c86: 8b 2d mov r24, r11 2c88: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 2c8c: 9e 83 std Y+6, r25 ; 0x06 2c8e: 8d 83 std Y+5, r24 ; 0x05 adc.rhp = ADCconfig.U_AVCC - adc.hp1; // voltage at the Emitter resistor 2c90: e0 90 33 01 lds r14, 0x0133 2c94: f0 90 34 01 lds r15, 0x0134 adc.tp1 = ReadADC(TristatePin); // voltage at the base resistor 2c98: 88 2d mov r24, r8 2c9a: 0e 94 80 0e call 0x1d00 ; 0x1d00 2c9e: 9c 83 std Y+4, r25 ; 0x04 2ca0: 8b 83 std Y+3, r24 ; 0x03 if (adc.tp1 < 10) { 2ca2: 0a 97 sbiw r24, 0x0a ; 10 2ca4: b0 f5 brcc .+108 ; 0x2d12 R_DDR = 0; 2ca6: 14 b8 out 0x04, r1 ; 4 wait_about5ms(); // clear TRIAC and Thyristor 2ca8: 81 e0 ldi r24, 0x01 ; 1 2caa: 0e 94 4a 0e call 0x1c94 ; 0x1c94 R_DDR = TriPinRH | HiPinRL; // Tripin=RH- 2cae: 81 2f mov r24, r17 2cb0: 89 29 or r24, r9 2cb2: 84 b9 out 0x04, r24 ; 4 adc.hp1 = W5msReadADC(HighPin); 2cb4: 8b 2d mov r24, r11 2cb6: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 2cba: 9e 83 std Y+6, r25 ; 0x06 2cbc: 8d 83 std Y+5, r24 ; 0x05 adc.rhp = ADCconfig.U_AVCC - adc.hp1; // voltage at the Emitter resistor 2cbe: 80 91 33 01 lds r24, 0x0133 2cc2: 90 91 34 01 lds r25, 0x0134 2cc6: ad 81 ldd r26, Y+5 ; 0x05 2cc8: be 81 ldd r27, Y+6 ; 0x06 2cca: 8a 1b sub r24, r26 2ccc: 9b 0b sbc r25, r27 2cce: 9a 83 std Y+2, r25 ; 0x02 2cd0: 89 83 std Y+1, r24 ; 0x01 adc.tp1 = ReadADC(TristatePin); // voltage at base resistor 2cd2: 88 2d mov r24, r8 2cd4: 0e 94 80 0e call 0x1d00 ; 0x1d00 2cd8: 9c 83 std Y+4, r25 ; 0x04 2cda: 8b 83 std Y+3, r24 ; 0x03 #ifdef LONG_HFE c_hfe = ((unsigned long)adc.rhp * (unsigned long)(((unsigned long)R_H_VAL * 100) / 2cdc: 80 91 21 01 lds r24, 0x0121 2ce0: 90 91 22 01 lds r25, 0x0122 2ce4: 9c 01 movw r18, r24 2ce6: 40 e0 ldi r20, 0x00 ; 0 2ce8: 50 e0 ldi r21, 0x00 ; 0 2cea: 60 e6 ldi r22, 0x60 ; 96 2cec: 77 eb ldi r23, 0xB7 ; 183 2cee: 87 e4 ldi r24, 0x47 ; 71 2cf0: 90 e0 ldi r25, 0x00 ; 0 2cf2: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 2cf6: a9 81 ldd r26, Y+1 ; 0x01 2cf8: ba 81 ldd r27, Y+2 ; 0x02 2cfa: 0e 94 5a 38 call 0x70b4 ; 0x70b4 <__muluhisi3> (unsigned int)RR680PL)) / (unsigned int)adc.tp1; 2cfe: eb 81 ldd r30, Y+3 ; 0x03 2d00: fc 81 ldd r31, Y+4 ; 0x04 2d02: 9f 01 movw r18, r30 2d04: 40 e0 ldi r20, 0x00 ; 0 2d06: 50 e0 ldi r21, 0x00 ; 0 R_DDR = TriPinRH | HiPinRL; // Tripin=RH- adc.hp1 = W5msReadADC(HighPin); adc.rhp = ADCconfig.U_AVCC - adc.hp1; // voltage at the Emitter resistor adc.tp1 = ReadADC(TristatePin); // voltage at base resistor #ifdef LONG_HFE c_hfe = ((unsigned long)adc.rhp * (unsigned long)(((unsigned long)R_H_VAL * 100) / 2d08: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 2d0c: 69 01 movw r12, r18 2d0e: 7a 01 movw r14, r20 2d10: 12 c0 rjmp .+36 ; 0x2d36 ADC_PORT = TXD_VAL; ADC_DDR = LoADCm; // Collector direct to GND R_PORT = HiPinRL; // switch R_L port for HighPin (Emitter) to VCC R_DDR = TriPinRL | HiPinRL; // Base resistor R_L to GND adc.hp1 = W5msReadADC(HighPin); // voltage at the Emitter resistor adc.rhp = ADCconfig.U_AVCC - adc.hp1; // voltage at the Emitter resistor 2d12: 97 01 movw r18, r14 2d14: 4d 81 ldd r20, Y+5 ; 0x05 2d16: 5e 81 ldd r21, Y+6 ; 0x06 2d18: 24 1b sub r18, r20 2d1a: 35 0b sbc r19, r21 2d1c: 3a 83 std Y+2, r19 ; 0x02 2d1e: 29 83 std Y+1, r18 ; 0x01 (unsigned int)RR680PL)) / (unsigned int)adc.tp1; #else c_hfe = ((adc.rhp / ((RR680PL+500)/1000)) * (R_H_VAL/500)) / (adc.tp1/500); #endif } else { c_hfe = (unsigned long)((adc.rhp - adc.tp1) / adc.tp1); 2d20: c9 01 movw r24, r18 2d22: ab 81 ldd r26, Y+3 ; 0x03 2d24: bc 81 ldd r27, Y+4 ; 0x04 2d26: 8a 1b sub r24, r26 2d28: 9b 0b sbc r25, r27 2d2a: bd 01 movw r22, r26 2d2c: 0e 94 75 38 call 0x70ea ; 0x70ea <__udivmodhi4> 2d30: 6b 01 movw r12, r22 2d32: e1 2c mov r14, r1 2d34: f1 2c mov r15, r1 } #endif //set Pins again for circuit with common Emitter PNP R_DDR = 0; //all Resistor Ports to Input 2d36: 14 b8 out 0x04, r1 ; 4 R_PORT = 0; //switch all resistor ports to GND 2d38: 15 b8 out 0x05, r1 ; 5 ADC_PORT = HiADCp; //switch High-Pin to VCC 2d3a: 48 b8 out 0x08, r4 ; 8 ADC_DDR = HiADCm; //switch High-Pin to output 2d3c: bc 85 ldd r27, Y+12 ; 0x0c 2d3e: b7 b9 out 0x07, r27 ; 7 // R_DDR = LoPinRL; //switch R_L port for Low-Pin to output (GND) wait_about5ms(); 2d40: 81 e0 ldi r24, 0x01 ; 1 2d42: 0e 94 4a 0e call 0x1c94 ; 0x1c94 if(adc.lp_otr < 1977) { 2d46: e9 eb ldi r30, 0xB9 ; 185 2d48: 2e 16 cp r2, r30 2d4a: e7 e0 ldi r30, 0x07 ; 7 2d4c: 3e 06 cpc r3, r30 2d4e: 08 f0 brcs .+2 ; 0x2d52 2d50: 8f c3 rjmp .+1822 ; 0x3470 lcd_data('E'); lcd_testpin(HighPin); lcd_space(); #endif //Test to PNP R_DDR = LoPinRL | TriPinRL; //switch R_L port for Tristate-Pin to output (GND), for Test of PNP 2d52: 04 b9 out 0x04, r16 ; 4 adc.lp1 = W5msReadADC(LowPin); //measure voltage at LowPin 2d54: 8a 2d mov r24, r10 2d56: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 if(adc.lp1 > 3422) { 2d5a: 8f 35 cpi r24, 0x5F ; 95 2d5c: 9d 40 sbci r25, 0x0D ; 13 2d5e: 08 f4 brcc .+2 ; 0x2d62 2d60: 4c c1 rjmp .+664 ; 0x2ffa //component has current => PNP-Transistor or equivalent R_DDR = 0; 2d62: 14 b8 out 0x04, r1 ; 4 wait_about5ms(); // clear TRIAC and Thyristor 2d64: 81 e0 ldi r24, 0x01 ; 1 2d66: 0e 94 4a 0e call 0x1c94 ; 0x1c94 //compute current amplification factor in both directions R_DDR = LoPinRL | TriPinRH; //switch R_H port for Tristate-Pin (Base) to output (GND) 2d6a: 21 2f mov r18, r17 2d6c: 25 29 or r18, r5 2d6e: 29 8b std Y+17, r18 ; 0x11 2d70: 24 b9 out 0x04, r18 ; 4 adc.lp1 = W5msReadADC(LowPin); //measure voltage at LowPin (assumed Collector) 2d72: 8a 2d mov r24, r10 2d74: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 2d78: 99 8f std Y+25, r25 ; 0x19 2d7a: 88 8f std Y+24, r24 ; 0x18 adc.tp2 = ReadADC(TristatePin); //measure voltage at TristatePin (Base) 2d7c: 88 2d mov r24, r8 2d7e: 0e 94 80 0e call 0x1d00 ; 0x1d00 2d82: 98 8b std Y+16, r25 ; 0x10 2d84: 8f 87 std Y+15, r24 ; 0x0f adc.hp2 = ReadADC(HighPin); //measure voltage at HighPin (assumed Emitter) 2d86: 8b 2d mov r24, r11 2d88: 0e 94 80 0e call 0x1d00 ; 0x1d00 2d8c: 9b 87 std Y+11, r25 ; 0x0b 2d8e: 8a 87 std Y+10, r24 ; 0x0a if(adc.tp2 > 2000) { 2d90: 4f 85 ldd r20, Y+15 ; 0x0f 2d92: 58 89 ldd r21, Y+16 ; 0x10 2d94: 41 3d cpi r20, 0xD1 ; 209 2d96: 57 40 sbci r21, 0x07 ; 7 2d98: 08 f4 brcc .+2 ; 0x2d9c 2d9a: b3 c0 rjmp .+358 ; 0x2f02 //PNP-Transistor is found (Base voltage moves with Emitter to VCC) PartFound = PART_TRANSISTOR; 2d9c: 83 e0 ldi r24, 0x03 ; 3 2d9e: 80 93 20 01 sts 0x0120, r24 PartMode = PART_MODE_PNP; 2da2: 8d e0 ldi r24, 0x0D ; 13 2da4: 80 93 1f 01 sts 0x011F, r24 update_pins = 0; // only update pins, if hFE is higher or Thyristor #ifdef COMMON_EMITTER //compute current amplification factor for circuit with common Emitter //e_hFE = B = Collector current / Base current tmp16 = adc.lp1; if (tmp16 > adc.lp_otr) { 2da8: a8 8d ldd r26, Y+24 ; 0x18 2daa: b9 8d ldd r27, Y+25 ; 0x19 2dac: 2a 16 cp r2, r26 2dae: 3b 06 cpc r3, r27 2db0: 20 f4 brcc .+8 ; 0x2dba tmp16 -= adc.lp_otr; 2db2: 8d 01 movw r16, r26 2db4: 02 19 sub r16, r2 2db6: 13 09 sbc r17, r3 2db8: 02 c0 rjmp .+4 ; 0x2dbe 2dba: 08 8d ldd r16, Y+24 ; 0x18 2dbc: 19 8d ldd r17, Y+25 ; 0x19 } #ifdef LONG_HFE e_hfe = ((unsigned int)tmp16 * (unsigned long)(((unsigned long)R_H_VAL * 100) / 2dbe: 40 90 1a 01 lds r4, 0x011A 2dc2: 50 90 1b 01 lds r5, 0x011B 2dc6: 61 2c mov r6, r1 2dc8: 71 2c mov r7, r1 2dca: 60 e6 ldi r22, 0x60 ; 96 2dcc: 77 eb ldi r23, 0xB7 ; 183 2dce: 87 e4 ldi r24, 0x47 ; 71 2dd0: 90 e0 ldi r25, 0x00 ; 0 2dd2: a3 01 movw r20, r6 2dd4: 92 01 movw r18, r4 2dd6: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 2dda: d8 01 movw r26, r16 2ddc: 0e 94 5a 38 call 0x70b4 ; 0x70b4 <__muluhisi3> (unsigned int)RR680MI)) / (unsigned int)adc.tp2; 2de0: ef 85 ldd r30, Y+15 ; 0x0f 2de2: f8 89 ldd r31, Y+16 ; 0x10 2de4: 8f 01 movw r16, r30 2de6: 20 e0 ldi r18, 0x00 ; 0 2de8: 30 e0 ldi r19, 0x00 ; 0 if (tmp16 > adc.lp_otr) { tmp16 -= adc.lp_otr; } #ifdef LONG_HFE e_hfe = ((unsigned int)tmp16 * (unsigned long)(((unsigned long)R_H_VAL * 100) / 2dea: a9 01 movw r20, r18 2dec: 98 01 movw r18, r16 2dee: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> (unsigned int)RR680MI)) / (unsigned int)adc.tp2; #else e_hfe = ((tmp16 / ((RR680MI+500)/1000)) * (R_H_VAL/500)) / (adc.tp2/500); #endif // first hFE or e_hfe is greater than last hfe ? if ((ptrans.count == 0) || (e_hfe > ptrans.hfe)){ 2df2: 80 91 74 01 lds r24, 0x0174 2df6: 88 23 and r24, r24 2df8: 69 f0 breq .+26 ; 0x2e14 2dfa: 80 91 65 01 lds r24, 0x0165 2dfe: 90 91 66 01 lds r25, 0x0166 2e02: a0 91 67 01 lds r26, 0x0167 2e06: b0 91 68 01 lds r27, 0x0168 2e0a: 82 17 cp r24, r18 2e0c: 93 07 cpc r25, r19 2e0e: a4 07 cpc r26, r20 2e10: b5 07 cpc r27, r21 2e12: 10 f5 brcc .+68 ; 0x2e58 ptrans.hfe = e_hfe; // hFE with common emitter 2e14: 20 93 65 01 sts 0x0165, r18 2e18: 30 93 66 01 sts 0x0166, r19 2e1c: 40 93 67 01 sts 0x0167, r20 2e20: 50 93 68 01 sts 0x0168, r21 #if FLASHEND > 0x1fff /* at least ATmega16 */ ptrans.current = (unsigned int)(((unsigned long)adc.lp1 * 10000) / RR680MI); // Ic 1uA 2e24: 28 8d ldd r18, Y+24 ; 0x18 2e26: 39 8d ldd r19, Y+25 ; 0x19 2e28: a0 e1 ldi r26, 0x10 ; 16 2e2a: b7 e2 ldi r27, 0x27 ; 39 2e2c: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 2e30: a3 01 movw r20, r6 2e32: 92 01 movw r18, r4 2e34: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 2e38: 30 93 6c 01 sts 0x016C, r19 2e3c: 20 93 6b 01 sts 0x016B, r18 #endif ptrans.uBE = adc.hp2 - adc.tp2; // Base Emitter Voltage 2e40: 8a 85 ldd r24, Y+10 ; 0x0a 2e42: 9b 85 ldd r25, Y+11 ; 0x0b 2e44: 2f 85 ldd r18, Y+15 ; 0x0f 2e46: 38 89 ldd r19, Y+16 ; 0x10 2e48: 82 1b sub r24, r18 2e4a: 93 0b sbc r25, r19 2e4c: 90 93 6a 01 sts 0x016A, r25 2e50: 80 93 69 01 sts 0x0169, r24 update_pins = 1; // trans.ebc must be updated 2e54: 21 e0 ldi r18, 0x01 ; 1 2e56: 01 c0 rjmp .+2 ; 0x2e5a if(adc.tp2 > 2000) { //PNP-Transistor is found (Base voltage moves with Emitter to VCC) PartFound = PART_TRANSISTOR; PartMode = PART_MODE_PNP; update_pins = 0; // only update pins, if hFE is higher or Thyristor 2e58: 20 e0 ldi r18, 0x00 ; 0 #ifdef COMMON_COLLECTOR //current amplification factor for common Collector (Emitter follower) // c_hFE = (Emitter current - Base current) / Base current #ifdef COMMON_EMITTER // also with COMMON_EMITTER, is c_hfe greater than the last hFE? if (c_hfe > ptrans.hfe) // trans.hfe is allready e_hfe or last c_hFE 2e5a: 80 91 65 01 lds r24, 0x0165 2e5e: 90 91 66 01 lds r25, 0x0166 2e62: a0 91 67 01 lds r26, 0x0167 2e66: b0 91 68 01 lds r27, 0x0168 2e6a: 8c 15 cp r24, r12 2e6c: 9d 05 cpc r25, r13 2e6e: ae 05 cpc r26, r14 2e70: bf 05 cpc r27, r15 2e72: 38 f5 brcc .+78 ; 0x2ec2 #else // without COMMON_EMITTER , c_hFE is first or greater than the old one? if ((ptrans.count == 0) || (c_hfe > ptrans.hfe)) #endif { ptrans.hfe = c_hfe; // c_hfe is the best 2e74: c0 92 65 01 sts 0x0165, r12 2e78: d0 92 66 01 sts 0x0166, r13 2e7c: e0 92 67 01 sts 0x0167, r14 2e80: f0 92 68 01 sts 0x0168, r15 ptrans.uBE = adc.hp1 - adc.tp1; // Base Emitter Voltage common collector 2e84: 8d 81 ldd r24, Y+5 ; 0x05 2e86: 9e 81 ldd r25, Y+6 ; 0x06 2e88: 4b 81 ldd r20, Y+3 ; 0x03 2e8a: 5c 81 ldd r21, Y+4 ; 0x04 2e8c: 84 1b sub r24, r20 2e8e: 95 0b sbc r25, r21 2e90: 90 93 6a 01 sts 0x016A, r25 2e94: 80 93 69 01 sts 0x0169, r24 #if FLASHEND > 0x1fff /* at least ATmega16 */ ptrans.current = (unsigned int)(((unsigned long)adc.rhp * 10000) / RR680PL); // Ie 1uA 2e98: 29 81 ldd r18, Y+1 ; 0x01 2e9a: 3a 81 ldd r19, Y+2 ; 0x02 2e9c: a0 e1 ldi r26, 0x10 ; 16 2e9e: b7 e2 ldi r27, 0x27 ; 39 2ea0: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 2ea4: 20 91 21 01 lds r18, 0x0121 2ea8: 30 91 22 01 lds r19, 0x0122 2eac: 40 e0 ldi r20, 0x00 ; 0 2eae: 50 e0 ldi r21, 0x00 ; 0 2eb0: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> ptrans.current += 10000; // current at emitter! 2eb4: 20 5f subi r18, 0xF0 ; 240 2eb6: 38 4d sbci r19, 0xD8 ; 216 2eb8: 30 93 6c 01 sts 0x016C, r19 2ebc: 20 93 6b 01 sts 0x016B, r18 2ec0: 03 c0 rjmp .+6 ; 0x2ec8 #endif #if DebugOut == 5 lcd_data('B'); #endif #ifdef SHOW_ICE if (update_pins != 0) { 2ec2: 22 23 and r18, r18 2ec4: 09 f4 brne .+2 ; 0x2ec8 2ec6: 9b c3 rjmp .+1846 ; 0x35fe // update residual collector current without base current ptrans.ice0 = (unsigned int)(((unsigned long)adc.lp_otr * 10000) / RR680MI); // ICE0 0.01mA 2ec8: 91 01 movw r18, r2 2eca: a0 e1 ldi r26, 0x10 ; 16 2ecc: b7 e2 ldi r27, 0x27 ; 39 2ece: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 2ed2: a3 01 movw r20, r6 2ed4: 92 01 movw r18, r4 2ed6: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 2eda: 30 93 6e 01 sts 0x016E, r19 2ede: 20 93 6d 01 sts 0x016D, r18 ptrans.ices = (unsigned int)(((unsigned long)adc.vCEs * 10000) / RR680MI); // ICEs 0.01mA 2ee2: 2f 81 ldd r18, Y+7 ; 0x07 2ee4: 38 85 ldd r19, Y+8 ; 0x08 2ee6: a0 e1 ldi r26, 0x10 ; 16 2ee8: b7 e2 ldi r27, 0x27 ; 39 2eea: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 2eee: a3 01 movw r20, r6 2ef0: 92 01 movw r18, r4 2ef2: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 2ef6: 30 93 70 01 sts 0x0170, r19 2efa: 20 93 6f 01 sts 0x016F, r18 2efe: 21 e0 ldi r18, 0x01 ; 1 2f00: 7e c3 rjmp .+1788 ; 0x35fe } #endif goto savePresult; // marke P type, save Pins and exit } // is probably a P-E-MOS, check voltage if((adc.lp_otr < 97) && (adc.lp1 > 2000)) { 2f02: 51 e6 ldi r21, 0x61 ; 97 2f04: 25 16 cp r2, r21 2f06: 31 04 cpc r3, r1 2f08: 08 f0 brcs .+2 ; 0x2f0c 2f0a: 77 c0 rjmp .+238 ; 0x2ffa 2f0c: 88 8d ldd r24, Y+24 ; 0x18 2f0e: 99 8d ldd r25, Y+25 ; 0x19 2f10: 81 3d cpi r24, 0xD1 ; 209 2f12: 97 40 sbci r25, 0x07 ; 7 2f14: 08 f4 brcc .+2 ; 0x2f18 2f16: 71 c0 rjmp .+226 ; 0x2ffa //is flow voltage low enough in the closed state? //(since D-Mode-FET would be by mistake detected as E-Mode ) PartFound = PART_FET; //P-Kanal-MOSFET is found (Basis/Gate moves not to VCC) 2f18: 84 e0 ldi r24, 0x04 ; 4 2f1a: 80 93 20 01 sts 0x0120, r24 PartMode = PART_MODE_MOS|P_CHANNEL|E_MODE; 2f1e: 82 e1 ldi r24, 0x12 ; 18 2f20: 80 93 1f 01 sts 0x011F, r24 if (adc.hp2 > (adc.lp1+250)) { 2f24: 88 8d ldd r24, Y+24 ; 0x18 2f26: 99 8d ldd r25, Y+25 ; 0x19 2f28: 86 50 subi r24, 0x06 ; 6 2f2a: 9f 4f sbci r25, 0xFF ; 255 2f2c: ea 85 ldd r30, Y+10 ; 0x0a 2f2e: fb 85 ldd r31, Y+11 ; 0x0b 2f30: 8e 17 cp r24, r30 2f32: 9f 07 cpc r25, r31 2f34: 20 f4 brcc .+8 ; 0x2f3e //Drain-Source Voltage to high, must be a IGBT PartMode = PART_MODE_IGBT|P_CHANNEL|E_MODE; 2f36: 83 e1 ldi r24, 0x13 ; 19 2f38: 80 93 1f 01 sts 0x011F, r24 2f3c: 1d c0 rjmp .+58 ; 0x2f78 #if FLASHEND > 0x3fff } else { if (adc.hp2 > adc.lp1) { 2f3e: 2a 85 ldd r18, Y+10 ; 0x0a 2f40: 3b 85 ldd r19, Y+11 ; 0x0b 2f42: 48 8d ldd r20, Y+24 ; 0x18 2f44: 59 8d ldd r21, Y+25 ; 0x19 2f46: 42 17 cp r20, r18 2f48: 53 07 cpc r21, r19 2f4a: 90 f4 brcc .+36 ; 0x2f70 ptrans.uBE = RR680MI * (unsigned long)(adc.hp2 - adc.lp1) / adc.lp1; // DS resistance in 0.1 OHm 2f4c: a0 91 1a 01 lds r26, 0x011A 2f50: b0 91 1b 01 lds r27, 0x011B 2f54: 24 1b sub r18, r20 2f56: 35 0b sbc r19, r21 2f58: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 2f5c: 9a 01 movw r18, r20 2f5e: 40 e0 ldi r20, 0x00 ; 0 2f60: 50 e0 ldi r21, 0x00 ; 0 2f62: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 2f66: 30 93 6a 01 sts 0x016A, r19 2f6a: 20 93 69 01 sts 0x0169, r18 2f6e: 04 c0 rjmp .+8 ; 0x2f78 } else { ptrans.uBE = 0; 2f70: 10 92 6a 01 sts 0x016A, r1 2f74: 10 92 69 01 sts 0x0169, r1 } /* end if (adc.hp2 > (adc.lp1+250)) */ //measure the Gate threshold voltage //Switching of Drain is monitored with digital input // Low level is specified up to 0.3 * VCC // High level is specified above 0.6 * VCC PinMSK = LoADCm & 7; 2f78: 5d 85 ldd r21, Y+13 ; 0x0d 2f7a: 57 70 andi r21, 0x07 ; 7 2f7c: d5 2e mov r13, r21 ADMUX = TristatePin | (1< R_DDR = LoPinRL | TriPinRH; //switch R_H for Tristate-Pin (Basis) to GND 2fa0: 89 89 ldd r24, Y+17 ; 0x11 2fa2: 84 b9 out 0x04, r24 ; 4 while (!(ADC_PIN&PinMSK)); // Wait, until the MOSFET switches and Drain moves to VCC 2fa4: 86 b1 in r24, 0x06 ; 6 2fa6: 8d 21 and r24, r13 2fa8: e9 f3 breq .-6 ; 0x2fa4 // 1 is detected with more than 2.5V (up to 2.57V) with tests of mega168 and mega328 R_DDR = LoPinRL; 2faa: 54 b8 out 0x04, r5 ; 4 ADCSRA |= (1< tmp16 += (1023 - ADCW); // Add Tristatepin-Voltage 2fbe: 80 91 78 00 lds r24, 0x0078 2fc2: 90 91 79 00 lds r25, 0x0079 2fc6: d7 01 movw r26, r14 2fc8: a8 1b sub r26, r24 2fca: b9 0b sbc r27, r25 2fcc: 0a 0f add r16, r26 2fce: 1b 1f adc r17, r27 2fd0: ca 94 dec r12 // Low level is specified up to 0.3 * VCC // High level is specified above 0.6 * VCC PinMSK = LoADCm & 7; ADMUX = TristatePin | (1< R_DDR = LoPinRL; ADCSRA |= (1< 2fe6: 70 93 70 01 sts 0x0170, r23 2fea: 60 93 6f 01 sts 0x016F, r22 ptrans.count++; // count FET as two for accelerate searching 2fee: 80 91 74 01 lds r24, 0x0174 2ff2: 8f 5f subi r24, 0xFF ; 255 2ff4: 80 93 74 01 sts 0x0174, r24 2ff8: 82 cf rjmp .-252 ; 0x2efe } } // end component has current => PNP #ifdef COMMON_COLLECTOR // Low-Pin=RL- HighPin=VCC R_DDR = LoPinRL | TriPinRL; 2ffa: 04 b9 out 0x04, r16 ; 4 R_PORT = TriPinRL; // TriPin=RL+ NPN with common Collector 2ffc: 75 b8 out 0x05, r7 ; 5 adc.lp1 = W5msReadADC(LowPin); // voltage at Emitter resistor 2ffe: 8a 2d mov r24, r10 3000: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 3004: 9a 83 std Y+2, r25 ; 0x02 3006: 89 83 std Y+1, r24 ; 0x01 adc.tp1 = ReadADC(TristatePin); // voltage at the Base 3008: 88 2d mov r24, r8 300a: 0e 94 80 0e call 0x1d00 ; 0x1d00 300e: 9c 83 std Y+4, r25 ; 0x04 3010: 8b 83 std Y+3, r24 ; 0x03 adc.rtp = ADCconfig.U_AVCC - adc.tp1; // voltage at Base resistor 3012: 60 91 33 01 lds r22, 0x0133 3016: 70 91 34 01 lds r23, 0x0134 301a: 68 1b sub r22, r24 301c: 79 0b sbc r23, r25 if (adc.rtp < 10) { 301e: 6a 30 cpi r22, 0x0A ; 10 3020: 71 05 cpc r23, r1 3022: 90 f5 brcc .+100 ; 0x3088 R_DDR = 0; 3024: 14 b8 out 0x04, r1 ; 4 wait_about5ms(); // clear TRIAC and Thyristor 3026: 81 e0 ldi r24, 0x01 ; 1 3028: 0e 94 4a 0e call 0x1c94 ; 0x1c94 R_DDR = LoPinRL | TriPinRH; 302c: 81 2f mov r24, r17 302e: 85 29 or r24, r5 3030: 84 b9 out 0x04, r24 ; 4 R_PORT = TriPinRH; // Tripin=RH+ 3032: 15 b9 out 0x05, r17 ; 5 adc.lp1 = W5msReadADC(LowPin); 3034: 8a 2d mov r24, r10 3036: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 303a: 9a 83 std Y+2, r25 ; 0x02 303c: 89 83 std Y+1, r24 ; 0x01 adc.tp1 = ReadADC(TristatePin); // voltage at the Base 303e: 88 2d mov r24, r8 3040: 0e 94 80 0e call 0x1d00 ; 0x1d00 3044: 9c 83 std Y+4, r25 ; 0x04 3046: 8b 83 std Y+3, r24 ; 0x03 adc.rtp = ADCconfig.U_AVCC - adc.tp1; // voltage at Base resistor #ifdef LONG_HFE c_hfe = ((unsigned long)adc.lp1 * (unsigned long)(((unsigned long)R_H_VAL * 100) / 3048: 80 91 1a 01 lds r24, 0x011A 304c: 90 91 1b 01 lds r25, 0x011B 3050: 9c 01 movw r18, r24 3052: 40 e0 ldi r20, 0x00 ; 0 3054: 50 e0 ldi r21, 0x00 ; 0 3056: 60 e6 ldi r22, 0x60 ; 96 3058: 77 eb ldi r23, 0xB7 ; 183 305a: 87 e4 ldi r24, 0x47 ; 71 305c: 90 e0 ldi r25, 0x00 ; 0 305e: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 3062: a9 81 ldd r26, Y+1 ; 0x01 3064: ba 81 ldd r27, Y+2 ; 0x02 3066: 0e 94 5a 38 call 0x70b4 ; 0x70b4 <__muluhisi3> wait_about5ms(); // clear TRIAC and Thyristor R_DDR = LoPinRL | TriPinRH; R_PORT = TriPinRH; // Tripin=RH+ adc.lp1 = W5msReadADC(LowPin); adc.tp1 = ReadADC(TristatePin); // voltage at the Base adc.rtp = ADCconfig.U_AVCC - adc.tp1; // voltage at Base resistor 306a: 20 91 33 01 lds r18, 0x0133 306e: 30 91 34 01 lds r19, 0x0134 3072: eb 81 ldd r30, Y+3 ; 0x03 3074: fc 81 ldd r31, Y+4 ; 0x04 3076: 2e 1b sub r18, r30 3078: 3f 0b sbc r19, r31 #ifdef LONG_HFE c_hfe = ((unsigned long)adc.lp1 * (unsigned long)(((unsigned long)R_H_VAL * 100) / (unsigned int)RR680MI)) / (unsigned int)adc.rtp; 307a: 40 e0 ldi r20, 0x00 ; 0 307c: 50 e0 ldi r21, 0x00 ; 0 R_PORT = TriPinRH; // Tripin=RH+ adc.lp1 = W5msReadADC(LowPin); adc.tp1 = ReadADC(TristatePin); // voltage at the Base adc.rtp = ADCconfig.U_AVCC - adc.tp1; // voltage at Base resistor #ifdef LONG_HFE c_hfe = ((unsigned long)adc.lp1 * (unsigned long)(((unsigned long)R_H_VAL * 100) / 307e: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 3082: 69 01 movw r12, r18 3084: 7a 01 movw r14, r20 3086: 09 c0 rjmp .+18 ; 0x309a (unsigned int)RR680MI)) / (unsigned int)adc.rtp; #else c_hfe = ((adc.lp1 / ((RR680MI+500)/1000)) * (R_H_VAL/500)) / (adc.tp2/500); #endif } else { c_hfe = (adc.lp1 - adc.rtp) / adc.rtp; 3088: 89 81 ldd r24, Y+1 ; 0x01 308a: 9a 81 ldd r25, Y+2 ; 0x02 308c: 86 1b sub r24, r22 308e: 97 0b sbc r25, r23 3090: 0e 94 75 38 call 0x70ea ; 0x70ea <__udivmodhi4> 3094: 6b 01 movw r12, r22 3096: e1 2c mov r14, r1 3098: f1 2c mov r15, r1 } #endif //Tristate (can be Base) to VCC, Test if NPN ADC_DDR = LoADCm; //Low-Pin to output 0V 309a: 67 b8 out 0x07, r6 ; 7 ADC_PORT = TXD_VAL; //switch Low-Pin to GND 309c: 88 e0 ldi r24, 0x08 ; 8 309e: 88 b9 out 0x08, r24 ; 8 R_DDR = TriPinRL | HiPinRL; //RL port for High-Pin and Tristate-Pin to output 30a0: f9 85 ldd r31, Y+9 ; 0x09 30a2: f4 b9 out 0x04, r31 ; 4 // vCEs is already measured correctly with common emitter circuit //#ifdef SHOW_ICE // R_PORT = HiPinRL; //RL port for High-Pin and Tristate-Pin to GND // adc.vCEs = ADCconfig.U_AVCC - W5msReadADC(HighPin); // measure voltage a High-Pin, Base low //#endif R_PORT = TriPinRL | HiPinRL; //RL port for High-Pin and Tristate-Pin to Vcc 30a4: f5 b9 out 0x05, r31 ; 5 adc.hp1 = W5msReadADC(HighPin); //measure voltage at High-Pin (Collector) 30a6: 8b 2d mov r24, r11 30a8: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 30ac: 9b 87 std Y+11, r25 ; 0x0b 30ae: 8a 87 std Y+10, r24 ; 0x0a #ifdef WITH_THYRISTOR_GATE_V adc.tp2 = ReadADC(TristatePin); //voltage of gate 30b0: 88 2d mov r24, r8 30b2: 0e 94 80 0e call 0x1d00 ; 0x1d00 30b6: 9e 83 std Y+6, r25 ; 0x06 30b8: 8d 83 std Y+5, r24 ; 0x05 adc.lp2 = ReadADC(LowPin); //voltage of Cathode 30ba: 8a 2d mov r24, r10 30bc: 0e 94 80 0e call 0x1d00 ; 0x1d00 30c0: ac 01 movw r20, r24 #endif if(adc.hp1 < 1600) { 30c2: 2a 85 ldd r18, Y+10 ; 0x0a 30c4: 3b 85 ldd r19, Y+11 ; 0x0b 30c6: 20 34 cpi r18, 0x40 ; 64 30c8: 36 40 sbci r19, 0x06 ; 6 30ca: 08 f0 brcs .+2 ; 0x30ce 30cc: ce c1 rjmp .+924 ; 0x346a //Gate discharge // ChargePin10ms(TriPinRL,0); //Tristate-Pin (Gate) across R_L 10ms to GND // TRIAC's can be triggered with gate and A1 (C) swapped. The current remains after triggering // from gate to A2 (A) instead of A1 to A2. I have found that in this state the current will be lower, // if the Tristatepin (A1) is switched to GND. R_PORT = HiPinRL; 30ce: 95 b8 out 0x05, r9 ; 5 adc.hp4 = W5msReadADC(HighPin); //read voltage with switched back base 30d0: 8b 2d mov r24, r11 30d2: 4d 8b std Y+21, r20 ; 0x15 30d4: 5e 8b std Y+22, r21 ; 0x16 30d6: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 30da: bc 01 movw r22, r24 R_DDR = HiPinRL; // base to input 30dc: 94 b8 out 0x04, r9 ; 4 adc.hp3 = W5msReadADC(HighPin); //read voltage at High-Pin (probably Anode) again 30de: 8b 2d mov r24, r11 30e0: 6b 8b std Y+19, r22 ; 0x13 30e2: 7c 8b std Y+20, r23 ; 0x14 30e4: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 30e8: 9c 01 movw r18, r24 //current should still flow, if not, // no Thyristor or holding current to low R_PORT = 0; //switch R_L for High-Pin (probably Anode) to GND (turn off) 30ea: 15 b8 out 0x05, r1 ; 5 wait_about5ms(); 30ec: 81 e0 ldi r24, 0x01 ; 1 30ee: 2f 8b std Y+23, r18 ; 0x17 30f0: 3a 8b std Y+18, r19 ; 0x12 30f2: 0e 94 4a 0e call 0x1c94 ; 0x1c94 R_PORT = HiPinRL; //switch R_L for High-Pin (probably Anode) again to VCC 30f6: 95 b8 out 0x05, r9 ; 5 adc.hp2 = W5msReadADC(HighPin); //measure voltage at the High-Pin (probably Anode) again 30f8: 8b 2d mov r24, r11 30fa: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 if((adc.hp3 < 1600) && (adc.hp2 > 4400) 30fe: 2f 89 ldd r18, Y+23 ; 0x17 3100: 3a 89 ldd r19, Y+18 ; 0x12 3102: 4d 89 ldd r20, Y+21 ; 0x15 3104: 5e 89 ldd r21, Y+22 ; 0x16 3106: 6b 89 ldd r22, Y+19 ; 0x13 3108: 7c 89 ldd r23, Y+20 ; 0x14 310a: 20 34 cpi r18, 0x40 ; 64 310c: 36 40 sbci r19, 0x06 ; 6 310e: 08 f0 brcs .+2 ; 0x3112 3110: 5b c0 rjmp .+182 ; 0x31c8 3112: 81 33 cpi r24, 0x31 ; 49 3114: 91 41 sbci r25, 0x11 ; 17 3116: 08 f4 brcc .+2 ; 0x311a 3118: 57 c0 rjmp .+174 ; 0x31c8 // additional check the voltage hp4 at A with gate hold at GND level && ((adc.hp1+150) > adc.hp4) 311a: 8a 85 ldd r24, Y+10 ; 0x0a 311c: 9b 85 ldd r25, Y+11 ; 0x0b 311e: 8a 56 subi r24, 0x6A ; 106 3120: 9f 4f sbci r25, 0xFF ; 255 3122: 68 17 cp r22, r24 3124: 79 07 cpc r23, r25 3126: 08 f0 brcs .+2 ; 0x312a 3128: 4f c0 rjmp .+158 ; 0x31c8 ) { //if the holding current was switched off the thyristor must be switched off too. //if Thyristor was still swiched on, if gate was switched off => Thyristor PartFound = PART_THYRISTOR; 312a: 85 e0 ldi r24, 0x05 ; 5 312c: 80 93 20 01 sts 0x0120, r24 lcd_data('Y'); lcd_testpin(HighPin); lcd_space(); #endif ntrans.count++; // mark as two N-type transistors 3130: 80 91 5a 01 lds r24, 0x015A 3134: 8f 5f subi r24, 0xFF ; 255 3136: 80 93 5a 01 sts 0x015A, r24 #ifdef WITH_THYRISTOR_GATE_V ntrans.uBE = adc.tp2 - adc.lp2; // Gate - Cathode Voltage 313a: 8d 81 ldd r24, Y+5 ; 0x05 313c: 9e 81 ldd r25, Y+6 ; 0x06 313e: 84 1b sub r24, r20 3140: 95 0b sbc r25, r21 3142: 90 93 50 01 sts 0x0150, r25 3146: 80 93 4f 01 sts 0x014F, r24 ntrans.gthvoltage = adc.hp1 - adc.lp2; // Anode-Cathode Voltage 314a: 2a 85 ldd r18, Y+10 ; 0x0a 314c: 3b 85 ldd r19, Y+11 ; 0x0b 314e: 24 1b sub r18, r20 3150: 35 0b sbc r19, r21 3152: 30 93 56 01 sts 0x0156, r19 3156: 20 93 55 01 sts 0x0155, r18 #endif //Test if Triac R_DDR = 0; 315a: 14 b8 out 0x04, r1 ; 4 R_PORT = 0; 315c: 15 b8 out 0x05, r1 ; 5 ADC_PORT = LoADCp; //Low-Pin fix to VCC 315e: ed 85 ldd r30, Y+13 ; 0x0d 3160: e8 b9 out 0x08, r30 ; 8 wait_about5ms(); 3162: 81 e0 ldi r24, 0x01 ; 1 3164: 0e 94 4a 0e call 0x1c94 ; 0x1c94 R_DDR = HiPinRL; //switch R_L port HighPin to output (GND) 3168: 94 b8 out 0x04, r9 ; 4 if(W5msReadADC(HighPin) > 244) { 316a: 8b 2d mov r24, r11 316c: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 3170: 85 3f cpi r24, 0xF5 ; 245 3172: 91 05 cpc r25, r1 3174: 08 f0 brcs .+2 ; 0x3178 3176: 51 c2 rjmp .+1186 ; 0x361a lcd_space(); #endif goto saveNresult; //measure voltage at the High-Pin (probably A2); if too high: //component has current => kein Triac } R_DDR = HiPinRL | TriPinRL; //switch R_L port for TristatePin (Gate) to output (GND) => Triac should be triggered 3178: f9 85 ldd r31, Y+9 ; 0x09 317a: f4 b9 out 0x04, r31 ; 4 if(W5msReadADC(TristatePin) < 977) { 317c: 88 2d mov r24, r8 317e: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 3182: 81 3d cpi r24, 0xD1 ; 209 3184: 93 40 sbci r25, 0x03 ; 3 3186: 08 f4 brcc .+2 ; 0x318a 3188: 48 c2 rjmp .+1168 ; 0x361a lcd_space(); #endif goto saveNresult; //measure voltage at the Tristate-Pin (probably Gate) ; // if to low, abort } if(ReadADC(HighPin) < 733) { 318a: 8b 2d mov r24, r11 318c: 0e 94 80 0e call 0x1d00 ; 0x1d00 3190: 8d 3d cpi r24, 0xDD ; 221 3192: 92 40 sbci r25, 0x02 ; 2 3194: 08 f4 brcc .+2 ; 0x3198 3196: 41 c2 rjmp .+1154 ; 0x361a lcd_data('7'); lcd_space(); #endif goto saveNresult; //component has no current => no Triac => abort } R_DDR = HiPinRL; //TristatePin (Gate) to input 3198: 94 b8 out 0x04, r9 ; 4 if(W5msReadADC(HighPin) < 733) { 319a: 8b 2d mov r24, r11 319c: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 31a0: 8d 3d cpi r24, 0xDD ; 221 31a2: 92 40 sbci r25, 0x02 ; 2 31a4: 08 f4 brcc .+2 ; 0x31a8 31a6: 39 c2 rjmp .+1138 ; 0x361a lcd_data('3'); lcd_space(); #endif goto saveNresult; //component has no current without base current => no Triac => abort } R_PORT = HiPinRL; //switch R_L port for HighPin to VCC => switch off holding current 31a8: 95 b8 out 0x05, r9 ; 5 wait_about5ms(); 31aa: 81 e0 ldi r24, 0x01 ; 1 31ac: 0e 94 4a 0e call 0x1c94 ; 0x1c94 R_PORT = 0; //switch R_L port for HighPin again to GND; Triac should now switched off 31b0: 15 b8 out 0x05, r1 ; 5 if(W5msReadADC(HighPin) > 244) { 31b2: 8b 2d mov r24, r11 31b4: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 31b8: 85 3f cpi r24, 0xF5 ; 245 31ba: 91 05 cpc r25, r1 31bc: 08 f0 brcs .+2 ; 0x31c0 31be: 2d c2 rjmp .+1114 ; 0x361a lcd_space(); #endif goto saveNresult; //measure voltage at the High-Pin (probably A2) ; //if to high, component is not switched off => no Triac, abort } PartFound = PART_TRIAC; 31c0: 86 e0 ldi r24, 0x06 ; 6 31c2: 80 93 20 01 sts 0x0120, r24 31c6: 29 c2 rjmp .+1106 ; 0x361a goto saveNresult; } //Test if NPN Transistor or MOSFET // ADC_DDR = LoADCm; //Low-Pin to output 0V R_DDR = HiPinRL | TriPinRH; //R_H port of Tristate-Pin (Basis) to output 31c8: 19 29 or r17, r9 31ca: 19 87 std Y+9, r17 ; 0x09 31cc: 14 b9 out 0x04, r17 ; 4 R_PORT = HiPinRL | TriPinRH; //R_H port of Tristate-Pin (Basis) to VCC 31ce: 59 85 ldd r21, Y+9 ; 0x09 31d0: 55 b9 out 0x05, r21 ; 5 adc.hp2 = W20msReadADC(HighPin); //measure the voltage at the collector 31d2: 8b 2d mov r24, r11 31d4: 0e 94 74 0e call 0x1ce8 ; 0x1ce8 31d8: 8c 01 movw r16, r24 adc.rhp = ADCconfig.U_AVCC - adc.hp2; // voltage at the collector resistor 31da: 80 91 33 01 lds r24, 0x0133 31de: 90 91 34 01 lds r25, 0x0134 31e2: 80 1b sub r24, r16 31e4: 91 0b sbc r25, r17 31e6: 98 8b std Y+16, r25 ; 0x10 31e8: 8f 87 std Y+15, r24 ; 0x0f adc.tp2 = ReadADC(TristatePin); //measure the voltage at the base 31ea: 88 2d mov r24, r8 31ec: 0e 94 80 0e call 0x1d00 ; 0x1d00 31f0: 9e 87 std Y+14, r25 ; 0x0e 31f2: 8d 87 std Y+13, r24 ; 0x0d adc.rtp = ADCconfig.U_AVCC - adc.tp2; // voltage at the base resistor 31f4: a0 91 33 01 lds r26, 0x0133 31f8: b0 91 34 01 lds r27, 0x0134 31fc: a8 1b sub r26, r24 31fe: b9 0b sbc r27, r25 3200: be 83 std Y+6, r27 ; 0x06 3202: ad 83 std Y+5, r26 ; 0x05 adc.lp2 = ReadADC(LowPin); 3204: 8a 2d mov r24, r10 3206: 0e 94 80 0e call 0x1d00 ; 0x1d00 320a: 9b 87 std Y+11, r25 ; 0x0b 320c: 8a 87 std Y+10, r24 ; 0x0a // if((PartFound == PART_TRANSISTOR) || (PartFound == PART_FET)) { // PartReady = 1; //check, if test is already done once // } if(adc.rtp > 2557) { // Basis-voltage R_H is low enough 320e: ed 81 ldd r30, Y+5 ; 0x05 3210: fe 81 ldd r31, Y+6 ; 0x06 3212: ee 3f cpi r30, 0xFE ; 254 3214: f9 40 sbci r31, 0x09 ; 9 3216: 08 f4 brcc .+2 ; 0x321a 3218: b2 c0 rjmp .+356 ; 0x337e PartFound = PART_TRANSISTOR; //NPN-Transistor is found (Base is near GND) 321a: 83 e0 ldi r24, 0x03 ; 3 321c: 80 93 20 01 sts 0x0120, r24 PartMode = PART_MODE_NPN; 3220: 8c e0 ldi r24, 0x0C ; 12 3222: 80 93 1f 01 sts 0x011F, r24 #ifdef COMMON_EMITTER //compute current amplification factor for common Emitter //hFE = B = Collector current / Base current tmp16 = adc.rhp; if (tmp16 > adc.lp_otr) { 3226: 4f 85 ldd r20, Y+15 ; 0x0f 3228: 58 89 ldd r21, Y+16 ; 0x10 322a: 24 16 cp r2, r20 322c: 35 06 cpc r3, r21 322e: 20 f4 brcc .+8 ; 0x3238 tmp16 -= adc.lp_otr; 3230: 8a 01 movw r16, r20 3232: 02 19 sub r16, r2 3234: 13 09 sbc r17, r3 3236: 02 c0 rjmp .+4 ; 0x323c 3238: 0f 85 ldd r16, Y+15 ; 0x0f 323a: 18 89 ldd r17, Y+16 ; 0x10 } #ifdef LONG_HFE e_hfe = ((unsigned int)tmp16 * (unsigned long)(((unsigned long)R_H_VAL * 100) / 323c: 40 90 21 01 lds r4, 0x0121 3240: 50 90 22 01 lds r5, 0x0122 3244: 61 2c mov r6, r1 3246: 71 2c mov r7, r1 3248: 60 e6 ldi r22, 0x60 ; 96 324a: 77 eb ldi r23, 0xB7 ; 183 324c: 87 e4 ldi r24, 0x47 ; 71 324e: 90 e0 ldi r25, 0x00 ; 0 3250: a3 01 movw r20, r6 3252: 92 01 movw r18, r4 3254: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 3258: d8 01 movw r26, r16 325a: 0e 94 5a 38 call 0x70b4 ; 0x70b4 <__muluhisi3> (unsigned int)RR680PL)) / (unsigned int)adc.rtp; 325e: ad 81 ldd r26, Y+5 ; 0x05 3260: be 81 ldd r27, Y+6 ; 0x06 3262: 9d 01 movw r18, r26 3264: 40 e0 ldi r20, 0x00 ; 0 3266: 50 e0 ldi r21, 0x00 ; 0 if (tmp16 > adc.lp_otr) { tmp16 -= adc.lp_otr; } #ifdef LONG_HFE e_hfe = ((unsigned int)tmp16 * (unsigned long)(((unsigned long)R_H_VAL * 100) / 3268: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> (unsigned int)RR680PL)) / (unsigned int)adc.rtp; #else e_hfe = ((tmp16 / ((RR680PL+500)/1000)) * (R_H_VAL/500)) / (adc.rtp/500); #endif if ((ntrans.count == 0) || (e_hfe > ntrans.hfe)){ 326c: 80 91 5a 01 lds r24, 0x015A 3270: 88 23 and r24, r24 3272: 69 f0 breq .+26 ; 0x328e 3274: 80 91 4b 01 lds r24, 0x014B 3278: 90 91 4c 01 lds r25, 0x014C 327c: a0 91 4d 01 lds r26, 0x014D 3280: b0 91 4e 01 lds r27, 0x014E 3284: 82 17 cp r24, r18 3286: 93 07 cpc r25, r19 3288: a4 07 cpc r26, r20 328a: b5 07 cpc r27, r21 328c: 10 f5 brcc .+68 ; 0x32d2 ntrans.hfe = e_hfe; 328e: 20 93 4b 01 sts 0x014B, r18 3292: 30 93 4c 01 sts 0x014C, r19 3296: 40 93 4d 01 sts 0x014D, r20 329a: 50 93 4e 01 sts 0x014E, r21 ntrans.uBE = adc.tp2 - adc.lp2; 329e: 8d 85 ldd r24, Y+13 ; 0x0d 32a0: 9e 85 ldd r25, Y+14 ; 0x0e 32a2: ea 85 ldd r30, Y+10 ; 0x0a 32a4: fb 85 ldd r31, Y+11 ; 0x0b 32a6: 8e 1b sub r24, r30 32a8: 9f 0b sbc r25, r31 32aa: 90 93 50 01 sts 0x0150, r25 32ae: 80 93 4f 01 sts 0x014F, r24 #if FLASHEND > 0x1fff /* at least ATmega16 */ ntrans.current = (unsigned int)(((unsigned long)adc.rhp * 10000) / RR680PL); // Ic 1uA 32b2: 2f 85 ldd r18, Y+15 ; 0x0f 32b4: 38 89 ldd r19, Y+16 ; 0x10 32b6: a0 e1 ldi r26, 0x10 ; 16 32b8: b7 e2 ldi r27, 0x27 ; 39 32ba: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 32be: a3 01 movw r20, r6 32c0: 92 01 movw r18, r4 32c2: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 32c6: 30 93 52 01 sts 0x0152, r19 32ca: 20 93 51 01 sts 0x0151, r18 #endif update_pins = 1; 32ce: 21 e0 ldi r18, 0x01 ; 1 32d0: 01 c0 rjmp .+2 ; 0x32d4 // } if(adc.rtp > 2557) { // Basis-voltage R_H is low enough PartFound = PART_TRANSISTOR; //NPN-Transistor is found (Base is near GND) PartMode = PART_MODE_NPN; update_pins = 0; // only update pins, if better hFE 32d2: 20 e0 ldi r18, 0x00 ; 0 #endif #ifdef COMMON_COLLECTOR //compare current amplification factor for common Collector (Emitter follower) // hFE = (Emitterstrom - Basisstrom) / Basisstrom #ifdef COMMON_EMITTER if (c_hfe > ntrans.hfe) 32d4: 80 91 4b 01 lds r24, 0x014B 32d8: 90 91 4c 01 lds r25, 0x014C 32dc: a0 91 4d 01 lds r26, 0x014D 32e0: b0 91 4e 01 lds r27, 0x014E 32e4: 8c 15 cp r24, r12 32e6: 9d 05 cpc r25, r13 32e8: ae 05 cpc r26, r14 32ea: bf 05 cpc r27, r15 32ec: 28 f5 brcc .+74 ; 0x3338 #else if ((ntrans.count == 0) || (c_hfe > ntrans.hfe)) #endif { ntrans.hfe = c_hfe; 32ee: c0 92 4b 01 sts 0x014B, r12 32f2: d0 92 4c 01 sts 0x014C, r13 32f6: e0 92 4d 01 sts 0x014D, r14 32fa: f0 92 4e 01 sts 0x014E, r15 ntrans.uBE = adc.tp1 - adc.lp1; 32fe: 8b 81 ldd r24, Y+3 ; 0x03 3300: 9c 81 ldd r25, Y+4 ; 0x04 3302: 29 81 ldd r18, Y+1 ; 0x01 3304: 3a 81 ldd r19, Y+2 ; 0x02 3306: 82 1b sub r24, r18 3308: 93 0b sbc r25, r19 330a: 90 93 50 01 sts 0x0150, r25 330e: 80 93 4f 01 sts 0x014F, r24 #if FLASHEND > 0x1fff /* at least ATmega16 */ ntrans.current = (unsigned int)(((unsigned long)adc.lp1 * 10000) / RR680MI); // Ie 1uA 3312: a0 e1 ldi r26, 0x10 ; 16 3314: b7 e2 ldi r27, 0x27 ; 39 3316: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 331a: 20 91 1a 01 lds r18, 0x011A 331e: 30 91 1b 01 lds r19, 0x011B 3322: 40 e0 ldi r20, 0x00 ; 0 3324: 50 e0 ldi r21, 0x00 ; 0 3326: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> ntrans.current += 10000; // mark current at emitter! 332a: 20 5f subi r18, 0xF0 ; 240 332c: 38 4d sbci r19, 0xD8 ; 216 332e: 30 93 52 01 sts 0x0152, r19 3332: 20 93 51 01 sts 0x0151, r18 3336: 03 c0 rjmp .+6 ; 0x333e #endif #if DebugOut == 5 lcd_data('B'); #endif #ifdef SHOW_ICE if (update_pins != 0) { 3338: 22 23 and r18, r18 333a: 09 f4 brne .+2 ; 0x333e 333c: 6f c1 rjmp .+734 ; 0x361c // update residual collector (emitter) current without base current ntrans.ice0 = (unsigned int)(((unsigned long)adc.lp_otr * 10000) / RR680MI); // ICE0 0.01mA 333e: 91 01 movw r18, r2 3340: a0 e1 ldi r26, 0x10 ; 16 3342: b7 e2 ldi r27, 0x27 ; 39 3344: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 3348: 20 91 1a 01 lds r18, 0x011A 334c: 30 91 1b 01 lds r19, 0x011B 3350: 40 e0 ldi r20, 0x00 ; 0 3352: 50 e0 ldi r21, 0x00 ; 0 3354: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 3358: 30 93 54 01 sts 0x0154, r19 335c: 20 93 53 01 sts 0x0153, r18 ntrans.ices = (unsigned int)(((unsigned long)adc.vCEs * 10000) / RR680PL); // ICEs 0.01mA 3360: 2f 81 ldd r18, Y+7 ; 0x07 3362: 38 85 ldd r19, Y+8 ; 0x08 3364: a0 e1 ldi r26, 0x10 ; 16 3366: b7 e2 ldi r27, 0x27 ; 39 3368: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 336c: a3 01 movw r20, r6 336e: 92 01 movw r18, r4 3370: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 3374: 30 93 56 01 sts 0x0156, r19 3378: 20 93 55 01 sts 0x0155, r18 337c: 4e c1 rjmp .+668 ; 0x361a } #endif goto saveNresult; // count the found N-Type and exit } // Base has low current if((adc.lp_otr < 97) && (adc.rhp > 3400)) { 337e: 31 e6 ldi r19, 0x61 ; 97 3380: 23 16 cp r2, r19 3382: 31 04 cpc r3, r1 3384: 08 f0 brcs .+2 ; 0x3388 3386: 71 c0 rjmp .+226 ; 0x346a 3388: 4f 85 ldd r20, Y+15 ; 0x0f 338a: 58 89 ldd r21, Y+16 ; 0x10 338c: 49 34 cpi r20, 0x49 ; 73 338e: 5d 40 sbci r21, 0x0D ; 13 3390: 08 f4 brcc .+2 ; 0x3394 3392: 6b c0 rjmp .+214 ; 0x346a //if flow voltage in switched off mode low enough? //(since D-Mode-FET will be detected in error as E-Mode ) PartFound = PART_FET; //N-Kanal-MOSFET is found (Basis/Gate will Not be pulled down) 3394: 84 e0 ldi r24, 0x04 ; 4 3396: 80 93 20 01 sts 0x0120, r24 PartMode = PART_MODE_MOS|N_CHANNEL|E_MODE; 339a: 82 e0 ldi r24, 0x02 ; 2 339c: 80 93 1f 01 sts 0x011F, r24 if (adc.hp2 > (250+adc.lp2)) { 33a0: 8a 85 ldd r24, Y+10 ; 0x0a 33a2: 9b 85 ldd r25, Y+11 ; 0x0b 33a4: 86 50 subi r24, 0x06 ; 6 33a6: 9f 4f sbci r25, 0xFF ; 255 33a8: 80 17 cp r24, r16 33aa: 91 07 cpc r25, r17 33ac: 20 f4 brcc .+8 ; 0x33b6 // Drain-Source Voltage is too high for N_E_MOS PartMode = PART_MODE_IGBT|N_CHANNEL|E_MODE; 33ae: 83 e0 ldi r24, 0x03 ; 3 33b0: 80 93 1f 01 sts 0x011F, r24 33b4: 20 c0 rjmp .+64 ; 0x33f6 #if FLASHEND > 0x3fff } else { if (adc.hp2 > adc.lp2) { 33b6: aa 85 ldd r26, Y+10 ; 0x0a 33b8: bb 85 ldd r27, Y+11 ; 0x0b 33ba: a0 17 cp r26, r16 33bc: b1 07 cpc r27, r17 33be: b8 f4 brcc .+46 ; 0x33ee ntrans.uBE = RR680PL * (unsigned long)(adc.hp2 - adc.lp2) / adc.rhp; // DS resistance in 0.1 OHm 33c0: a0 91 21 01 lds r26, 0x0121 33c4: b0 91 22 01 lds r27, 0x0122 33c8: 98 01 movw r18, r16 33ca: ea 85 ldd r30, Y+10 ; 0x0a 33cc: fb 85 ldd r31, Y+11 ; 0x0b 33ce: 2e 1b sub r18, r30 33d0: 3f 0b sbc r19, r31 33d2: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 33d6: af 85 ldd r26, Y+15 ; 0x0f 33d8: b8 89 ldd r27, Y+16 ; 0x10 33da: 9d 01 movw r18, r26 33dc: 40 e0 ldi r20, 0x00 ; 0 33de: 50 e0 ldi r21, 0x00 ; 0 33e0: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 33e4: 30 93 50 01 sts 0x0150, r19 33e8: 20 93 4f 01 sts 0x014F, r18 33ec: 04 c0 rjmp .+8 ; 0x33f6 } else { ntrans.uBE = 0; 33ee: 10 92 50 01 sts 0x0150, r1 33f2: 10 92 4f 01 sts 0x014F, r1 lcd_data('F'); #endif //Switching of Drain is monitored with digital input // Low level is specified up to 0.3 * VCC // High level is specified above 0.6 * VCC PinMSK = HiADCm & 7; 33f6: 04 2d mov r16, r4 33f8: 07 70 andi r16, 0x07 ; 7 // measure Threshold voltage of Gate ADMUX = TristatePin | (1< R_DDR = HiPinRL | TriPinRH; // slowly charge Gate 3414: b9 85 ldd r27, Y+9 ; 0x09 3416: b4 b9 out 0x04, r27 ; 4 R_PORT = HiPinRL | TriPinRH; 3418: b5 b9 out 0x05, r27 ; 5 while ((ADC_PIN&PinMSK)); // Wait, until the MOSFET switch and Drain moved to low 341a: 86 b1 in r24, 0x06 ; 6 341c: 80 23 and r24, r16 341e: e9 f7 brne .-6 ; 0x341a // 0 is detected with input voltage of 2.12V to 2.24V (tested with mega168 & mega328) R_DDR = HiPinRL; // switch off current 3420: 94 b8 out 0x04, r9 ; 4 ADCSRA |= (1< tmp16 += ADCW; // add result of ADC 3434: 80 91 78 00 lds r24, 0x0078 3438: 90 91 79 00 lds r25, 0x0079 343c: e8 0e add r14, r24 343e: f9 1e adc r15, r25 3440: 11 50 subi r17, 0x01 ; 1 // High level is specified above 0.6 * VCC PinMSK = HiADCm & 7; // measure Threshold voltage of Gate ADMUX = TristatePin | (1< R_DDR = HiPinRL; // switch off current ADCSRA |= (1< 3456: 70 93 56 01 sts 0x0156, r23 345a: 60 93 55 01 sts 0x0155, r22 ntrans.count++; // count FET as two to accelerate searching 345e: 80 91 5a 01 lds r24, 0x015A 3462: 8f 5f subi r24, 0xFF ; 255 3464: 80 93 5a 01 sts 0x015A, r24 3468: d8 c0 rjmp .+432 ; 0x361a goto saveNresult; } } // end component conduct => npn ADC_DDR = TXD_MSK; // switch all ADC-Ports to input 346a: 88 e0 ldi r24, 0x08 ; 8 346c: 87 b9 out 0x07, r24 ; 7 ADC_PORT = TXD_VAL; // switch all ADC-Ports to 0 (no Pull up) 346e: 88 b9 out 0x08, r24 ; 8 } //########################################################################################## // Search for diodes //########################################################################################## checkDiode: R_DDR = 0; //switch off resistor current 3470: 14 b8 out 0x04, r1 ; 4 R_PORT = 0; 3472: 15 b8 out 0x05, r1 ; 5 ADC_DDR = TXD_MSK; // switch ADC ports to input 3474: 88 e0 ldi r24, 0x08 ; 8 3476: 87 b9 out 0x07, r24 ; 7 // if (adc.lp_otr < 977) if (adc.lp_otr < 455) { 3478: e7 ec ldi r30, 0xC7 ; 199 347a: 2e 16 cp r2, r30 347c: e1 e0 ldi r30, 0x01 ; 1 347e: 3e 06 cpc r3, r30 3480: 08 f4 brcc .+2 ; 0x3484 3482: b0 c0 rjmp .+352 ; 0x35e4 #endif goto widmes; } // component has current //Test if Diode ADC_PORT = TXD_VAL; 3484: 88 b9 out 0x08, r24 ; 8 3486: 18 ec ldi r17, 0xC8 ; 200 for (ii=0;ii<200;ii++) { ADC_DDR = LoADCm | HiADCm; // discharge by short of Low and High side 3488: 0c 85 ldd r16, Y+12 ; 0x0c 348a: 06 29 or r16, r6 348c: 07 b9 out 0x07, r16 ; 7 wait_about5ms(); // Low and Highpin to GND for discharge 348e: 81 e0 ldi r24, 0x01 ; 1 3490: 0e 94 4a 0e call 0x1c94 ; 0x1c94 ADC_DDR = LoADCm; // switch only Low-Pin fix to GND 3494: 67 b8 out 0x07, r6 ; 7 adc.hp1 = ReadADC(HighPin); // read voltage at High-Pin 3496: 8b 2d mov r24, r11 3498: 0e 94 80 0e call 0x1d00 ; 0x1d00 if (adc.hp1 < (150/8)) break; 349c: 42 97 sbiw r24, 0x12 ; 18 349e: 10 f0 brcs .+4 ; 0x34a4 34a0: 11 50 subi r17, 0x01 ; 1 goto widmes; } // component has current //Test if Diode ADC_PORT = TXD_VAL; for (ii=0;ii<200;ii++) { 34a2: a1 f7 brne .-24 ; 0x348c #if FLASHEND > 0x1fff #if (((PIN_RL1 + 1) != PIN_RH1) || ((PIN_RL2 + 1) != PIN_RH2) || ((PIN_RL3 + 1) != PIN_RH3)) addr += 3; // address of PinRHtab[LowPin] LoPinRH = pgm_read_byte(addr); // instruction for LowPin R_H #else LoPinRH = LoPinRL + LoPinRL; // instruction for LowPin R_H 34a4: 35 2c mov r3, r5 34a6: 33 0c add r3, r3 HiPinRL = pgm_read_byte(addr); // instruction for HighPin R_L #if (((PIN_RL1 + 1) != PIN_RH1) || ((PIN_RL2 + 1) != PIN_RH2) || ((PIN_RL3 + 1) != PIN_RH3)) addr += 3; // address of PinRHtab[HighPin] HiPinRH = pgm_read_byte(addr); // instruction for HighPin R_H #else HiPinRH = HiPinRL + HiPinRL; // instruction for HighPin R_H 34a8: 29 2d mov r18, r9 34aa: 22 0f add r18, r18 #if FLASHEND > 0x1fff /* It is difficult to detect the protection diode of D-mode MOSFET . */ /* We have to generate a negative gate voltage to isolate the diode. */ /* For P-mode the resistors must reside on the VCC side. */ /* For N-mode the resistors must be moved to the GND side. */ R_DDR = HiPinRH; //switch R_H port for High-Pin output (VCC) 34ac: 24 b9 out 0x04, r18 ; 4 R_PORT = HiPinRH; 34ae: 25 b9 out 0x05, r18 ; 5 ChargePin10ms(TriPinRL,1); //discharge of P-Kanal-MOSFET gate 34b0: 61 e0 ldi r22, 0x01 ; 1 34b2: 87 2d mov r24, r7 34b4: 2f 8b std Y+23, r18 ; 0x17 34b6: 0e 94 08 1d call 0x3a10 ; 0x3a10 adc.hp2 = W5msReadADC(HighPin); // GND--|<--HP--R_H--VCC 34ba: 8b 2d mov r24, r11 34bc: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 34c0: 9a 83 std Y+2, r25 ; 0x02 34c2: 89 83 std Y+1, r24 ; 0x01 // now the resistor is moved to the Low side R_DDR = LoPinRH; 34c4: 34 b8 out 0x04, r3 ; 4 R_PORT = 0; 34c6: 15 b8 out 0x05, r1 ; 5 ADC_DDR = HiADCm; // switch High-Pin fix to VCC 34c8: fc 85 ldd r31, Y+12 ; 0x0c 34ca: f7 b9 out 0x07, r31 ; 7 ADC_PORT = HiADCp; 34cc: 48 b8 out 0x08, r4 ; 8 ChargePin10ms(TriPinRL,0); //discharge for N-Kanal-MOSFET gate 34ce: 60 e0 ldi r22, 0x00 ; 0 34d0: 87 2d mov r24, r7 34d2: 0e 94 08 1d call 0x3a10 ; 0x3a10 adc.hp3 = ADCconfig.U_AVCC - W5msReadADC(LowPin); // GND--R_H--LP--|<--VCC 34d6: e0 90 33 01 lds r14, 0x0133 34da: f0 90 34 01 lds r15, 0x0134 34de: 8a 2d mov r24, r10 34e0: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 34e4: 8c 01 movw r16, r24 /* check with higher current (R_L=680) */ R_DDR = LoPinRL; 34e6: 54 b8 out 0x04, r5 ; 4 adc.hp1 = W5msReadADC(HighPin) - ReadADC(LowPin); // GND--R_L--LP--|<--VCC 34e8: 8b 2d mov r24, r11 34ea: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 34ee: 6c 01 movw r12, r24 34f0: 8a 2d mov r24, r10 34f2: 0e 94 80 0e call 0x1d00 ; 0x1d00 34f6: c8 1a sub r12, r24 34f8: d9 0a sbc r13, r25 // the resistor is moved back to the High side ADC_PORT = TXD_VAL; 34fa: 88 e0 ldi r24, 0x08 ; 8 34fc: 88 b9 out 0x08, r24 ; 8 ADC_DDR = LoADCm; // switch only Low-Pin fix to GND 34fe: 67 b8 out 0x07, r6 ; 7 R_DDR = HiPinRL; //switch R_L port for High-Pin output (VCC) 3500: 94 b8 out 0x04, r9 ; 4 R_PORT = HiPinRL; 3502: 95 b8 out 0x05, r9 ; 5 ChargePin10ms(TriPinRL,1); //discharge for P-Kanal-MOSFET gate 3504: 61 e0 ldi r22, 0x01 ; 1 3506: 87 2d mov r24, r7 3508: 0e 94 08 1d call 0x3a10 ; 0x3a10 adc.lp_otr = W5msReadADC(HighPin) - ReadADC(LowPin); // GND--|<--HP--R_L--VCC 350c: 8b 2d mov r24, r11 350e: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 3512: 4c 01 movw r8, r24 3514: 8a 2d mov r24, r10 3516: 0e 94 80 0e call 0x1d00 ; 0x1d00 351a: 88 1a sub r8, r24 351c: 99 0a sbc r9, r25 if(adc.lp_otr > adc.hp1) { 351e: 2f 89 ldd r18, Y+23 ; 0x17 3520: c8 14 cp r12, r8 3522: d9 04 cpc r13, r9 3524: 38 f4 brcc .+14 ; 0x3534 adc.hp1 = adc.lp_otr; //the higher value wins adc.hp3 = adc.hp2; R_DDR = HiPinRH; //switch R_H port for High-Pin output (VCC) 3526: 24 b9 out 0x04, r18 ; 4 R_PORT = HiPinRH; 3528: 25 b9 out 0x05, r18 ; 5 adc.hp2 = W5msReadADC(HighPin); // GND--|<--HP--R_H--VCC 352a: 8b 2d mov r24, r11 352c: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 3530: 64 01 movw r12, r8 3532: 19 c0 rjmp .+50 ; 0x3566 R_DDR = LoPinRH; R_PORT = 0; ADC_DDR = HiADCm; // switch High-Pin fix to VCC ADC_PORT = HiADCp; ChargePin10ms(TriPinRL,0); //discharge for N-Kanal-MOSFET gate adc.hp3 = ADCconfig.U_AVCC - W5msReadADC(LowPin); // GND--R_H--LP--|<--VCC 3534: 97 01 movw r18, r14 3536: 20 1b sub r18, r16 3538: 31 0b sbc r19, r17 353a: 3a 83 std Y+2, r19 ; 0x02 353c: 29 83 std Y+1, r18 ; 0x01 adc.hp3 = adc.hp2; R_DDR = HiPinRH; //switch R_H port for High-Pin output (VCC) R_PORT = HiPinRH; adc.hp2 = W5msReadADC(HighPin); // GND--|<--HP--R_H--VCC } else { R_DDR = LoPinRH; 353e: 34 b8 out 0x04, r3 ; 4 R_PORT = 0; 3540: 15 b8 out 0x05, r1 ; 5 ADC_DDR = HiADCm; // switch High-Pin fix to VCC 3542: 3c 85 ldd r19, Y+12 ; 0x0c 3544: 37 b9 out 0x07, r19 ; 7 ADC_PORT = HiADCp; 3546: 48 b8 out 0x08, r4 ; 8 ChargePin10ms(TriPinRL,0); //discharge for N-Kanal-MOSFET gate 3548: 60 e0 ldi r22, 0x00 ; 0 354a: 87 2d mov r24, r7 354c: 0e 94 08 1d call 0x3a10 ; 0x3a10 adc.hp2 = ADCconfig.U_AVCC - W5msReadADC(LowPin); // GND--R_H--LP--|<--VCC 3550: 00 91 33 01 lds r16, 0x0133 3554: 10 91 34 01 lds r17, 0x0134 3558: 8a 2d mov r24, r10 355a: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 355e: a8 01 movw r20, r16 3560: 48 1b sub r20, r24 3562: 59 0b sbc r21, r25 3564: ca 01 movw r24, r20 DisplayValue(adc.hp2,-3,' ',2); #endif volt_dif = adc.hp3/8; if (volt_dif > 200) volt_dif = 200; if((adc.hp1 > 150) && (adc.hp1 < 4640) && (adc.hp2 < adc.hp1) && (adc.hp1 > (adc.hp3+volt_dif)) && (adc.hp3 > adc.hp1/16)) { 3566: 96 01 movw r18, r12 3568: 27 59 subi r18, 0x97 ; 151 356a: 31 09 sbc r19, r1 356c: 29 38 cpi r18, 0x89 ; 137 356e: 31 41 sbci r19, 0x11 ; 17 3570: c8 f5 brcc .+114 ; 0x35e4 3572: 8c 15 cp r24, r12 3574: 9d 05 cpc r25, r13 3576: b0 f5 brcc .+108 ; 0x35e4 lcd_data('L'); DisplayValue(adc.hp1,-3,' ',2); lcd_data('H'); DisplayValue(adc.hp2,-3,' ',2); #endif volt_dif = adc.hp3/8; 3578: 89 81 ldd r24, Y+1 ; 0x01 357a: 9a 81 ldd r25, Y+2 ; 0x02 357c: 53 e0 ldi r21, 0x03 ; 3 357e: 96 95 lsr r25 3580: 87 95 ror r24 3582: 5a 95 dec r21 3584: e1 f7 brne .-8 ; 0x357e 3586: 89 3c cpi r24, 0xC9 ; 201 3588: 91 05 cpc r25, r1 358a: 10 f0 brcs .+4 ; 0x3590 358c: 88 ec ldi r24, 0xC8 ; 200 358e: 90 e0 ldi r25, 0x00 ; 0 if (volt_dif > 200) volt_dif = 200; if((adc.hp1 > 150) && (adc.hp1 < 4640) && (adc.hp2 < adc.hp1) && (adc.hp1 > (adc.hp3+volt_dif)) && (adc.hp3 > adc.hp1/16)) { 3590: 29 81 ldd r18, Y+1 ; 0x01 3592: 3a 81 ldd r19, Y+2 ; 0x02 3594: 82 0f add r24, r18 3596: 93 1f adc r25, r19 3598: 8c 15 cp r24, r12 359a: 9d 05 cpc r25, r13 359c: 18 f5 brcc .+70 ; 0x35e4 359e: c6 01 movw r24, r12 35a0: 44 e0 ldi r20, 0x04 ; 4 35a2: 96 95 lsr r25 35a4: 87 95 ror r24 35a6: 4a 95 dec r20 35a8: e1 f7 brne .-8 ; 0x35a2 35aa: 82 17 cp r24, r18 35ac: 93 07 cpc r25, r19 35ae: d0 f4 brcc .+52 ; 0x35e4 //voltage is above 0,15V and below 4,64V => Ok // hp2 >= hp1 is only possible with capacitor, not with a diode, hp2 is measured with 470k // if((PartFound == PART_NONE) || (PartFound == PART_RESISTOR)) { if(PartFound < PART_DIODE) { 35b0: 80 91 20 01 lds r24, 0x0120 35b4: 82 30 cpi r24, 0x02 ; 2 35b6: 18 f4 brcc .+6 ; 0x35be PartFound = PART_DIODE; //mark for diode only, if no other component is found 35b8: 82 e0 ldi r24, 0x02 ; 2 35ba: 80 93 20 01 sts 0x0120, r24 //since there is a problem with Transistors with a protection diode #if DebugOut == 4 lcd_data('D'); #endif } diodes.Anode[NumOfDiodes] = HighPin; 35be: 80 91 1e 01 lds r24, 0x011E 35c2: e8 2f mov r30, r24 35c4: f0 e0 ldi r31, 0x00 ; 0 35c6: df 01 movw r26, r30 35c8: ab 56 subi r26, 0x6B ; 107 35ca: be 4f sbci r27, 0xFE ; 254 35cc: bc 92 st X, r11 diodes.Cathode[NumOfDiodes] = LowPin; 35ce: 16 96 adiw r26, 0x06 ; 6 35d0: ac 92 st X, r10 diodes.Voltage[NumOfDiodes] = adc.hp1; // voltage in Millivolt 35d2: ee 0f add r30, r30 35d4: ff 1f adc r31, r31 35d6: ef 55 subi r30, 0x5F ; 95 35d8: fe 4f sbci r31, 0xFE ; 254 35da: d1 82 std Z+1, r13 ; 0x01 35dc: c0 82 st Z, r12 NumOfDiodes++; 35de: 8f 5f subi r24, 0xFF ; 255 35e0: 80 93 1e 01 sts 0x011E, r24 //########################################################################################## // Search for resistors //########################################################################################## widmes: GetResistance(HighPin, LowPin); 35e4: 6a 2d mov r22, r10 35e6: 8b 2d mov r24, r11 35e8: 0e 94 1c 1b call 0x3638 ; 0x3638 #ifdef DebugOut #if DebugOut < 10 wait_for_key_5s_line2(); #endif #endif ADC_DDR = TXD_MSK; // all ADC-Pins Input 35ec: 88 e0 ldi r24, 0x08 ; 8 35ee: 87 b9 out 0x07, r24 ; 7 ADC_PORT = TXD_VAL; // all ADC outputs to Ground, keine Pull up 35f0: 88 b9 out 0x08, r24 ; 8 R_DDR = 0; // all resistor-outputs to Input 35f2: 14 b8 out 0x04, r1 ; 4 R_PORT = 0; // all resistor-outputs to Ground, no Pull up 35f4: 15 b8 out 0x05, r1 ; 5 ntrans.c = HighPin; ntrans.e = LowPin; } goto clean_ports; } // end CheckPins() 35f6: 69 96 adiw r28, 0x19 ; 25 35f8: e2 e1 ldi r30, 0x12 ; 18 35fa: 0c 94 59 39 jmp 0x72b2 ; 0x72b2 <__epilogue_restores__> //--------------------------------------------------------------------------- savePresult: #if DebugOut == 5 lcd_data('P'); #endif ptrans.count++; 35fe: 80 91 74 01 lds r24, 0x0174 3602: 8f 5f subi r24, 0xFF ; 255 3604: 80 93 74 01 sts 0x0174, r24 if (update_pins != 0) { 3608: 22 23 and r18, r18 360a: 81 f3 breq .-32 ; 0x35ec ptrans.b = TristatePin; // save Pin-constellation 360c: 80 92 71 01 sts 0x0171, r8 ptrans.c = LowPin; 3610: a0 92 72 01 sts 0x0172, r10 ptrans.e = HighPin; 3614: b0 92 73 01 sts 0x0173, r11 3618: e9 cf rjmp .-46 ; 0x35ec // } #if DebugOut == 5 lcd_clear_line2(); #endif update_pins = 1; // if a part is found, always update the pins 361a: 21 e0 ldi r18, 0x01 ; 1 //--------------------------------------------------------------------------- saveNresult: #if DebugOut == 5 lcd_data('N'); #endif ntrans.count++; 361c: 80 91 5a 01 lds r24, 0x015A 3620: 8f 5f subi r24, 0xFF ; 255 3622: 80 93 5a 01 sts 0x015A, r24 if (update_pins != 0) { 3626: 22 23 and r18, r18 3628: 09 f3 breq .-62 ; 0x35ec ntrans.b = TristatePin; // save Pin-constellation 362a: 80 92 57 01 sts 0x0157, r8 ntrans.c = HighPin; 362e: b0 92 58 01 sts 0x0158, r11 ntrans.e = LowPin; 3632: a0 92 59 01 sts 0x0159, r10 3636: da cf rjmp .-76 ; 0x35ec 00003638 : #include #include "Transistortester.h" //****************************************************************** void GetResistance(uint8_t HighPin, uint8_t LowPin) { 3638: a0 e0 ldi r26, 0x00 ; 0 363a: b0 e0 ldi r27, 0x00 ; 0 363c: e2 e2 ldi r30, 0x22 ; 34 363e: fb e1 ldi r31, 0x1B ; 27 3640: 0c 94 3f 39 jmp 0x727e ; 0x727e <__prologue_saves__+0x4> 3644: 98 2e mov r9, r24 3646: 86 2e mov r8, r22 /* switch HighPin directls to VCC switch R_L port for LowPin to GND TristatePin remains switched to input , no action required */ wdt_reset(); 3648: a8 95 wdr addr = &PinRLRHADCtab[LowPin]; // address of the combined RL / RH / ADC pin table 364a: e6 2f mov r30, r22 364c: f0 e0 ldi r31, 0x00 ; 0 364e: e4 5a subi r30, 0xA4 ; 164 3650: fe 4f sbci r31, 0xFE ; 254 LoPinRL = pgm_read_byte(addr); // instruction for LowPin R_L 3652: b4 90 lpm r11, Z addr += 3; // address of PinRHtab[LowPin] LoPinRH = pgm_read_byte(addr); // instruction for LowPin R_H #else LoPinRH = (LoPinRL + LoPinRL); #endif addr += 3; // address of PinADCtab[LowPin] 3654: 33 96 adiw r30, 0x03 ; 3 LoADCp = pgm_read_byte(addr); // instruction for ADC Low-Pin, including | TXD_VAL 3656: 24 91 lpm r18, Z addr = &PinRLRHADCtab[HighPin]; 3658: e8 2f mov r30, r24 365a: f0 e0 ldi r31, 0x00 ; 0 365c: e4 5a subi r30, 0xA4 ; 164 365e: fe 4f sbci r31, 0xFE ; 254 HiPinRL = pgm_read_byte(addr); // instruction for HighPin R_L 3660: e4 90 lpm r14, Z addr += 3; // address of PinRLtab[HighPin] HiPinRH = pgm_read_byte(addr); // instruction for HighPin R_H #else HiPinRH = (HiPinRL + HiPinRL); #endif addr += 3; // address of PinADCtab[HighPin] 3662: 33 96 adiw r30, 0x03 ; 3 HiADCp = pgm_read_byte(addr); // instruction for ADC High-Pin, including | TXD_VAL 3664: f4 90 lpm r15, Z //########################################################################################## // Search for resistors //########################################################################################## if ((ptrans.count + ntrans.count) > 0) { 3666: 30 91 74 01 lds r19, 0x0174 366a: 80 91 5a 01 lds r24, 0x015A 366e: 90 e0 ldi r25, 0x00 ; 0 3670: 83 0f add r24, r19 3672: 91 1d adc r25, r1 3674: 89 2b or r24, r25 3676: 09 f0 breq .+2 ; 0x367a 3678: c6 c1 rjmp .+908 ; 0x3a06 return; // no resistors are searched, if transistors are detected } resnum = (LowPin + HighPin -1); // resistor-Number 0:1 = 0, 0:2 = 1, 1:2 = 2 // resistor measurement wdt_reset(); 367a: a8 95 wdr // U_SCALE can be set to 4 for better resolution of ReadADC result #if U_SCALE != 1 ADCconfig.U_AVCC *= U_SCALE; // scale to higher resolution, mV scale is not required 367c: 80 91 33 01 lds r24, 0x0133 3680: 90 91 34 01 lds r25, 0x0134 3684: 88 0f add r24, r24 3686: 99 1f adc r25, r25 3688: 88 0f add r24, r24 368a: 99 1f adc r25, r25 368c: 90 93 34 01 sts 0x0134, r25 3690: 80 93 33 01 sts 0x0133, r24 ADCconfig.U_Bandgap *= U_SCALE; 3694: 80 91 31 01 lds r24, 0x0131 3698: 90 91 32 01 lds r25, 0x0132 369c: 88 0f add r24, r24 369e: 99 1f adc r25, r25 36a0: 88 0f add r24, r24 36a2: 99 1f adc r25, r25 36a4: 90 93 32 01 sts 0x0132, r25 36a8: 80 93 31 01 sts 0x0131, r24 #endif #if R_ANZ_MESS != ANZ_MESS ADCconfig.Samples = R_ANZ_MESS; // switch to special number of repetitions 36ac: 8e eb ldi r24, 0xBE ; 190 36ae: 80 93 2f 01 sts 0x012F, r24 #endif #define MAX_REPEAT (700 / (5 + R_ANZ_MESS/8)) ADC_PORT = TXD_VAL; 36b2: 88 e0 ldi r24, 0x08 ; 8 36b4: 88 b9 out 0x08, r24 ; 8 ADC_DDR = LoADCp | TXD_MSK; //switch Low-Pin to output (GND) 36b6: 28 60 ori r18, 0x08 ; 8 36b8: 27 b9 out 0x07, r18 ; 7 R_DDR = HiPinRL; //switch R_L port for High-Pin to output (VCC) 36ba: e4 b8 out 0x04, r14 ; 4 R_PORT = HiPinRL; 36bc: e5 b8 out 0x05, r14 ; 5 36be: 58 e1 ldi r21, 0x18 ; 24 36c0: d5 2e mov r13, r21 #if FLASHEND > 0x1fff adc.hp2 = 0; 36c2: c0 e0 ldi r28, 0x00 ; 0 36c4: d0 e0 ldi r29, 0x00 ; 0 for (ii=1;ii 36cc: 58 2e mov r5, r24 36ce: 49 2e mov r4, r25 adc.hp1 = ReadADC(HighPin); // voltage at resistor Rx with R_L 36d0: 89 2d mov r24, r9 36d2: 0e 94 80 0e call 0x1d00 ; 0x1d00 36d6: 8c 01 movw r16, r24 36d8: 8c 1b sub r24, r28 36da: 9d 0b sbc r25, r29 36dc: 97 ff sbrs r25, 7 36de: 03 c0 rjmp .+6 ; 0x36e6 36e0: 91 95 neg r25 36e2: 81 95 neg r24 36e4: 91 09 sbc r25, r1 udiff = adc.hp1 - adc.hp2; if (udiff < 0) udiff = -udiff; if (udiff < 3) break; 36e6: 03 97 sbiw r24, 0x03 ; 3 36e8: 2c f0 brlt .+10 ; 0x36f4 adc.hp2 = adc.hp1; wdt_reset(); 36ea: a8 95 wdr 36ec: da 94 dec r13 ADC_DDR = LoADCp | TXD_MSK; //switch Low-Pin to output (GND) R_DDR = HiPinRL; //switch R_L port for High-Pin to output (VCC) R_PORT = HiPinRL; #if FLASHEND > 0x1fff adc.hp2 = 0; for (ii=1;ii // wait until voltage is stable adc.tp1 = W5msReadADC(LowPin); // low-voltage at Rx with load adc.hp1 = ReadADC(HighPin); // voltage at resistor Rx with R_L 36f0: e8 01 movw r28, r16 36f2: e9 cf rjmp .-46 ; 0x36c6 HiPinRL = pgm_read_byte(addr); // instruction for HighPin R_L #if (((PIN_RL1 + 1) != PIN_RH1) || ((PIN_RL2 + 1) != PIN_RH2) || ((PIN_RL3 + 1) != PIN_RH3)) addr += 3; // address of PinRLtab[HighPin] HiPinRH = pgm_read_byte(addr); // instruction for HighPin R_H #else HiPinRH = (HiPinRL + HiPinRL); 36f4: ee 0c add r14, r14 adc.hp1 = ReadADC(HighPin); // voltage at resistor Rx with R_L #endif if (adc.tp1 > adc.hp1) { adc.tp1 = adc.hp1; } R_PORT = 0; 36f6: 15 b8 out 0x05, r1 ; 5 R_DDR = HiPinRH; //switch R_H port for High-Pin to output (GND) 36f8: e4 b8 out 0x04, r14 ; 4 adc.hp2 = W5msReadADC(HighPin); // read voltage, should be down 36fa: 89 2d mov r24, r9 36fc: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 if (adc.hp2 > (20*U_SCALE)) { 3700: 81 35 cpi r24, 0x51 ; 81 3702: 91 05 cpc r25, r1 3704: 78 f5 brcc .+94 ; 0x3764 // if resistor, voltage should be down goto testend; } R_PORT = HiPinRH; //switch R_H for High-Pin to VCC 3706: e5 b8 out 0x05, r14 ; 5 adc.hp2 = W5msReadADC(HighPin); // voltage at resistor Rx with R_H 3708: 89 2d mov r24, r9 370a: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 370e: ec 01 movw r28, r24 ADC_DDR = HiADCp | TXD_MSK; //switch High-Pin to output 3710: 8f 2d mov r24, r15 3712: 88 60 ori r24, 0x08 ; 8 3714: 87 b9 out 0x07, r24 ; 7 ADC_PORT = HiADCp; //switch High-Pin to VCC 3716: f8 b8 out 0x08, r15 ; 8 R_PORT = 0; 3718: 15 b8 out 0x05, r1 ; 5 R_DDR = LoPinRL; //switch R_L for Low-Pin to GND 371a: b4 b8 out 0x04, r11 ; 4 371c: 88 e1 ldi r24, 0x18 ; 24 371e: a8 2e mov r10, r24 #if FLASHEND > 0x1fff adc.lp2 = 0; 3720: c1 2c mov r12, r1 3722: d1 2c mov r13, r1 for (ii=1;ii 372a: 78 2e mov r7, r24 372c: 69 2e mov r6, r25 adc.lp1 = ReadADC(LowPin); //voltage at the other end of Rx 372e: 88 2d mov r24, r8 3730: 0e 94 80 0e call 0x1d00 ; 0x1d00 3734: 7c 01 movw r14, r24 3736: 8c 19 sub r24, r12 3738: 9d 09 sbc r25, r13 373a: 97 ff sbrs r25, 7 373c: 03 c0 rjmp .+6 ; 0x3744 373e: 91 95 neg r25 3740: 81 95 neg r24 3742: 91 09 sbc r25, r1 udiff = adc.lp1 - adc.lp2; if (udiff < 0) udiff = -udiff; if (udiff < 3) break; 3744: 03 97 sbiw r24, 0x03 ; 3 3746: 34 f5 brge .+76 ; 0x3794 LoPinRL = pgm_read_byte(addr); // instruction for LowPin R_L #if (((PIN_RL1 + 1) != PIN_RH1) || ((PIN_RL2 + 1) != PIN_RH2) || ((PIN_RL3 + 1) != PIN_RH3)) addr += 3; // address of PinRHtab[LowPin] LoPinRH = pgm_read_byte(addr); // instruction for LowPin R_H #else LoPinRH = (LoPinRL + LoPinRL); 3748: bb 0c add r11, r11 adc.lp1 = ReadADC(LowPin); //voltage at the other end of Rx #endif if (adc.tp2 < adc.lp1) { adc.tp2 = adc.lp1; } R_DDR = LoPinRH; //switch R_H for Low-Pin to GND 374a: b4 b8 out 0x04, r11 ; 4 adc.lp2 = W5msReadADC(LowPin); 374c: 88 2d mov r24, r8 374e: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 3752: 5c 01 movw r10, r24 if((adc.hp1 < (4400*U_SCALE)) && (adc.hp2 > (97*U_SCALE))) { 3754: 00 3c cpi r16, 0xC0 ; 192 3756: 94 e4 ldi r25, 0x44 ; 68 3758: 19 07 cpc r17, r25 375a: 08 f5 brcc .+66 ; 0x379e 375c: c5 38 cpi r28, 0x85 ; 133 375e: 81 e0 ldi r24, 0x01 ; 1 3760: d8 07 cpc r29, r24 3762: 08 f1 brcs .+66 ; 0x37a6 } // end ResistorChecked[] != 0 } /* end if (PartFound < PART_TRANSISTOR) */ } testend: // end of resistor measurement #if U_SCALE != 1 ADCconfig.U_AVCC /= U_SCALE; // scale back to mV resolution 3764: 80 91 33 01 lds r24, 0x0133 3768: 90 91 34 01 lds r25, 0x0134 376c: 96 95 lsr r25 376e: 87 95 ror r24 3770: 96 95 lsr r25 3772: 87 95 ror r24 3774: 90 93 34 01 sts 0x0134, r25 3778: 80 93 33 01 sts 0x0133, r24 ADCconfig.U_Bandgap = adc_internal_reference; // set back to normal resolution 377c: 80 91 79 01 lds r24, 0x0179 3780: 90 91 7a 01 lds r25, 0x017A 3784: 90 93 32 01 sts 0x0132, r25 3788: 80 93 31 01 sts 0x0131, r24 #endif #if R_ANZ_MESS != ANZ_MESS ADCconfig.Samples = ANZ_MESS; // switch back to standard number of repetition 378c: 89 e1 ldi r24, 0x19 ; 25 378e: 80 93 2f 01 sts 0x012F, r24 #endif return; 3792: 39 c1 rjmp .+626 ; 0x3a06 adc.lp1 = ReadADC(LowPin); //voltage at the other end of Rx udiff = adc.lp1 - adc.lp2; if (udiff < 0) udiff = -udiff; if (udiff < 3) break; adc.lp2 = adc.lp1; wdt_reset(); 3794: a8 95 wdr 3796: aa 94 dec r10 ADC_PORT = HiADCp; //switch High-Pin to VCC R_PORT = 0; R_DDR = LoPinRL; //switch R_L for Low-Pin to GND #if FLASHEND > 0x1fff adc.lp2 = 0; for (ii=1;ii // wait until voltage is stable adc.tp2 = W5msReadADC(HighPin); //high voltage with load adc.lp1 = ReadADC(LowPin); //voltage at the other end of Rx 379a: 67 01 movw r12, r14 379c: c3 cf rjmp .-122 ; 0x3724 if((adc.hp1 < (4400*U_SCALE)) && (adc.hp2 > (97*U_SCALE))) { //voltage break down isn't insufficient goto testend; } // if((adc.hp2 + (adc.hp2 / 61)) < adc.hp1) if (adc.hp2 < (4972*U_SCALE)) { 379e: c0 3b cpi r28, 0xB0 ; 176 37a0: 9d e4 ldi r25, 0x4D ; 77 37a2: d9 07 cpc r29, r25 37a4: f8 f6 brcc .-66 ; 0x3764 37a6: c0 90 33 01 lds r12, 0x0133 37aa: d0 90 34 01 lds r13, 0x0134 // voltage breaks down with low test current and it is not nearly shorted => resistor // if (adc.lp1 < 120) // take measurement with R_H if (adc.lp1 < (169*U_SCALE)) { // take measurement with R_H 37ae: 84 ea ldi r24, 0xA4 ; 164 37b0: e8 16 cp r14, r24 37b2: 82 e0 ldi r24, 0x02 ; 2 37b4: f8 06 cpc r15, r24 37b6: 08 f0 brcs .+2 ; 0x37ba 37b8: 5f c0 rjmp .+190 ; 0x3878 if (adc.lp2 < (38*U_SCALE)) { 37ba: 98 e9 ldi r25, 0x98 ; 152 37bc: a9 16 cp r10, r25 37be: b1 04 cpc r11, r1 37c0: 88 f2 brcs .-94 ; 0x3764 // measurement > 60MOhm too big resistance goto testend; } // two measurements with R_H resistors (470k) are made: // lirx1 (measurement at HighPin) lirx1 = (unsigned long)((unsigned int)R_H_VAL) * (unsigned long)adc.hp2 / (ADCconfig.U_AVCC - adc.hp2); 37c2: 9e 01 movw r18, r28 37c4: a8 e9 ldi r26, 0x98 ; 152 37c6: b7 eb ldi r27, 0xB7 ; 183 37c8: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 37cc: 96 01 movw r18, r12 37ce: 2c 1b sub r18, r28 37d0: 3d 0b sbc r19, r29 37d2: 40 e0 ldi r20, 0x00 ; 0 37d4: 50 e0 ldi r21, 0x00 ; 0 37d6: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 37da: 29 01 movw r4, r18 37dc: 3a 01 movw r6, r20 // lirx2 (measurement at LowPin) lirx2 = (unsigned long)((unsigned int)R_H_VAL) * (unsigned long)(ADCconfig.U_AVCC - adc.lp2) / adc.lp2; 37de: 96 01 movw r18, r12 37e0: 2a 19 sub r18, r10 37e2: 3b 09 sbc r19, r11 37e4: a8 e9 ldi r26, 0x98 ; 152 37e6: b7 eb ldi r27, 0xB7 ; 183 37e8: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 37ec: 85 01 movw r16, r10 37ee: 20 e0 ldi r18, 0x00 ; 0 37f0: 30 e0 ldi r19, 0x00 ; 0 37f2: a9 01 movw r20, r18 37f4: 98 01 movw r18, r16 37f6: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> #define FAKT_LOW 2 //resolution is about twice as good #else #define FAKT_LOW 4 //resolution is about four times better #endif #ifdef AUTOSCALE_ADC if (adc.hp2 < U_INT_LIMIT) { 37fa: c8 37 cpi r28, 0x78 ; 120 37fc: df 40 sbci r29, 0x0F ; 15 37fe: 70 f4 brcc .+28 ; 0x381c lrx1 = (lirx1*FAKT_LOW + lirx2) / (FAKT_LOW+1); //weighted average of both R_H measurements 3800: c3 01 movw r24, r6 3802: b2 01 movw r22, r4 3804: b2 e0 ldi r27, 0x02 ; 2 3806: 66 0f add r22, r22 3808: 77 1f adc r23, r23 380a: 88 1f adc r24, r24 380c: 99 1f adc r25, r25 380e: ba 95 dec r27 3810: d1 f7 brne .-12 ; 0x3806 3812: 62 0f add r22, r18 3814: 73 1f adc r23, r19 3816: 84 1f adc r24, r20 3818: 95 1f adc r25, r21 381a: 12 c0 rjmp .+36 ; 0x3840 } else if (adc.lp2 < U_INT_LIMIT){ 381c: 98 e7 ldi r25, 0x78 ; 120 381e: a9 16 cp r10, r25 3820: 9f e0 ldi r25, 0x0F ; 15 3822: b9 06 cpc r11, r25 3824: a0 f4 brcc .+40 ; 0x384e lrx1 = (lirx2*FAKT_LOW + lirx1) / (FAKT_LOW+1); //weighted average of both R_H measurements 3826: ca 01 movw r24, r20 3828: b9 01 movw r22, r18 382a: a2 e0 ldi r26, 0x02 ; 2 382c: 66 0f add r22, r22 382e: 77 1f adc r23, r23 3830: 88 1f adc r24, r24 3832: 99 1f adc r25, r25 3834: aa 95 dec r26 3836: d1 f7 brne .-12 ; 0x382c 3838: 64 0d add r22, r4 383a: 75 1d adc r23, r5 383c: 86 1d adc r24, r6 383e: 97 1d adc r25, r7 3840: 25 e0 ldi r18, 0x05 ; 5 3842: 30 e0 ldi r19, 0x00 ; 0 3844: 40 e0 ldi r20, 0x00 ; 0 3846: 50 e0 ldi r21, 0x00 ; 0 3848: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 384c: 08 c0 rjmp .+16 ; 0x385e } else #endif { lrx1 = (lirx1 + lirx2) / 2; //average of both R_H measurements 384e: 24 0d add r18, r4 3850: 35 1d adc r19, r5 3852: 46 1d adc r20, r6 3854: 57 1d adc r21, r7 3856: 56 95 lsr r21 3858: 47 95 ror r20 385a: 37 95 ror r19 385c: 27 95 ror r18 } lrx1 *= 100; 385e: a4 e6 ldi r26, 0x64 ; 100 3860: b0 e0 ldi r27, 0x00 ; 0 3862: 0e 94 5a 38 call 0x70b4 ; 0x70b4 <__muluhisi3> 3866: 6b 01 movw r12, r22 3868: 7c 01 movw r14, r24 lrx1 += RH_OFFSET; // add constant for correction of systematic error 386a: 8c ea ldi r24, 0xAC ; 172 386c: c8 0e add r12, r24 386e: 8d e0 ldi r24, 0x0D ; 13 3870: d8 1e adc r13, r24 3872: e1 1c adc r14, r1 3874: f1 1c adc r15, r1 3876: 70 c0 rjmp .+224 ; 0x3958 3878: 25 2d mov r18, r5 387a: 34 2d mov r19, r4 387c: 02 17 cp r16, r18 387e: 13 07 cpc r17, r19 3880: 08 f4 brcc .+2 ; 0x3884 3882: 98 01 movw r18, r16 3884: c7 2d mov r28, r7 3886: d6 2d mov r29, r6 3888: ce 15 cp r28, r14 388a: df 05 cpc r29, r15 388c: 08 f4 brcc .+2 ; 0x3890 388e: e7 01 movw r28, r14 3890: 59 01 movw r10, r18 3892: 20 17 cp r18, r16 3894: 31 07 cpc r19, r17 3896: 08 f4 brcc .+2 ; 0x389a 3898: 58 01 movw r10, r16 // two measurements with R_L resistors (680) are made: // lirx1 (measurement at HighPin) if (adc.tp1 > adc.hp1) { adc.hp1 = adc.tp1; //diff negativ is illegal } lirx1 =(unsigned long)RR680PL * (unsigned long)(adc.hp1 - adc.tp1) / (ADCconfig.U_AVCC - adc.hp1); 389a: a0 91 21 01 lds r26, 0x0121 389e: b0 91 22 01 lds r27, 0x0122 38a2: c5 01 movw r24, r10 38a4: 82 1b sub r24, r18 38a6: 93 0b sbc r25, r19 38a8: 9c 01 movw r18, r24 38aa: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 38ae: 96 01 movw r18, r12 38b0: 2a 19 sub r18, r10 38b2: 3b 09 sbc r19, r11 38b4: 40 e0 ldi r20, 0x00 ; 0 38b6: 50 e0 ldi r21, 0x00 ; 0 38b8: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 38bc: 29 01 movw r4, r18 38be: 3a 01 movw r6, r20 38c0: 8e 01 movw r16, r28 38c2: ec 16 cp r14, r28 38c4: fd 06 cpc r15, r29 38c6: 08 f4 brcc .+2 ; 0x38ca 38c8: 87 01 movw r16, r14 if (adc.tp2 < adc.lp1) { adc.lp1 = adc.tp2; //diff negativ is illegal } // lirx2 (Measurement at LowPin) lirx2 =(unsigned long)RR680MI * (unsigned long)(adc.tp2 -adc.lp1) / adc.lp1; 38ca: a0 91 1a 01 lds r26, 0x011A 38ce: b0 91 1b 01 lds r27, 0x011B 38d2: 9e 01 movw r18, r28 38d4: 20 1b sub r18, r16 38d6: 31 0b sbc r19, r17 38d8: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 38dc: 68 01 movw r12, r16 38de: e1 2c mov r14, r1 38e0: f1 2c mov r15, r1 38e2: a7 01 movw r20, r14 38e4: 96 01 movw r18, r12 38e6: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> #ifdef AUTOSCALE_ADC if (adc.hp1 < U_INT_LIMIT) { 38ea: 98 e7 ldi r25, 0x78 ; 120 38ec: a9 16 cp r10, r25 38ee: 9f e0 ldi r25, 0x0F ; 15 38f0: b9 06 cpc r11, r25 38f2: 70 f4 brcc .+28 ; 0x3910 lrx1 = (lirx1*FAKT_LOW + lirx2) / (FAKT_LOW+1); //weighted average of both R_L measurements 38f4: c3 01 movw r24, r6 38f6: b2 01 movw r22, r4 38f8: e2 e0 ldi r30, 0x02 ; 2 38fa: 66 0f add r22, r22 38fc: 77 1f adc r23, r23 38fe: 88 1f adc r24, r24 3900: 99 1f adc r25, r25 3902: ea 95 dec r30 3904: d1 f7 brne .-12 ; 0x38fa 3906: 62 0f add r22, r18 3908: 73 1f adc r23, r19 390a: 84 1f adc r24, r20 390c: 95 1f adc r25, r21 390e: 11 c0 rjmp .+34 ; 0x3932 } else if (adc.lp1 < U_INT_LIMIT) { 3910: 08 37 cpi r16, 0x78 ; 120 3912: 8f e0 ldi r24, 0x0F ; 15 3914: 18 07 cpc r17, r24 3916: b0 f4 brcc .+44 ; 0x3944 lrx1 = (lirx2*FAKT_LOW + lirx1) / (FAKT_LOW+1); //weighted average of both R_L measurements 3918: ca 01 movw r24, r20 391a: b9 01 movw r22, r18 391c: 52 e0 ldi r21, 0x02 ; 2 391e: 66 0f add r22, r22 3920: 77 1f adc r23, r23 3922: 88 1f adc r24, r24 3924: 99 1f adc r25, r25 3926: 5a 95 dec r21 3928: d1 f7 brne .-12 ; 0x391e 392a: 64 0d add r22, r4 392c: 75 1d adc r23, r5 392e: 86 1d adc r24, r6 3930: 97 1d adc r25, r7 3932: 25 e0 ldi r18, 0x05 ; 5 3934: 30 e0 ldi r19, 0x00 ; 0 3936: 40 e0 ldi r20, 0x00 ; 0 3938: 50 e0 ldi r21, 0x00 ; 0 393a: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 393e: 69 01 movw r12, r18 3940: 7a 01 movw r14, r20 3942: 0a c0 rjmp .+20 ; 0x3958 } else #endif { lrx1 = (lirx1 + lirx2) / 2; //average of both R_L measurements 3944: 69 01 movw r12, r18 3946: 7a 01 movw r14, r20 3948: c4 0c add r12, r4 394a: d5 1c adc r13, r5 394c: e6 1c adc r14, r6 394e: f7 1c adc r15, r7 3950: f6 94 lsr r15 3952: e7 94 ror r14 3954: d7 94 ror r13 3956: c7 94 ror r12 } } // measurement is finished, lrx1 is the resistance value of one direction if(PartFound < PART_TRANSISTOR) { 3958: 10 91 20 01 lds r17, 0x0120 395c: 13 30 cpi r17, 0x03 ; 3 395e: 08 f0 brcs .+2 ; 0x3962 3960: 01 cf rjmp .-510 ; 0x3764 // Search for resistors //########################################################################################## if ((ptrans.count + ntrans.count) > 0) { return; // no resistors are searched, if transistors are detected } resnum = (LowPin + HighPin -1); // resistor-Number 0:1 = 0, 0:2 = 1, 1:2 = 2 3962: 9a 94 dec r9 3964: 98 0c add r9, r8 lrx1 = (lirx1 + lirx2) / 2; //average of both R_L measurements } } // measurement is finished, lrx1 is the resistance value of one direction if(PartFound < PART_TRANSISTOR) { if (ResistorChecked[resnum] != 0) { 3966: 89 2d mov r24, r9 3968: 90 e0 ldi r25, 0x00 ; 0 396a: ec 01 movw r28, r24 396c: c1 5a subi r28, 0xA1 ; 161 396e: de 4f sbci r29, 0xFE ; 254 3970: 28 81 ld r18, Y 3972: 88 0f add r24, r24 3974: 99 1f adc r25, r25 3976: 88 0f add r24, r24 3978: 99 1f adc r25, r25 // must be measurement with inverse polarity // resolution is 0.1 Ohm, 1 Ohm = 10 ! lirx1 = (labs((long)lrx1 - (long)ResistorVal[resnum]) * 10) / (lrx1 + ResistorVal[resnum] + 100); 397a: fc 01 movw r30, r24 397c: e3 55 subi r30, 0x53 ; 83 397e: fe 4f sbci r31, 0xFE ; 254 lrx1 = (lirx1 + lirx2) / 2; //average of both R_L measurements } } // measurement is finished, lrx1 is the resistance value of one direction if(PartFound < PART_TRANSISTOR) { if (ResistorChecked[resnum] != 0) { 3980: 22 23 and r18, r18 3982: d1 f1 breq .+116 ; 0x39f8 // must be measurement with inverse polarity // resolution is 0.1 Ohm, 1 Ohm = 10 ! lirx1 = (labs((long)lrx1 - (long)ResistorVal[resnum]) * 10) / (lrx1 + ResistorVal[resnum] + 100); 3984: 40 80 ld r4, Z 3986: 51 80 ldd r5, Z+1 ; 0x01 3988: 62 80 ldd r6, Z+2 ; 0x02 398a: 73 80 ldd r7, Z+3 ; 0x03 398c: a7 01 movw r20, r14 398e: 96 01 movw r18, r12 3990: 24 19 sub r18, r4 3992: 35 09 sbc r19, r5 3994: 46 09 sbc r20, r6 3996: 57 09 sbc r21, r7 3998: 57 ff sbrs r21, 7 399a: 07 c0 rjmp .+14 ; 0x39aa 399c: 50 95 com r21 399e: 40 95 com r20 39a0: 30 95 com r19 39a2: 21 95 neg r18 39a4: 3f 4f sbci r19, 0xFF ; 255 39a6: 4f 4f sbci r20, 0xFF ; 255 39a8: 5f 4f sbci r21, 0xFF ; 255 39aa: aa e0 ldi r26, 0x0A ; 10 39ac: b0 e0 ldi r27, 0x00 ; 0 39ae: 0e 94 5a 38 call 0x70b4 ; 0x70b4 <__muluhisi3> 39b2: a3 01 movw r20, r6 39b4: 92 01 movw r18, r4 39b6: 2c 59 subi r18, 0x9C ; 156 39b8: 3f 4f sbci r19, 0xFF ; 255 39ba: 4f 4f sbci r20, 0xFF ; 255 39bc: 5f 4f sbci r21, 0xFF ; 255 39be: 2c 0d add r18, r12 39c0: 3d 1d adc r19, r13 39c2: 4e 1d adc r20, r14 39c4: 5f 1d adc r21, r15 39c6: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> if (lirx1 > 0) { 39ca: 23 2b or r18, r19 39cc: 24 2b or r18, r20 39ce: 25 2b or r18, r21 39d0: 09 f0 breq .+2 ; 0x39d4 39d2: c8 ce rjmp .-624 ; 0x3764 // mismatch of the two measurements // ResistorsFound--; // this one isn't a resistor // goto testend; // <10% mismatch } else { // resistor has the same value in both directions if (PartFound < PART_DIODE) { 39d4: 12 30 cpi r17, 0x02 ; 2 39d6: 19 f0 breq .+6 ; 0x39de PartFound = PART_RESISTOR; // only mark as resistor, if no other part found 39d8: 81 e0 ldi r24, 0x01 ; 1 39da: 80 93 20 01 sts 0x0120, r24 } ResistorChecked[resnum] = 2; // mark as checked in both direction 39de: 82 e0 ldi r24, 0x02 ; 2 39e0: 88 83 st Y, r24 ResistorList[ResistorsFound] = resnum; // save number of this resistor 39e2: 80 91 7b 01 lds r24, 0x017B 39e6: e8 2f mov r30, r24 39e8: f0 e0 ldi r31, 0x00 ; 0 39ea: ee 59 subi r30, 0x9E ; 158 39ec: fe 4f sbci r31, 0xFE ; 254 39ee: 90 82 st Z, r9 ResistorsFound++; // 1 more resistor found 39f0: 8f 5f subi r24, 0xFF ; 255 39f2: 80 93 7b 01 sts 0x017B, r24 39f6: b6 ce rjmp .-660 ; 0x3764 } goto testend; } else { // resistor is never checked before // must be a new one with other pins ResistorVal[resnum] = lrx1; // save register value 39f8: c0 82 st Z, r12 39fa: d1 82 std Z+1, r13 ; 0x01 39fc: e2 82 std Z+2, r14 ; 0x02 39fe: f3 82 std Z+3, r15 ; 0x03 ResistorChecked[resnum] = 1; // is checked in one direction 3a00: 81 e0 ldi r24, 0x01 ; 1 3a02: 88 83 st Y, r24 3a04: af ce rjmp .-674 ; 0x3764 #if R_ANZ_MESS != ANZ_MESS ADCconfig.Samples = ANZ_MESS; // switch back to standard number of repetition #endif return; } // end GetResistance() 3a06: cd b7 in r28, 0x3d ; 61 3a08: de b7 in r29, 0x3e ; 62 3a0a: e0 e1 ldi r30, 0x10 ; 16 3a0c: 0c 94 5b 39 jmp 0x72b6 ; 0x72b6 <__epilogue_restores__+0x4> 00003a10 : #include "Transistortester.h" //****************************************************************** void ChargePin10ms(uint8_t PinToCharge, uint8_t ChargeDirection) { 3a10: cf 93 push r28 3a12: c8 2f mov r28, r24 3a14: c0 95 com r28 //Parameters: //PinToCharge: specifies the pin as mask for R-Port //ChargeDirection: 0 = switch to GND (N-Kanal-FET), 1= switch to VCC(P-Kanal-FET) if(ChargeDirection&1) { R_PORT |= PinToCharge; //R_PORT to 1 (VCC) 3a16: 95 b1 in r25, 0x05 ; 5 //Will be used by discharge of MOSFET Gates or to load big capacities. //Parameters: //PinToCharge: specifies the pin as mask for R-Port //ChargeDirection: 0 = switch to GND (N-Kanal-FET), 1= switch to VCC(P-Kanal-FET) if(ChargeDirection&1) { 3a18: 60 ff sbrs r22, 0 3a1a: 02 c0 rjmp .+4 ; 0x3a20 R_PORT |= PinToCharge; //R_PORT to 1 (VCC) 3a1c: 98 2b or r25, r24 3a1e: 01 c0 rjmp .+2 ; 0x3a22 } else { R_PORT &= ~PinToCharge; // or 0 (GND) 3a20: 9c 23 and r25, r28 3a22: 95 b9 out 0x05, r25 ; 5 } R_DDR |= PinToCharge; //switch Pin to output, across R to GND or VCC 3a24: 94 b1 in r25, 0x04 ; 4 3a26: 98 2b or r25, r24 3a28: 94 b9 out 0x04, r25 ; 4 wait_about10ms(); // wait about 10ms 3a2a: 82 e0 ldi r24, 0x02 ; 2 3a2c: 0e 94 4a 0e call 0x1c94 ; 0x1c94 // switch back Input, no current R_DDR &= ~PinToCharge; // switch back to input 3a30: 84 b1 in r24, 0x04 ; 4 3a32: 8c 23 and r24, r28 3a34: 84 b9 out 0x04, r24 ; 4 R_PORT &= ~PinToCharge; // no Pull up 3a36: 85 b1 in r24, 0x05 ; 5 3a38: 8c 23 and r24, r28 3a3a: 85 b9 out 0x05, r24 ; 5 } 3a3c: cf 91 pop r28 3a3e: 08 95 ret 00003a40 : #include #include "Transistortester.h" // first discharge any charge of capacitors void EntladePins() { 3a40: a0 e0 ldi r26, 0x00 ; 0 3a42: b0 e0 ldi r27, 0x00 ; 0 3a44: e6 e2 ldi r30, 0x26 ; 38 3a46: fd e1 ldi r31, 0x1D ; 29 3a48: 0c 94 46 39 jmp 0x728c ; 0x728c <__prologue_saves__+0x12> 3a4c: 8a e0 ldi r24, 0x0A ; 10 3a4e: c8 2e mov r12, r24 // max. time of discharge in ms (10000/20) == 10s #define MAX_ENTLADE_ZEIT (10000/20) for(lop_cnt=0;lop_cnt<10;lop_cnt++) { adc_gnd = TXD_MSK; // put all ADC to Input ADC_DDR = adc_gnd; 3a50: 98 e0 ldi r25, 0x08 ; 8 3a52: d9 2e mov r13, r25 ADC_PORT = TXD_VAL; // ADC-outputs auf 0 R_PORT = 0; // R-outputs auf 0 // R_DDR = (1< 3a66: 8c 01 movw r16, r24 adcmv[1] = ReadADC(PC1); // which voltage has Pin 2? 3a68: 81 e0 ldi r24, 0x01 ; 1 3a6a: 0e 94 80 0e call 0x1d00 ; 0x1d00 3a6e: ec 01 movw r28, r24 adcmv[2] = ReadADC(PC2); // which voltage has Pin 3? 3a70: 82 e0 ldi r24, 0x02 ; 2 3a72: 0e 94 80 0e call 0x1d00 ; 0x1d00 if ((PartFound == PART_CELL) || (adcmv[0] < CAP_EMPTY_LEVEL) & (adcmv[1] < CAP_EMPTY_LEVEL) & (adcmv[2] < CAP_EMPTY_LEVEL)) { 3a76: 20 91 20 01 lds r18, 0x0120 3a7a: 28 30 cpi r18, 0x08 ; 8 3a7c: 81 f4 brne .+32 ; 0x3a9e ADC_DDR = TXD_MSK; // switch all ADC-Pins to input 3a7e: 28 e0 ldi r18, 0x08 ; 8 3a80: 27 b9 out 0x07, r18 ; 7 R_DDR = 0; // switch all R_L Ports (and R_H) to input 3a82: 14 b8 out 0x04, r1 ; 4 #if FLASHEND > 0x3fff cell_mv[0] = adcmv[0]; // save the voltage of pin 1 3a84: 10 93 07 01 sts 0x0107, r17 3a88: 00 93 06 01 sts 0x0106, r16 cell_mv[1] = adcmv[1]; // save the voltage of pin 2 3a8c: d0 93 09 01 sts 0x0109, r29 3a90: c0 93 08 01 sts 0x0108, r28 cell_mv[2] = adcmv[2]; // save the voltage of pin 3 3a94: 90 93 0b 01 sts 0x010B, r25 3a98: 80 93 0a 01 sts 0x010A, r24 3a9c: 59 c0 rjmp .+178 ; 0x3b50 // R_DDR = (1< 3aa6: 30 e0 ldi r19, 0x00 ; 0 3aa8: 21 e0 ldi r18, 0x01 ; 1 3aaa: 04 30 cpi r16, 0x04 ; 4 3aac: 11 05 cpc r17, r1 3aae: 08 f0 brcs .+2 ; 0x3ab2 3ab0: 20 e0 ldi r18, 0x00 ; 0 3ab2: 23 23 and r18, r19 3ab4: 19 f0 breq .+6 ; 0x3abc 3ab6: 84 30 cpi r24, 0x04 ; 4 3ab8: 91 05 cpc r25, r1 3aba: 08 f3 brcs .-62 ; 0x3a7e cell_mv[2] = adcmv[2]; // save the voltage of pin 3 #endif return; // all is discharged } // all Pins with voltage lower than 1V can be connected directly to GND (ADC-Port) if (adcmv[0] < 1000) { 3abc: 08 3e cpi r16, 0xE8 ; 232 3abe: 13 40 sbci r17, 0x03 ; 3 3ac0: 10 f0 brcs .+4 ; 0x3ac6 uint8_t lop_cnt; // loop counter // max. time of discharge in ms (10000/20) == 10s #define MAX_ENTLADE_ZEIT (10000/20) for(lop_cnt=0;lop_cnt<10;lop_cnt++) { adc_gnd = TXD_MSK; // put all ADC to Input 3ac2: 28 e0 ldi r18, 0x08 ; 8 3ac4: 01 c0 rjmp .+2 ; 0x3ac8 #endif return; // all is discharged } // all Pins with voltage lower than 1V can be connected directly to GND (ADC-Port) if (adcmv[0] < 1000) { adc_gnd |= (1< adc_gnd |= (1< adc_gnd |= (1< 3ae6: 7c 01 movw r14, r24 adcmv[1] = ReadADC(PC1); // which voltage has Pin 2? 3ae8: 81 e0 ldi r24, 0x01 ; 1 3aea: 0e 94 80 0e call 0x1d00 ; 0x1d00 3aee: 8c 01 movw r16, r24 adcmv[2] = ReadADC(PC2); // which voltage has Pin 3? 3af0: 82 e0 ldi r24, 0x02 ; 2 3af2: 0e 94 80 0e call 0x1d00 ; 0x1d00 if (adcmv[0] < 1300) { 3af6: 24 e1 ldi r18, 0x14 ; 20 3af8: e2 16 cp r14, r18 3afa: 25 e0 ldi r18, 0x05 ; 5 3afc: f2 06 cpc r15, r18 3afe: 08 f4 brcc .+2 ; 0x3b02 ADC_DDR |= (1< ADC_DDR |= (1< ADC_DDR |= (1< 3b1e: 06 30 cpi r16, 0x06 ; 6 3b20: 11 05 cpc r17, r1 3b22: 10 f4 brcc .+4 ; 0x3b28 3b24: 06 97 sbiw r24, 0x06 ; 6 3b26: 38 f0 brcs .+14 ; 0x3b36 // additionally switch the leaving Ports with R_L to GND. // since there is no disadvantage for the already directly switched pins, we can // simply switch all R_L resistors to GND // R_DDR = (1< if ((adcmv[0] < (CAP_EMPTY_LEVEL+2)) && (adcmv[1] < (CAP_EMPTY_LEVEL+2)) && (adcmv[2] < (CAP_EMPTY_LEVEL+2))) { break; } } if (clr_cnt == MAX_ENTLADE_ZEIT) { PartFound = PART_CELL; // mark as Battery 3b32: d0 92 20 01 sts 0x0120, r13 // additionally switch the leaving Ports with R_L to GND. // since there is no disadvantage for the already directly switched pins, we can // simply switch all R_L resistors to GND // R_DDR = (1< // for safety, discharge 5% of discharge time wait1ms(); 3b40: 0e 94 39 0e call 0x1c72 ; 0x1c72 3b44: 0f 5f subi r16, 0xFF ; 255 3b46: 1f 4f sbci r17, 0xFF ; 255 3b48: f8 cf rjmp .-16 ; 0x3b3a 3b4a: ca 94 dec r12 unsigned int clr_cnt; // Clear Counter uint8_t lop_cnt; // loop counter // max. time of discharge in ms (10000/20) == 10s #define MAX_ENTLADE_ZEIT (10000/20) for(lop_cnt=0;lop_cnt<10;lop_cnt++) { 3b4c: 09 f0 breq .+2 ; 0x3b50 3b4e: 84 cf rjmp .-248 ; 0x3a58 for(adcmv[0]=0;adcmv[0] 00003b5a : R_PORT = 0; // switch all resistor outputs to GND, no pull up return; } // end ReadCapacity() void Scale_C_with_vcc(void) { 3b5a: cf 92 push r12 3b5c: df 92 push r13 3b5e: ef 92 push r14 3b60: ff 92 push r15 3b62: cf 93 push r28 3b64: 20 91 7f 01 lds r18, 0x017F 3b68: 30 91 80 01 lds r19, 0x0180 3b6c: 40 91 81 01 lds r20, 0x0181 3b70: 50 91 82 01 lds r21, 0x0182 3b74: c0 91 91 01 lds r28, 0x0191 while (cap.cval > 100000) { cap.cval /= 10; 3b78: 8a e0 ldi r24, 0x0A ; 10 3b7a: c8 2e mov r12, r24 3b7c: d1 2c mov r13, r1 3b7e: e1 2c mov r14, r1 3b80: f1 2c mov r15, r1 3b82: 8c 2f mov r24, r28 3b84: cf 5f subi r28, 0xFF ; 255 return; } // end ReadCapacity() void Scale_C_with_vcc(void) { while (cap.cval > 100000) { 3b86: 21 3a cpi r18, 0xA1 ; 161 3b88: 96 e8 ldi r25, 0x86 ; 134 3b8a: 39 07 cpc r19, r25 3b8c: 91 e0 ldi r25, 0x01 ; 1 3b8e: 49 07 cpc r20, r25 3b90: 51 05 cpc r21, r1 3b92: 38 f0 brcs .+14 ; 0x3ba2 cap.cval /= 10; 3b94: ca 01 movw r24, r20 3b96: b9 01 movw r22, r18 3b98: a7 01 movw r20, r14 3b9a: 96 01 movw r18, r12 3b9c: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 3ba0: f0 cf rjmp .-32 ; 0x3b82 3ba2: 80 93 91 01 sts 0x0191, r24 cap.cpre ++; // prevent overflow } cap.cval *= ADCconfig.U_AVCC; // scale with measured voltage 3ba6: a0 91 33 01 lds r26, 0x0133 3baa: b0 91 34 01 lds r27, 0x0134 3bae: 0e 94 5a 38 call 0x70b4 ; 0x70b4 <__muluhisi3> cap.cval /= U_VCC; // Factors are computed for U_VCC 3bb2: 28 e8 ldi r18, 0x88 ; 136 3bb4: 33 e1 ldi r19, 0x13 ; 19 3bb6: 40 e0 ldi r20, 0x00 ; 0 3bb8: 50 e0 ldi r21, 0x00 ; 0 3bba: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 3bbe: 20 93 7f 01 sts 0x017F, r18 3bc2: 30 93 80 01 sts 0x0180, r19 3bc6: 40 93 81 01 sts 0x0181, r20 3bca: 50 93 82 01 sts 0x0182, r21 } 3bce: cf 91 pop r28 3bd0: ff 90 pop r15 3bd2: ef 90 pop r14 3bd4: df 90 pop r13 3bd6: cf 90 pop r12 3bd8: 08 95 ret 00003bda : #include #include "Transistortester.h" //================================================================= void ReadCapacity(uint8_t HighPin, uint8_t LowPin) { 3bda: a0 e0 ldi r26, 0x00 ; 0 3bdc: b0 e0 ldi r27, 0x00 ; 0 3bde: e3 ef ldi r30, 0xF3 ; 243 3be0: fd e1 ldi r31, 0x1D ; 29 3be2: 0c 94 43 39 jmp 0x7286 ; 0x7286 <__prologue_saves__+0xc> 3be6: c8 2f mov r28, r24 3be8: d6 2f mov r29, r22 adcv[0] = ReadADC(HighPin); // voltage before any load } #endif #ifdef AUTO_CAL pin_combination = (HighPin * 3) + LowPin - 1; // coded Pin combination for capacity zero offset 3bea: 8f ef ldi r24, 0xFF ; 255 3bec: 86 0f add r24, r22 3bee: 9c 2f mov r25, r28 3bf0: 99 0f add r25, r25 3bf2: 9c 0f add r25, r28 3bf4: 89 0f add r24, r25 3bf6: 80 93 5c 01 sts 0x015C, r24 #endif HiPinR_L = pgm_read_byte(&PinRLRHADCtab[HighPin]); //R_L mask for HighPin R_L load 3bfa: ec 2f mov r30, r28 3bfc: f0 e0 ldi r31, 0x00 ; 0 3bfe: e4 5a subi r30, 0xA4 ; 164 3c00: fe 4f sbci r31, 0xFE ; 254 3c02: 14 91 lpm r17, Z #if (((PIN_RL1 + 1) != PIN_RH1) || ((PIN_RL2 + 1) != PIN_RH2) || ((PIN_RL3 + 1) != PIN_RH3)) HiPinR_H = pgm_read_byte((&PinRLRHADCtab[3])+HighPin); //R_H mask for HighPin R_H load LoADC = pgm_read_byte((&PinRLRHADCtab[6])+LowPin) | TXD_MSK; #else HiPinR_H = HiPinR_L + HiPinR_L; //double for HighPin R_H load LoADC = pgm_read_byte((&PinRLRHADCtab[3])+LowPin) | TXD_MSK; 3c04: e6 2f mov r30, r22 3c06: f0 e0 ldi r31, 0x00 ; 0 3c08: e1 5a subi r30, 0xA1 ; 161 3c0a: fe 4f sbci r31, 0xFE ; 254 3c0c: 04 91 lpm r16, Z lcd_testpin(LowPin); lcd_data('C'); lcd_testpin(HighPin); lcd_space(); #endif if(PartFound == PART_RESISTOR) { 3c0e: 80 91 20 01 lds r24, 0x0120 3c12: 81 30 cpi r24, 0x01 ; 1 3c14: 09 f4 brne .+2 ; 0x3c18 3c16: 96 c2 rjmp .+1324 ; 0x4144 lcd_data('R'); wait_about2s(); #endif return; //We have found a resistor already } for (ii=0;ii if ((diodes.Cathode[ii] == LowPin) && (diodes.Anode[ii] == HighPin) && (diodes.Voltage[ii] < 1500)) { 3c2e: 2d 91 ld r18, X+ 3c30: 2d 13 cpse r18, r29 3c32: 0e c0 rjmp .+28 ; 0x3c50 3c34: 9d 01 movw r18, r26 3c36: 27 50 subi r18, 0x07 ; 7 3c38: 31 09 sbc r19, r1 3c3a: f9 01 movw r30, r18 3c3c: 20 81 ld r18, Z 3c3e: 2c 13 cpse r18, r28 3c40: 07 c0 rjmp .+14 ; 0x3c50 3c42: fb 01 movw r30, r22 3c44: 20 81 ld r18, Z 3c46: 31 81 ldd r19, Z+1 ; 0x01 3c48: 2c 3d cpi r18, 0xDC ; 220 3c4a: 35 40 sbci r19, 0x05 ; 5 3c4c: 08 f4 brcc .+2 ; 0x3c50 3c4e: 7a c2 rjmp .+1268 ; 0x4144 3c50: 6e 5f subi r22, 0xFE ; 254 3c52: 7f 4f sbci r23, 0xFF ; 255 3c54: e8 cf rjmp .-48 ; 0x3c26 #if (((PIN_RL1 + 1) != PIN_RH1) || ((PIN_RL2 + 1) != PIN_RH2) || ((PIN_RL3 + 1) != PIN_RH3)) HiPinR_H = pgm_read_byte((&PinRLRHADCtab[3])+HighPin); //R_H mask for HighPin R_H load LoADC = pgm_read_byte((&PinRLRHADCtab[6])+LowPin) | TXD_MSK; #else HiPinR_H = HiPinR_L + HiPinR_L; //double for HighPin R_H load LoADC = pgm_read_byte((&PinRLRHADCtab[3])+LowPin) | TXD_MSK; 3c56: 08 60 ori r16, 0x08 ; 8 } } #if FLASHEND > 0x1fff unsigned int vloss; // lost voltage after load pulse in 0.1% cap.esr = 0; // set ESR of capacitor to zero 3c58: 10 92 8c 01 sts 0x018C, r1 3c5c: 10 92 8b 01 sts 0x018B, r1 vloss = 0; // set lost voltage to zero #endif cap.cval = 0; // set capacity value to zero 3c60: 10 92 7f 01 sts 0x017F, r1 3c64: 10 92 80 01 sts 0x0180, r1 3c68: 10 92 81 01 sts 0x0181, r1 3c6c: 10 92 82 01 sts 0x0182, r1 cap.cpre = 0; // mark for no cap 3c70: 10 92 91 01 sts 0x0191, r1 EntladePins(); // discharge capacitor 3c74: 0e 94 20 1d call 0x3a40 ; 0x3a40 ADC_PORT = TXD_VAL; // switch ADC-Port to GND 3c78: 88 e0 ldi r24, 0x08 ; 8 3c7a: 88 b9 out 0x08, r24 ; 8 R_PORT = 0; // switch R-Port to GND 3c7c: 15 b8 out 0x05, r1 ; 5 ADC_DDR = LoADC; // switch Low-Pin to output (GND) 3c7e: 07 b9 out 0x07, r16 ; 7 // R_DDR = HiPinR_L; // switch R_L port for HighPin to output (GND) R_DDR = 0; // set all R Ports to input (no current) 3c80: 14 b8 out 0x04, r1 ; 4 adcv[0] = ReadADC(HighPin); // voltage before any load 3c82: 8c 2f mov r24, r28 3c84: 0e 94 80 0e call 0x1d00 ; 0x1d00 3c88: 6c 01 movw r12, r24 // ******** should adcv[0] be measured without current??? adcv[2] = adcv[0]; // preset to prevent compiler warning #define MAX_LOAD_TIME 500 #define MIN_VOLTAGE 300 for (ovcnt16=0;ovcnt16 R_PORT = HiPinR_L; //R_L to 1 (VCC) 3ca2: 15 b9 out 0x05, r17 ; 5 R_DDR = HiPinR_L; //switch Pin to output, across R to GND or VCC 3ca4: 14 b9 out 0x04, r17 ; 4 wait10ms(); // wait exactly 10ms, do not sleep 3ca6: 0e 94 34 0e call 0x1c68 ; 0x1c68 R_DDR = 0; // switch back to input 3caa: 14 b8 out 0x04, r1 ; 4 R_PORT = 0; // no Pull up 3cac: 15 b8 out 0x05, r1 ; 5 wait500us(); //wait a little time 3cae: 0e 94 3a 0e call 0x1c74 ; 0x1c74 wdt_reset(); 3cb2: a8 95 wdr // read voltage without current, is already charged enough? adcv[2] = ReadADC(HighPin); 3cb4: 8c 2f mov r24, r28 3cb6: 0e 94 80 0e call 0x1d00 ; 0x1d00 if (adcv[2] > adcv[0]) { 3cba: c8 16 cp r12, r24 3cbc: d9 06 cpc r13, r25 3cbe: 20 f4 brcc .+8 ; 0x3cc8 adcv[2] -= adcv[0]; //difference to beginning voltage 3cc0: 7c 01 movw r14, r24 3cc2: ec 18 sub r14, r12 3cc4: fd 08 sbc r15, r13 3cc6: 02 c0 rjmp .+4 ; 0x3ccc } else { adcv[2] = 0; // voltage is lower or same as beginning voltage 3cc8: e1 2c mov r14, r1 3cca: f1 2c mov r15, r1 } if ((ovcnt16 > (MAX_LOAD_TIME/4)) && (adcv[2] < (MIN_VOLTAGE/4))) { 3ccc: 80 91 5d 01 lds r24, 0x015D 3cd0: 90 91 5e 01 lds r25, 0x015E 3cd4: 8e 37 cpi r24, 0x7E ; 126 3cd6: 91 05 cpc r25, r1 3cd8: 28 f0 brcs .+10 ; 0x3ce4 3cda: 2b e4 ldi r18, 0x4B ; 75 3cdc: e2 16 cp r14, r18 3cde: f1 04 cpc r15, r1 3ce0: 08 f4 brcc .+2 ; 0x3ce4 3ce2: 2b c2 rjmp .+1110 ; 0x413a // 300mV can not be reached well-timed break; // don't try to load any more } // probably 100mF can be charged well-timed if (adcv[2] > MIN_VOLTAGE) { 3ce4: 5d e2 ldi r21, 0x2D ; 45 3ce6: e5 16 cp r14, r21 3ce8: 51 e0 ldi r21, 0x01 ; 1 3cea: f5 06 cpc r15, r21 3cec: 80 f4 brcc .+32 ; 0x3d0e adcv[0] = ReadADC(HighPin); // voltage before any load // ******** should adcv[0] be measured without current??? adcv[2] = adcv[0]; // preset to prevent compiler warning #define MAX_LOAD_TIME 500 #define MIN_VOLTAGE 300 for (ovcnt16=0;ovcnt16 // wdt_reset(); #if DebugOut == 10 DisplayValue(ovcnt16,0,' ',4); Display_mV(adcv[2],4); #endif if (adcv[2] <= MIN_VOLTAGE) { 3d02: fd e2 ldi r31, 0x2D ; 45 3d04: ef 16 cp r14, r31 3d06: f1 e0 ldi r31, 0x01 ; 1 3d08: ff 06 cpc r15, r31 3d0a: 08 f4 brcc .+2 ; 0x3d0e 3d0c: 16 c2 rjmp .+1068 ; 0x413a #endif // if (NumOfDiodes != 0) goto messe_mit_rh; /* ****************************** */ goto keinC; // was never charged enough, >100mF or shorted } //voltage is rised properly and keeps the voltage enough if ((ovcnt16 == 0 ) && (adcv[2] > 1300)) { 3d0e: 80 91 5d 01 lds r24, 0x015D 3d12: 90 91 5e 01 lds r25, 0x015E 3d16: 89 2b or r24, r25 3d18: 21 f0 breq .+8 ; 0x3d22 3d1a: c7 01 movw r24, r14 3d1c: 00 e0 ldi r16, 0x00 ; 0 3d1e: 10 e0 ldi r17, 0x00 ; 0 3d20: 06 c0 rjmp .+12 ; 0x3d2e 3d22: 25 e1 ldi r18, 0x15 ; 21 3d24: e2 16 cp r14, r18 3d26: 25 e0 ldi r18, 0x05 ; 5 3d28: f2 06 cpc r15, r18 3d2a: b8 f3 brcs .-18 ; 0x3d1a 3d2c: 80 c0 rjmp .+256 ; 0x3e2e cap.cval_uncorrected.dw = ovcnt16 + 1; cap.cval_uncorrected.dw *= GetRLmultip(adcv[2]); // get factor to convert time to capacity from table #else // wait the half the time which was required for loading adcv[3] = adcv[2]; // preset to prevent compiler warning for (tmpint=0;tmpint<=ovcnt16;tmpint++) { 3d2e: 20 91 5d 01 lds r18, 0x015D 3d32: 30 91 5e 01 lds r19, 0x015E 3d36: 20 17 cp r18, r16 3d38: 31 07 cpc r19, r17 3d3a: 48 f0 brcs .+18 ; 0x3d4e wait5ms(); 3d3c: 0e 94 35 0e call 0x1c6a ; 0x1c6a adcv[3] = ReadADC(HighPin); // read voltage again, is discharged only a little bit ? 3d40: 8c 2f mov r24, r28 3d42: 0e 94 80 0e call 0x1d00 ; 0x1d00 wdt_reset(); 3d46: a8 95 wdr cap.cval_uncorrected.dw = ovcnt16 + 1; cap.cval_uncorrected.dw *= GetRLmultip(adcv[2]); // get factor to convert time to capacity from table #else // wait the half the time which was required for loading adcv[3] = adcv[2]; // preset to prevent compiler warning for (tmpint=0;tmpint<=ovcnt16;tmpint++) { 3d48: 0f 5f subi r16, 0xFF ; 255 3d4a: 1f 4f sbci r17, 0xFF ; 255 3d4c: f0 cf rjmp .-32 ; 0x3d2e wait5ms(); adcv[3] = ReadADC(HighPin); // read voltage again, is discharged only a little bit ? wdt_reset(); } if (adcv[3] > adcv[0]) { 3d4e: c8 16 cp r12, r24 3d50: d9 06 cpc r13, r25 3d52: 30 f4 brcc .+12 ; 0x3d60 adcv[3] -= adcv[0]; // difference to beginning voltage 3d54: 8c 19 sub r24, r12 3d56: 9d 09 sbc r25, r13 } else { adcv[3] = 0; // voltage is lower or same as beginning voltage } if (adcv[2] > adcv[3]) { 3d58: 8e 15 cp r24, r14 3d5a: 9f 05 cpc r25, r15 3d5c: c8 f4 brcc .+50 ; 0x3d90 3d5e: 02 c0 rjmp .+4 ; 0x3d64 wdt_reset(); } if (adcv[3] > adcv[0]) { adcv[3] -= adcv[0]; // difference to beginning voltage } else { adcv[3] = 0; // voltage is lower or same as beginning voltage 3d60: 80 e0 ldi r24, 0x00 ; 0 3d62: 90 e0 ldi r25, 0x00 ; 0 } if (adcv[2] > adcv[3]) { // build difference to load voltage adcv[3] = adcv[2] - adcv[3]; // lost voltage during load time wait 3d64: 87 01 movw r16, r14 3d66: 08 1b sub r16, r24 3d68: 19 0b sbc r17, r25 } else { adcv[3] = 0; // no lost voltage } #if FLASHEND > 0x1fff // compute equivalent parallel resistance from voltage drop if (adcv[3] > 0) { 3d6a: a1 f0 breq .+40 ; 0x3d94 // there is any voltage drop (adcv[3]) ! // adcv[2] is the loaded voltage. vloss = (unsigned long)(adcv[3] * 1000UL) / adcv[2]; } #endif if (adcv[3] > 200) { 3d6c: 09 3c cpi r16, 0xC9 ; 201 3d6e: 11 05 cpc r17, r1 3d70: 08 f0 brcs .+2 ; 0x3d74 3d72: e3 c1 rjmp .+966 ; 0x413a #if FLASHEND > 0x1fff // compute equivalent parallel resistance from voltage drop if (adcv[3] > 0) { // there is any voltage drop (adcv[3]) ! // adcv[2] is the loaded voltage. vloss = (unsigned long)(adcv[3] * 1000UL) / adcv[2]; 3d74: 98 01 movw r18, r16 3d76: a8 ee ldi r26, 0xE8 ; 232 3d78: b3 e0 ldi r27, 0x03 ; 3 3d7a: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 3d7e: 47 01 movw r8, r14 3d80: a1 2c mov r10, r1 3d82: b1 2c mov r11, r1 3d84: a5 01 movw r20, r10 3d86: 94 01 movw r18, r8 3d88: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 3d8c: 69 01 movw r12, r18 3d8e: 04 c0 rjmp .+8 ; 0x3d98 3d90: 00 e0 ldi r16, 0x00 ; 0 3d92: 10 e0 ldi r17, 0x00 ; 0 3d94: c1 2c mov r12, r1 3d96: d1 2c mov r13, r1 // if (ovcnt16 == 0 ) { // goto messe_mit_rh; // Voltage of more than 300mV is reached in one pulse, but not hold // } goto keinC; // capacitor does not keep the voltage about 5ms } cap.cval_uncorrected.dw = ovcnt16 + 1; 3d98: a0 90 5d 01 lds r10, 0x015D 3d9c: b0 90 5e 01 lds r11, 0x015E 3da0: 5f ef ldi r21, 0xFF ; 255 3da2: a5 1a sub r10, r21 3da4: b5 0a sbc r11, r21 3da6: c5 01 movw r24, r10 3da8: a0 e0 ldi r26, 0x00 ; 0 3daa: b0 e0 ldi r27, 0x00 ; 0 3dac: 80 93 87 01 sts 0x0187, r24 3db0: 90 93 88 01 sts 0x0188, r25 3db4: a0 93 89 01 sts 0x0189, r26 3db8: b0 93 8a 01 sts 0x018A, r27 // compute factor with load voltage + lost voltage during the voltage load time cap.cval_uncorrected.dw *= GetRLmultip(adcv[2]+adcv[3]); // get factor to convert time to capacity from table 3dbc: c8 01 movw r24, r16 3dbe: 8e 0d add r24, r14 3dc0: 9f 1d adc r25, r15 3dc2: 0e 94 ef 20 call 0x41de ; 0x41de 3dc6: 9c 01 movw r18, r24 3dc8: d5 01 movw r26, r10 3dca: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 3dce: 60 93 87 01 sts 0x0187, r22 3dd2: 70 93 88 01 sts 0x0188, r23 3dd6: 80 93 89 01 sts 0x0189, r24 3dda: 90 93 8a 01 sts 0x018A, r25 #endif cap.cval = cap.cval_uncorrected.dw; // set result to uncorrected 3dde: 60 93 7f 01 sts 0x017F, r22 3de2: 70 93 80 01 sts 0x0180, r23 3de6: 80 93 81 01 sts 0x0181, r24 3dea: 90 93 82 01 sts 0x0182, r25 cap.cpre = -9; // switch units to nF 3dee: 87 ef ldi r24, 0xF7 ; 247 3df0: 80 93 91 01 sts 0x0191, r24 Scale_C_with_vcc(); 3df4: 0e 94 ad 1d call 0x3b5a ; 0x3b5a // cap.cval for this type is at least 40000nF, so the last digit will be never shown cap.cval *= (1000 - C_H_KORR); // correct with C_H_KORR with 0.1% resolution, but prevent overflow 3df8: 20 91 7f 01 lds r18, 0x017F 3dfc: 30 91 80 01 lds r19, 0x0180 3e00: 40 91 81 01 lds r20, 0x0181 3e04: 50 91 82 01 lds r21, 0x0182 3e08: a8 ee ldi r26, 0xE8 ; 232 3e0a: b3 e0 ldi r27, 0x03 ; 3 3e0c: 0e 94 5a 38 call 0x70b4 ; 0x70b4 <__muluhisi3> cap.cval /= 100; 3e10: 24 e6 ldi r18, 0x64 ; 100 3e12: 30 e0 ldi r19, 0x00 ; 0 3e14: 40 e0 ldi r20, 0x00 ; 0 3e16: 50 e0 ldi r21, 0x00 ; 0 3e18: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 3e1c: 20 93 7f 01 sts 0x017F, r18 3e20: 30 93 80 01 sts 0x0180, r19 3e24: 40 93 81 01 sts 0x0181, r20 3e28: 50 93 82 01 sts 0x0182, r21 DisplayValue(cap.cval,cap.cpre,'F',4); lcd_space(); u2lcd(ovcnt16); wait_about3s(); #endif goto checkDiodes; 3e2c: 44 c1 rjmp .+648 ; 0x40b6 //================================================================================== // Measurement of little capacity values messe_mit_rh: //little capacity value, about < 50 µF EntladePins(); // discharge capacitor 3e2e: 0e 94 20 1d call 0x3a40 ; 0x3a40 //measure with the R_H (470kOhm) resistor R_PORT = 0; // R_DDR ist HiPinR_L 3e32: 15 b8 out 0x05, r1 ; 5 ADC_DDR = (1< // setup Counter1 ovcnt16 = 0; 3e5e: 10 92 5e 01 sts 0x015E, r1 3e62: 10 92 5d 01 sts 0x015D, r1 TCCR1A = 0; // set Counter1 to normal Mode 3e66: 10 92 80 00 sts 0x0080, r1 TCNT1 = 0; //set Counter to 0 3e6a: 10 92 85 00 sts 0x0085, r1 3e6e: 10 92 84 00 sts 0x0084, r1 TI1_INT_FLAGS = (1< // charge capacitor with R_H resistor TCCR1B = (0< 3e98: 88 0f add r24, r24 3e9a: 0a 94 dec r0 3e9c: ea f7 brpl .-6 ; 0x3e98 3e9e: 80 95 com r24 3ea0: 8f 70 andi r24, 0x0F ; 15 3ea2: 87 b9 out 0x07, r24 ; 7 3ea4: 01 c0 rjmp .+2 ; 0x3ea8 } else { TCCR1B = (0< sleep_enable(); 3eb8: 83 b7 in r24, 0x33 ; 51 3eba: 81 60 ori r24, 0x01 ; 1 3ebc: 83 bf out 0x33, r24 ; 51 sei(); // enable interrupts after next instruction 3ebe: 78 94 sei sleep_cpu(); // only enable interrupts during sleeping 3ec0: 88 95 sleep sleep_disable(); 3ec2: 83 b7 in r24, 0x33 ; 51 3ec4: 8e 7f andi r24, 0xFE ; 254 3ec6: 83 bf out 0x33, r24 ; 51 cli(); // disable interrupts again 3ec8: f8 94 cli wdt_reset(); // reset watch dog during waiting 3eca: a8 95 wdr if(ovcnt16 == (F_CPU/5000)) { 3ecc: 80 91 5d 01 lds r24, 0x015D 3ed0: 90 91 5e 01 lds r25, 0x015E 3ed4: 80 34 cpi r24, 0x40 ; 64 3ed6: 96 40 sbci r25, 0x06 ; 6 3ed8: 59 f7 brne .-42 ; 0x3eb0 break; //Timeout for Charging, above 12 s } } sei(); // enable interrupts again 3eda: 78 94 sei TCCR1B = (0< load_diff = adcv[2] + REF_C_KORR - ref_mv; // build difference of capacitor voltage to Reference Voltage 3efc: 20 91 37 01 lds r18, 0x0137 3f00: 30 91 38 01 lds r19, 0x0138 3f04: 82 1b sub r24, r18 3f06: 93 0b sbc r25, r19 3f08: 0c 96 adiw r24, 0x0c ; 12 3f0a: 90 93 94 01 sts 0x0194, r25 3f0e: 80 93 93 01 sts 0x0193, r24 //############################################################ if (ovcnt16 >= (F_CPU/10000)) { 3f12: 80 91 5d 01 lds r24, 0x015D 3f16: 90 91 5e 01 lds r25, 0x015E 3f1a: 80 32 cpi r24, 0x20 ; 32 3f1c: 93 40 sbci r25, 0x03 ; 3 3f1e: 08 f0 brcs .+2 ; 0x3f22 3f20: 0c c1 rjmp .+536 ; 0x413a wait_about1s(); #endif goto keinC; // no normal end } // cap.cval_uncorrected = CombineII2Long(ovcnt16, tmpint); cap.cval_uncorrected.w[1] = ovcnt16; 3f22: 80 91 5d 01 lds r24, 0x015D 3f26: 90 91 5e 01 lds r25, 0x015E 3f2a: 90 93 8a 01 sts 0x018A, r25 3f2e: 80 93 89 01 sts 0x0189, r24 cap.cval_uncorrected.w[0] = tmpint; 3f32: f0 92 88 01 sts 0x0188, r15 3f36: e0 92 87 01 sts 0x0187, r14 cap.cpre = -12; // cap.cval unit is pF 3f3a: 84 ef ldi r24, 0xF4 ; 244 3f3c: 80 93 91 01 sts 0x0191, r24 if (ovcnt16 > 65) { 3f40: 80 91 5d 01 lds r24, 0x015D 3f44: 90 91 5e 01 lds r25, 0x015E 3f48: 82 34 cpi r24, 0x42 ; 66 3f4a: 91 05 cpc r25, r1 3f4c: c8 f0 brcs .+50 ; 0x3f80 cap.cval_uncorrected.dw /= 100; // switch to next unit 3f4e: 60 91 87 01 lds r22, 0x0187 3f52: 70 91 88 01 lds r23, 0x0188 3f56: 80 91 89 01 lds r24, 0x0189 3f5a: 90 91 8a 01 lds r25, 0x018A 3f5e: 24 e6 ldi r18, 0x64 ; 100 3f60: 30 e0 ldi r19, 0x00 ; 0 3f62: 40 e0 ldi r20, 0x00 ; 0 3f64: 50 e0 ldi r21, 0x00 ; 0 3f66: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 3f6a: 20 93 87 01 sts 0x0187, r18 3f6e: 30 93 88 01 sts 0x0188, r19 3f72: 40 93 89 01 sts 0x0189, r20 3f76: 50 93 8a 01 sts 0x018A, r21 cap.cpre += 2; // set unit, prevent overflow 3f7a: 86 ef ldi r24, 0xF6 ; 246 3f7c: 80 93 91 01 sts 0x0191, r24 } cap.cval_uncorrected.dw *= RHmultip; // 708 3f80: a0 91 7d 01 lds r26, 0x017D 3f84: b0 91 7e 01 lds r27, 0x017E 3f88: 20 91 87 01 lds r18, 0x0187 3f8c: 30 91 88 01 lds r19, 0x0188 3f90: 40 91 89 01 lds r20, 0x0189 3f94: 50 91 8a 01 lds r21, 0x018A 3f98: 0e 94 5a 38 call 0x70b4 ; 0x70b4 <__muluhisi3> cap.cval_uncorrected.dw /= (F_CPU / 10000); // divide by 100 (@ 1MHz clock), 800 (@ 8MHz clock) 3f9c: 20 e2 ldi r18, 0x20 ; 32 3f9e: 33 e0 ldi r19, 0x03 ; 3 3fa0: 40 e0 ldi r20, 0x00 ; 0 3fa2: 50 e0 ldi r21, 0x00 ; 0 3fa4: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 3fa8: 20 93 87 01 sts 0x0187, r18 3fac: 30 93 88 01 sts 0x0188, r19 3fb0: 40 93 89 01 sts 0x0189, r20 3fb4: 50 93 8a 01 sts 0x018A, r21 cap.cval = cap.cval_uncorrected.dw; // set the corrected cap.cval 3fb8: 20 93 7f 01 sts 0x017F, r18 3fbc: 30 93 80 01 sts 0x0180, r19 3fc0: 40 93 81 01 sts 0x0181, r20 3fc4: 50 93 82 01 sts 0x0182, r21 Scale_C_with_vcc(); 3fc8: 0e 94 ad 1d call 0x3b5a ; 0x3b5a if (cap.cpre == -12) { 3fcc: 80 91 91 01 lds r24, 0x0191 3fd0: 84 3f cpi r24, 0xF4 ; 244 3fd2: 09 f0 breq .+2 ; 0x3fd6 3fd4: 60 c0 rjmp .+192 ; 0x4096 #if COMP_SLEW1 > COMP_SLEW2 if (cap.cval < COMP_SLEW1) { 3fd6: c0 90 7f 01 lds r12, 0x017F 3fda: d0 90 80 01 lds r13, 0x0180 3fde: e0 90 81 01 lds r14, 0x0181 3fe2: f0 90 82 01 lds r15, 0x0182 3fe6: 20 ea ldi r18, 0xA0 ; 160 3fe8: c2 16 cp r12, r18 3fea: 2f e0 ldi r18, 0x0F ; 15 3fec: d2 06 cpc r13, r18 3fee: e1 04 cpc r14, r1 3ff0: f1 04 cpc r15, r1 3ff2: c0 f4 brcc .+48 ; 0x4024 // add slew rate dependent offset cap.cval += (COMP_SLEW1 / (cap.cval+COMP_SLEW2 )); 3ff4: a7 01 movw r20, r14 3ff6: 96 01 movw r18, r12 3ff8: 2c 54 subi r18, 0x4C ; 76 3ffa: 3f 4f sbci r19, 0xFF ; 255 3ffc: 4f 4f sbci r20, 0xFF ; 255 3ffe: 5f 4f sbci r21, 0xFF ; 255 4000: 60 ea ldi r22, 0xA0 ; 160 4002: 7f e0 ldi r23, 0x0F ; 15 4004: 80 e0 ldi r24, 0x00 ; 0 4006: 90 e0 ldi r25, 0x00 ; 0 4008: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 400c: 2c 0d add r18, r12 400e: 3d 1d adc r19, r13 4010: 4e 1d adc r20, r14 4012: 5f 1d adc r21, r15 4014: 20 93 7f 01 sts 0x017F, r18 4018: 30 93 80 01 sts 0x0180, r19 401c: 40 93 81 01 sts 0x0181, r20 4020: 50 93 82 01 sts 0x0182, r21 } #endif #ifdef AUTO_CAL // auto calibration mode, cap_null can be updated in selftest section tmpint = eeprom_read_byte(&c_zero_tab[pin_combination]); // read zero offset 4024: 80 91 5c 01 lds r24, 0x015C 4028: 90 e0 ldi r25, 0x00 ; 0 402a: 8b 5f subi r24, 0xFB ; 251 402c: 9f 4f sbci r25, 0xFF ; 255 402e: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> if (cap.cval > tmpint) { 4032: c0 90 7f 01 lds r12, 0x017F 4036: d0 90 80 01 lds r13, 0x0180 403a: e0 90 81 01 lds r14, 0x0181 403e: f0 90 82 01 lds r15, 0x0182 4042: 48 2f mov r20, r24 4044: 50 e0 ldi r21, 0x00 ; 0 4046: 60 e0 ldi r22, 0x00 ; 0 4048: 70 e0 ldi r23, 0x00 ; 0 404a: 4c 15 cp r20, r12 404c: 5d 05 cpc r21, r13 404e: 6e 05 cpc r22, r14 4050: 7f 05 cpc r23, r15 4052: 68 f4 brcc .+26 ; 0x406e cap.cval -= tmpint; //subtract zero offset (pF) 4054: c4 1a sub r12, r20 4056: d5 0a sbc r13, r21 4058: e6 0a sbc r14, r22 405a: f7 0a sbc r15, r23 405c: c0 92 7f 01 sts 0x017F, r12 4060: d0 92 80 01 sts 0x0180, r13 4064: e0 92 81 01 sts 0x0181, r14 4068: f0 92 82 01 sts 0x0182, r15 406c: 14 c0 rjmp .+40 ; 0x4096 } else { #if FLASHEND > 0x3fff if ((cap.cval+C_LIMIT_TO_UNCALIBRATED) < tmpint) { 406e: 84 e1 ldi r24, 0x14 ; 20 4070: c8 0e add r12, r24 4072: d1 1c adc r13, r1 4074: e1 1c adc r14, r1 4076: f1 1c adc r15, r1 4078: c4 16 cp r12, r20 407a: d5 06 cpc r13, r21 407c: e6 06 cpc r14, r22 407e: f7 06 cpc r15, r23 4080: 10 f4 brcc .+4 ; 0x4086 mark_as_uncalibrated(); // set in EEprom to uncalibrated 4082: 0e 94 5e 14 call 0x28bc ; 0x28bc lcd_testpin(HighPin); lcd_space(); #endif } #endif cap.cval = 0; //unsigned long may not reach negativ value 4086: 10 92 7f 01 sts 0x017F, r1 408a: 10 92 80 01 sts 0x0180, r1 408e: 10 92 81 01 sts 0x0181, r1 4092: 10 92 82 01 sts 0x0182, r1 lcd_testpin(HighPin); lcd_space(); DisplayValue(cap.cval,cap.cpre,'F',4); wait_about3s(); #endif R_DDR = HiPinR_L; //switch R_L for High-Pin to GND 4096: 14 b9 out 0x04, r17 ; 4 #if F_CPU < 2000001 if(cap.cval < 50) #else if(cap.cval < 25) 4098: 80 91 7f 01 lds r24, 0x017F 409c: 90 91 80 01 lds r25, 0x0180 40a0: a0 91 81 01 lds r26, 0x0181 40a4: b0 91 82 01 lds r27, 0x0182 40a8: 49 97 sbiw r24, 0x19 ; 25 40aa: a1 05 cpc r26, r1 40ac: b1 05 cpc r27, r1 40ae: 08 f4 brcc .+2 ; 0x40b2 40b0: 44 c0 rjmp .+136 ; 0x413a } #if FLASHEND > 0x1fff unsigned int vloss; // lost voltage after load pulse in 0.1% cap.esr = 0; // set ESR of capacitor to zero vloss = 0; // set lost voltage to zero 40b2: c1 2c mov r12, r1 40b4: d1 2c mov r13, r1 #endif goto keinC; //capacity to low, < 50pF @1MHz (25pF @8MHz) } // end low capacity checkDiodes: if((NumOfDiodes > 0) && (PartFound != PART_FET)) { 40b6: 80 91 1e 01 lds r24, 0x011E 40ba: 88 23 and r24, r24 40bc: 21 f0 breq .+8 ; 0x40c6 40be: 80 91 20 01 lds r24, 0x0120 40c2: 84 30 cpi r24, 0x04 ; 4 40c4: d1 f5 brne .+116 ; 0x413a wait_about1s(); #endif // nearly shure, that there is one or more diodes in reverse direction, // which would be wrongly detected as capacitor } else { PartFound = PART_CAPACITOR; //capacitor is found 40c6: 87 e0 ldi r24, 0x07 ; 7 40c8: 80 93 20 01 sts 0x0120, r24 if ((cap.cpre > cap.cpre_max) || ((cap.cpre == cap.cpre_max) && (cap.cval > cap.cval_max))) { 40cc: 20 91 91 01 lds r18, 0x0191 40d0: 80 91 92 01 lds r24, 0x0192 40d4: 82 17 cp r24, r18 40d6: bc f0 brlt .+46 ; 0x4106 40d8: 28 13 cpse r18, r24 40da: 2f c0 rjmp .+94 ; 0x413a 40dc: 40 91 7f 01 lds r20, 0x017F 40e0: 50 91 80 01 lds r21, 0x0180 40e4: 60 91 81 01 lds r22, 0x0181 40e8: 70 91 82 01 lds r23, 0x0182 40ec: 80 91 83 01 lds r24, 0x0183 40f0: 90 91 84 01 lds r25, 0x0184 40f4: a0 91 85 01 lds r26, 0x0185 40f8: b0 91 86 01 lds r27, 0x0186 40fc: 84 17 cp r24, r20 40fe: 95 07 cpc r25, r21 4100: a6 07 cpc r26, r22 4102: b7 07 cpc r27, r23 4104: d0 f4 brcc .+52 ; 0x413a // we have found a greater one, overwrite the old values cap.cval_max = cap.cval; 4106: 80 91 7f 01 lds r24, 0x017F 410a: 90 91 80 01 lds r25, 0x0180 410e: a0 91 81 01 lds r26, 0x0181 4112: b0 91 82 01 lds r27, 0x0182 4116: 80 93 83 01 sts 0x0183, r24 411a: 90 93 84 01 sts 0x0184, r25 411e: a0 93 85 01 sts 0x0185, r26 4122: b0 93 86 01 sts 0x0186, r27 cap.cpre_max = cap.cpre; 4126: 20 93 92 01 sts 0x0192, r18 #if FLASHEND > 0x1fff cap.v_loss = vloss; // lost voltage in 0.01% 412a: d0 92 8e 01 sts 0x018E, r13 412e: c0 92 8d 01 sts 0x018D, r12 #endif cap.ca = LowPin; // save LowPin 4132: d0 93 8f 01 sts 0x018F, r29 cap.cb = HighPin; // save HighPin 4136: c0 93 90 01 sts 0x0190, r28 keinC: // discharge capacitor again // EntladePins(); // discharge capacitors //ready // switch all ports to input ADC_DDR = TXD_MSK; // switch all ADC ports to input 413a: 88 e0 ldi r24, 0x08 ; 8 413c: 87 b9 out 0x07, r24 ; 7 ADC_PORT = TXD_VAL; // switch all ADC outputs to GND, no pull up 413e: 88 b9 out 0x08, r24 ; 8 R_DDR = 0; // switch all resistor ports to input 4140: 14 b8 out 0x04, r1 ; 4 R_PORT = 0; // switch all resistor outputs to GND, no pull up 4142: 15 b8 out 0x05, r1 ; 5 return; } // end ReadCapacity() 4144: cd b7 in r28, 0x3d ; 61 4146: de b7 in r29, 0x3e ; 62 4148: ec e0 ldi r30, 0x0C ; 12 414a: 0c 94 5f 39 jmp 0x72be ; 0x72be <__epilogue_restores__+0xc> 0000414e <__vector_13>: cap.cval /= U_VCC; // Factors are computed for U_VCC } #ifndef INHIBIT_SLEEP_MODE /* Interrupt Service Routine for timer1 Overflow */ ISR(TIMER1_OVF_vect, ISR_BLOCK) { 414e: 1f 92 push r1 4150: 0f 92 push r0 4152: 0f b6 in r0, 0x3f ; 63 4154: 0f 92 push r0 4156: 11 24 eor r1, r1 4158: 8f 93 push r24 415a: 9f 93 push r25 if ((!(TI1_INT_FLAGS & (1< 4160: 80 91 7c 01 lds r24, 0x017C 4164: 81 11 cpse r24, r1 4166: 09 c0 rjmp .+18 ; 0x417a <__vector_13+0x2c> 4168: b5 9b sbis 0x16, 5 ; 22 416a: 10 c0 rjmp .+32 ; 0x418c <__vector_13+0x3e> 416c: 80 91 86 00 lds r24, 0x0086 4170: 90 91 87 00 lds r25, 0x0087 4174: 8a 3f cpi r24, 0xFA ; 250 4176: 91 05 cpc r25, r1 4178: 48 f4 brcc .+18 ; 0x418c <__vector_13+0x3e> // Capture Event not pending or (Capture Event pending and ICR1 < 250 // the ICR1H is buffered and can not examined alone, we must read the ICR1L first (with ICR1 access) ! ovcnt16++; // count Overflow 417a: 80 91 5d 01 lds r24, 0x015D 417e: 90 91 5e 01 lds r25, 0x015E 4182: 01 96 adiw r24, 0x01 ; 1 4184: 90 93 5e 01 sts 0x015E, r25 4188: 80 93 5d 01 sts 0x015D, r24 } } 418c: 9f 91 pop r25 418e: 8f 91 pop r24 4190: 0f 90 pop r0 4192: 0f be out 0x3f, r0 ; 63 4194: 0f 90 pop r0 4196: 1f 90 pop r1 4198: 18 95 reti 0000419a <__vector_10>: /* Interrupt Service Routine for timer1 capture event (Comparator) */ ISR(TIMER1_CAPT_vect, ISR_BLOCK) { 419a: 1f 92 push r1 419c: 0f 92 push r0 419e: 0f b6 in r0, 0x3f ; 63 41a0: 0f 92 push r0 41a2: 11 24 eor r1, r1 41a4: 8f 93 push r24 41a6: 9f 93 push r25 unfinished = 0; // clear unfinished flag 41a8: 10 92 7c 01 sts 0x017C, r1 // With unfinished set to 0, we prevent further counting the Overflow.s // Is already a Overflow detected? if((TI1_INT_FLAGS & (1< //there is already a Overflow detected, before or after the capture event? // ICR1H is buffered and can not examined alone, we must read the ICR1L first (with ICR1 access) ! if (ICR1 < 250) { 41b0: 80 91 86 00 lds r24, 0x0086 41b4: 90 91 87 00 lds r25, 0x0087 41b8: 8a 3f cpi r24, 0xFA ; 250 41ba: 91 05 cpc r25, r1 41bc: 48 f4 brcc .+18 ; 0x41d0 <__vector_10+0x36> // Yes, Input Capture Counter is low, Overflow has occured before the capture event ovcnt16++; // count Overflow 41be: 80 91 5d 01 lds r24, 0x015D 41c2: 90 91 5e 01 lds r25, 0x015E 41c6: 01 96 adiw r24, 0x01 ; 1 41c8: 90 93 5e 01 sts 0x015E, r25 41cc: 80 93 5d 01 sts 0x015D, r24 } } } 41d0: 9f 91 pop r25 41d2: 8f 91 pop r24 41d4: 0f 90 pop r0 41d6: 0f be out 0x3f, r0 ; 63 41d8: 0f 90 pop r0 41da: 1f 90 pop r1 41dc: 18 95 reti 000041de : .section .text ; unsigned int GetRLmultip(unsigned int cvolt) GetRLmultip: push r0 41de: 0f 92 push r0 ldi r18, hi8(RL_Tab_Beginn) ; 1 41e0: 21 e0 ldi r18, 0x01 ; 1 cpi r24, lo8(RL_Tab_Beginn) ; 44 41e2: 8c 32 cpi r24, 0x2C ; 44 cpc r25, r18 41e4: 92 07 cpc r25, r18 brcc is_bigger ;if (cvolt >= RL_Tab_Beginn) 41e6: 10 f4 brcc .+4 ; 0x41ec ldi r24, lo8(RL_Tab_Beginn) ; uvolt = 0 = RL_Tab_Begin - RL_Tab_Begin 41e8: 8c e2 ldi r24, 0x2C ; 44 ldi r25, hi8(RL_Tab_Beginn) ; limit to begin of table 41ea: 91 e0 ldi r25, 0x01 ; 1 000041ec : is_bigger: subi r24, lo8(RL_Tab_Beginn) ; uvolt = cvolt - RL_Tab_Beginn; 41ec: 8c 52 subi r24, 0x2C ; 44 sbci r25, hi8(RL_Tab_Beginn) ; 1 41ee: 91 40 sbci r25, 0x01 ; 1 ldi r22, lo8(RL_Tab_Abstand) ; 25 41f0: 69 e1 ldi r22, 0x19 ; 25 ldi r23, hi8(RL_Tab_Abstand) ; 0 41f2: 70 e0 ldi r23, 0x00 ; 0 ACALL __udivmodhi4 ;tabind = uvolt / RL_Tab_Abstand; 41f4: 0e 94 75 38 call 0x70ea ; 0x70ea <__udivmodhi4> ; r24:25 tabres = uvolt % RL_Tab_Abstand; // r25 allways zero ; tabres = RL_Tab_Abstand - tabres; ldi r25, RL_Tab_Abstand ; 25 41f8: 99 e1 ldi r25, 0x19 ; 25 cpi r22, ((RL_Tab_Length/RL_Tab_Abstand)-1) ; if (tabind > ((RL_Tab_Length/RL_Tab_Abstand)-1)) 41fa: 6b 32 cpi r22, 0x2B ; 43 brcs is_lower 41fc: 10 f0 brcs .+4 ; 0x4202 mov r25, r24 ; tabres = 0 = (RL_Tab_Abstand==tabres) - tabres 41fe: 98 2f mov r25, r24 ldi r22, (RL_Tab_Length/RL_Tab_Abstand)-1; tabind = (RL_Tab_Length/RL_Tab_Abstand)-1;// limit to end of table 4200: 6b e2 ldi r22, 0x2B ; 43 00004202 : is_lower: sub r25, r24 ; tabres = RL_Tab_Abstand - tabres; 4202: 98 1b sub r25, r24 ; r22 = tabind , r25 = tabres LDIZ RLtab 4204: e8 e6 ldi r30, 0x68 ; 104 4206: f5 e0 ldi r31, 0x05 ; 5 add r30, r22 ; + tabind 4208: e6 0f add r30, r22 adc r31, zero_reg 420a: f1 1d adc r31, r1 add r30, r22 ; + tabind (word access) 420c: e6 0f add r30, r22 adc r31, zero_reg 420e: f1 1d adc r31, r1 movw r24,r30 ACALL eeprom_read_byte ; y2 = MEM_read_word(&RLtab[tabind+1]); mov r19, r24 pop r22 ; restore tabres in r22 #else lpm r20, Z+ ; y1 = MEM_read_word(&RLtab[tabind]); 4210: 45 91 lpm r20, Z+ lpm r21, Z+ 4212: 55 91 lpm r21, Z+ lpm r18, Z+ ; y2 = MEM_read_word(&RLtab[tabind+1]); 4214: 25 91 lpm r18, Z+ lpm r19, Z+ 4216: 35 91 lpm r19, Z+ mov r22, r25 4218: 69 2f mov r22, r25 #endif ; return ( ((y1 - y2) * tabres + (RL_Tab_Abstand/2)) / RL_Tab_Abstand + y2); // interpolate table ;; ldi r23, 0x00 ; hi8(tabres) allways zero sub r20, r18 ; y1 - y2 421a: 42 1b sub r20, r18 sbc r21, r19 ; maximum of 3466 need two registers 421c: 53 0b sbc r21, r19 mul r22, r20 ;lo8(tabres) * lo8(y1-y2) 421e: 64 9f mul r22, r20 movw r24, r0 ; r24:25 = * 4220: c0 01 movw r24, r0 mul r22, r21 ;lo8(tabres) * hi8(y1-y2) 4222: 65 9f mul r22, r21 add r25, r0 ; r25 + lo8(*) 4224: 90 0d add r25, r0 ;; mul r23, r20 ;hi8(tabres) * lo8(y1-y2) , allways zero ;; add r25, r0 ; r25 + lo8(*) eor r1, r1 4226: 11 24 eor r1, r1 adiw r24, (RL_Tab_Abstand/2) ; 12 4228: 0c 96 adiw r24, 0x0c ; 12 ldi r22, lo8(RL_Tab_Abstand) ; 25 422a: 69 e1 ldi r22, 0x19 ; 25 ldi r23, hi8(RL_Tab_Abstand) ; 0 422c: 70 e0 ldi r23, 0x00 ; 0 ACALL __udivmodhi4 ; ((y1 - y2) * tabres + (RL_Tab_Abstand/2)) / RL_Tab_Abstand 422e: 0e 94 75 38 call 0x70ea ; 0x70ea <__udivmodhi4> add r22, r18 ; + y2 4232: 62 0f add r22, r18 adc r23, r19 4234: 73 1f adc r23, r19 movw r24, r22 4236: cb 01 movw r24, r22 pop r0 4238: 0f 90 pop r0 ret 423a: 08 95 ret 0000423c : #include "Transistortester.h" void Calibrate_UR(void) { 423c: a0 e0 ldi r26, 0x00 ; 0 423e: b0 e0 ldi r27, 0x00 ; 0 4240: e4 e2 ldi r30, 0x24 ; 36 4242: f1 e2 ldi r31, 0x21 ; 33 4244: 0c 94 43 39 jmp 0x7286 ; 0x7286 <__prologue_saves__+0xc> uint16_t sum_rp; // sum of 3 Pin voltages with 680 Ohm load uint16_t u680; // 3 * (Voltage at 680 Ohm) #endif ADCconfig.U_AVCC = U_VCC; // set initial VCC Voltage 4248: 88 e8 ldi r24, 0x88 ; 136 424a: 93 e1 ldi r25, 0x13 ; 19 424c: 90 93 34 01 sts 0x0134, r25 4250: 80 93 33 01 sts 0x0133, r24 ADCconfig.Samples = R_ANZ_MESS; // set number of ADC reads near to maximum 4254: 8e eb ldi r24, 0xBE ; 190 4256: 80 93 2f 01 sts 0x012F, r24 //############################################ #if FLASHEND > 0x1fff uint16_t mv2500; ADC_PORT = TXD_VAL; // switch to 0V 425a: c8 e0 ldi r28, 0x08 ; 8 425c: c8 b9 out 0x08, r28 ; 8 ADC_DDR = (1< ADC_DDR = TXD_MSK; // switch pin with reference back to input 4266: c7 b9 out 0x07, r28 ; 7 mv2500 = W5msReadADC(TPREF); // read voltage of 2.5V precision reference 4268: 84 e0 ldi r24, 0x04 ; 4 426a: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 426e: ac 01 movw r20, r24 if ((mv2500 > 2250) && (mv2500 < 2750)) { 4270: 8b 5c subi r24, 0xCB ; 203 4272: 98 40 sbci r25, 0x08 ; 8 4274: 83 3f cpi r24, 0xF3 ; 243 4276: 91 40 sbci r25, 0x01 ; 1 4278: a0 f4 brcc .+40 ; 0x42a2 // precision voltage reference connected, update U_AVCC WithReference = 1; 427a: 81 e0 ldi r24, 0x01 ; 1 427c: 80 93 47 01 sts 0x0147, r24 ADCconfig.U_AVCC = (unsigned long)((unsigned long)ADCconfig.U_AVCC * 2495) / mv2500; 4280: 20 91 33 01 lds r18, 0x0133 4284: 30 91 34 01 lds r19, 0x0134 4288: af eb ldi r26, 0xBF ; 191 428a: b9 e0 ldi r27, 0x09 ; 9 428c: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 4290: 9a 01 movw r18, r20 4292: 40 e0 ldi r20, 0x00 ; 0 4294: 50 e0 ldi r21, 0x00 ; 0 4296: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 429a: 30 93 34 01 sts 0x0134, r19 429e: 20 93 33 01 sts 0x0133, r18 } #endif #ifdef WITH_AUTO_REF (void) ReadADC(MUX_INT_REF); // read reference voltage 42a2: 8e e0 ldi r24, 0x0E ; 14 42a4: 0e 94 80 0e call 0x1d00 ; 0x1d00 ref_mv = W5msReadADC(MUX_INT_REF); // read reference voltage 42a8: 8e e0 ldi r24, 0x0E ; 14 42aa: 0e 94 7c 0e call 0x1cf8 ; 0x1cf8 42ae: 90 93 38 01 sts 0x0138, r25 42b2: 80 93 37 01 sts 0x0137, r24 #else ref_mv = DEFAULT_BAND_GAP; // set to default Reference Voltage #endif RefVoltage(); //compute RHmultip = f(reference voltage) 42b6: 0e 94 46 0f call 0x1e8c ; 0x1e8c //############################################ #ifdef AUTO_CAL // measurement of internal resistance of the ADC port outputs switched to GND ADC_DDR = 1< 42ca: 7c 01 movw r14, r24 ADC_DDR = 1< 42dc: e8 0e add r14, r24 42de: f9 1e adc r15, r25 ADC_DDR = 1< 42f4: e8 0e add r14, r24 42f6: f9 1e adc r15, r25 // measurement of internal resistance of the ADC port output switched to VCC R_PORT = 0; // R-Ports to GND 42f8: 15 b8 out 0x05, r1 ; 5 ADC_PORT = 1< 430e: 5c 01 movw r10, r24 ADC_PORT = 1< 4324: 6c 01 movw r12, r24 ADC_PORT = 1< // measurement of internal resistance of the ADC port output switched to VCC R_PORT = 0; // R-Ports to GND ADC_PORT = 1< 4376: a5 01 movw r20, r10 4378: 94 01 movw r18, r8 437a: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 437e: 69 01 movw r12, r18 4380: 7a 01 movw r14, r20 4382: 30 93 46 01 sts 0x0146, r19 4386: 20 93 45 01 sts 0x0145, r18 // adcmv[2] = pin_rm; // for last output in row 2 pin_rpl = (unsigned long)((unsigned long)sum_rp * (unsigned long)R_L_VAL) / (unsigned long)u680; 438a: 9e 01 movw r18, r28 438c: a0 e9 ldi r26, 0x90 ; 144 438e: ba e1 ldi r27, 0x1A ; 26 4390: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 4394: a5 01 movw r20, r10 4396: 94 01 movw r18, r8 4398: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 439c: 30 93 36 01 sts 0x0136, r19 43a0: 20 93 35 01 sts 0x0135, r18 resis680pl = pin_rpl + R_L_VAL; 43a4: 20 57 subi r18, 0x70 ; 112 43a6: 35 4e sbci r19, 0xE5 ; 229 43a8: 30 93 22 01 sts 0x0122, r19 43ac: 20 93 21 01 sts 0x0121, r18 resis680mi = pin_rmi + R_L_VAL; 43b0: 80 e7 ldi r24, 0x70 ; 112 43b2: c8 1a sub r12, r24 43b4: 85 ee ldi r24, 0xE5 ; 229 43b6: d8 0a sbc r13, r24 43b8: d0 92 1b 01 sts 0x011B, r13 43bc: c0 92 1a 01 sts 0x011A, r12 #endif ADCconfig.Samples = ANZ_MESS; // set to configured number of ADC samples 43c0: 89 e1 ldi r24, 0x19 ; 25 43c2: 80 93 2f 01 sts 0x012F, r24 } 43c6: cd b7 in r28, 0x3d ; 61 43c8: de b7 in r29, 0x3e ; 62 43ca: ec e0 ldi r30, 0x0C ; 12 43cc: 0c 94 5f 39 jmp 0x72be ; 0x72be <__epilogue_restores__+0xc> 000043d0 : #include #include "Transistortester.h" //================================================================= void ReadInductance(void) { 43d0: a3 e1 ldi r26, 0x13 ; 19 43d2: b0 e0 ldi r27, 0x00 ; 0 43d4: ee ee ldi r30, 0xEE ; 238 43d6: f1 e2 ldi r31, 0x21 ; 33 43d8: 0c 94 3d 39 jmp 0x727a ; 0x727a <__prologue_saves__> uint16_t pw; // return value from Rnum2pins() uint8_t pb[2]; // the pin numbers LowPin and HighPin } rpins; // resistor pin structure to prevent two return parameters inductor_lpre = 0; // H units, mark inductor as 0 43dc: 10 92 02 01 sts 0x0102, r1 if(PartFound != PART_RESISTOR) { 43e0: 80 91 20 01 lds r24, 0x0120 43e4: 81 30 cpi r24, 0x01 ; 1 43e6: 09 f0 breq .+2 ; 0x43ea 43e8: 23 c2 rjmp .+1094 ; 0x4830 return; //We have found no resistor } if (ResistorsFound != 1) { 43ea: 80 91 7b 01 lds r24, 0x017B 43ee: 81 30 cpi r24, 0x01 ; 1 43f0: 09 f0 breq .+2 ; 0x43f4 43f2: 1e c2 rjmp .+1084 ; 0x4830 return; // do not search for inductance, more than 1 resistor } res_num = ResistorList[0]; 43f4: 20 90 62 01 lds r2, 0x0162 if (ResistorVal[res_num] > 21000) return; 43f8: 24 e0 ldi r18, 0x04 ; 4 43fa: 22 9e mul r2, r18 43fc: f0 01 movw r30, r0 43fe: 11 24 eor r1, r1 4400: e3 55 subi r30, 0x53 ; 83 4402: fe 4f sbci r31, 0xFE ; 254 4404: 80 81 ld r24, Z 4406: 91 81 ldd r25, Z+1 ; 0x01 4408: a2 81 ldd r26, Z+2 ; 0x02 440a: b3 81 ldd r27, Z+3 ; 0x03 440c: 89 30 cpi r24, 0x09 ; 9 440e: 32 e5 ldi r19, 0x52 ; 82 4410: 93 07 cpc r25, r19 4412: a1 05 cpc r26, r1 4414: b1 05 cpc r27, r1 4416: 08 f0 brcs .+2 ; 0x441a 4418: 0b c2 rjmp .+1046 ; 0x4830 resistor = ResistorVal[res_num]; 441a: 9b 8b std Y+19, r25 ; 0x13 441c: 8a 8b std Y+18, r24 ; 0x12 // we can check for Inductance, if resistance is below 2100 Ohm for (count=0;count<4;count++) { 441e: 31 2c mov r3, r1 // Try four times (different direction and with delayed counter start) if (count < 2) { 4420: 61 e0 ldi r22, 0x01 ; 1 // first and second pass, direction 1 rpins.pw = Rnum2pins(res_num); // compute the two pinnumbers for resistor res_num 4422: 82 2d mov r24, r2 resistor = ResistorVal[res_num]; // we can check for Inductance, if resistance is below 2100 Ohm for (count=0;count<4;count++) { // Try four times (different direction and with delayed counter start) if (count < 2) { 4424: 63 15 cp r22, r3 4426: 28 f0 brcs .+10 ; 0x4432 // first and second pass, direction 1 rpins.pw = Rnum2pins(res_num); // compute the two pinnumbers for resistor res_num 4428: 0e 94 2f 0b call 0x165e ; 0x165e 442c: b8 2e mov r11, r24 442e: a9 2e mov r10, r25 4430: 03 c0 rjmp .+6 ; 0x4438 // if (res_num == 2) LowPin = TP2; // HighPin = TP3; // if (res_num == 0) HighPin = TP2; } else { // third and fourth pass, direction 2 rpins.pw = Rnum2pins(res_num); // compute the two pinnumbers for resistor res_num 4432: 0e 94 2f 0b call 0x165e ; 0x165e ii = rpins.pb[0]; rpins.pb[0] = rpins.pb[1]; // swap the pins LowPin and HighPin rpins.pb[1] = ii; 4436: 5c 01 movw r10, r24 // if (res_num == 2) HighPin = TP2; } #if (((PIN_RL1 + 1) != PIN_RH1) || ((PIN_RL2 + 1) != PIN_RH2) || ((PIN_RL3 + 1) != PIN_RH3)) HiADC = pgm_read_byte((&PinRLRHADCtab[6])+rpins.pb[1]); // Table of ADC Pins including | TXD_VAL #else HiADC = pgm_read_byte((&PinRLRHADCtab[3])+rpins.pb[1]); // Table of ADC Pins including | TXD_VAL 4438: ea 2d mov r30, r10 443a: f0 e0 ldi r31, 0x00 ; 0 443c: e1 5a subi r30, 0xA1 ; 161 443e: fe 4f sbci r31, 0xFE ; 254 4440: 74 90 lpm r7, Z #endif LoPinR_L = pgm_read_byte(&PinRLRHADCtab[rpins.pb[0]]); //R_L mask for HighPin R_L load 4442: 8b 2d mov r24, r11 4444: 90 e0 ldi r25, 0x00 ; 0 4446: fc 01 movw r30, r24 4448: e4 5a subi r30, 0xA4 ; 164 444a: fe 4f sbci r31, 0xFE ; 254 444c: e4 91 lpm r30, Z //================================================================================== // Measurement of Inductance values R_PORT = 0; // switch R port to GND 444e: 15 b8 out 0x05, r1 ; 5 ADC_PORT = TXD_VAL; // switch ADC-Port to GND 4450: 28 e0 ldi r18, 0x08 ; 8 4452: 28 b9 out 0x08, r18 ; 8 if ((resistor < 240) && ((count & 0x01) == 0)) { 4454: 2a 89 ldd r18, Y+18 ; 0x12 4456: 3b 89 ldd r19, Y+19 ; 0x13 4458: 20 3f cpi r18, 0xF0 ; 240 445a: 31 05 cpc r19, r1 445c: a8 f4 brcc .+42 ; 0x4488 445e: 30 fc sbrc r3, 0 4460: 13 c0 rjmp .+38 ; 0x4488 // we can use PinR_L for measurement mess_r = RR680MI - R_L_VAL; // use only pin output resistance 4462: 00 91 1a 01 lds r16, 0x011A 4466: 10 91 1b 01 lds r17, 0x011B 446a: 00 59 subi r16, 0x90 ; 144 446c: 1a 41 sbci r17, 0x1A ; 26 ADC_DDR = HiADC | (1< 4476: 22 0f add r18, r18 4478: 33 1f adc r19, r19 447a: 0a 94 dec r0 447c: e2 f7 brpl .-8 ; 0x4476 447e: c9 01 movw r24, r18 4480: 88 60 ori r24, 0x08 ; 8 4482: 87 29 or r24, r7 4484: 87 b9 out 0x07, r24 ; 7 4486: 08 c0 rjmp .+16 ; 0x4498 } else { R_DDR = LoPinR_L; // switch R_L resistor port for LowPin to output (GND) 4488: e4 b9 out 0x04, r30 ; 4 ADC_DDR = HiADC | TXD_MSK; // switch HiADC Pin to GND 448a: 87 2d mov r24, r7 448c: 88 60 ori r24, 0x08 ; 8 448e: 87 b9 out 0x07, r24 ; 7 mess_r = RR680MI; // use 680 Ohm and PinR_L for current measurement 4490: 00 91 1a 01 lds r16, 0x011A 4494: 10 91 1b 01 lds r17, 0x011B res_num = ResistorList[0]; if (ResistorVal[res_num] > 21000) return; resistor = ResistorVal[res_num]; // we can check for Inductance, if resistance is below 2100 Ohm for (count=0;count<4;count++) { 4498: 44 e1 ldi r20, 0x14 ; 20 449a: 64 2e mov r6, r20 mess_r = RR680MI; // use 680 Ohm and PinR_L for current measurement } // Look, if we can detect any current for (ii=0;ii<20;ii++) { // wait for current is near zero umax = W10msReadADC(rpins.pb[0]); 449c: 8b 2d mov r24, r11 449e: 0e 94 78 0e call 0x1cf0 ; 0x1cf0 44a2: 4c 01 movw r8, r24 total_r = ReadADC(rpins.pb[1]); 44a4: 8a 2d mov r24, r10 44a6: 0e 94 80 0e call 0x1d00 ; 0x1d00 if ((umax < 2) && (total_r < 2)) break; // low current detected 44aa: 32 e0 ldi r19, 0x02 ; 2 44ac: 83 16 cp r8, r19 44ae: 91 04 cpc r9, r1 44b0: 10 f4 brcc .+4 ; 0x44b6 44b2: 02 97 sbiw r24, 0x02 ; 2 44b4: 10 f0 brcs .+4 ; 0x44ba 44b6: 6a 94 dec r6 R_DDR = LoPinR_L; // switch R_L resistor port for LowPin to output (GND) ADC_DDR = HiADC | TXD_MSK; // switch HiADC Pin to GND mess_r = RR680MI; // use 680 Ohm and PinR_L for current measurement } // Look, if we can detect any current for (ii=0;ii<20;ii++) { 44b8: 89 f7 brne .-30 ; 0x449c umax = W10msReadADC(rpins.pb[0]); total_r = ReadADC(rpins.pb[1]); if ((umax < 2) && (total_r < 2)) break; // low current detected } // setup Analog Comparator ADC_COMP_CONTROL = (1< if ((count & 0x01) == 0 ) { 44ea: 93 2d mov r25, r3 44ec: 91 70 andi r25, 0x01 ; 1 44ee: 99 8b std Y+17, r25 ; 0x11 44f0: 30 fc sbrc r3, 0 44f2: 05 c0 rjmp .+10 ; 0x44fe //first start counter, then start current TCCR1B = (1< } else { //first start current, then start counter with delay //parasitic capacity of coil can cause high current at the beginning ADC_PORT = HiADC; // switch ADC-Port to VCC 44fe: 78 b8 out 0x08, r7 ; 8 #if F_CPU >= 8000000UL wait3us(); // ignore current peak from capacity 4500: 0e 94 46 0e call 0x1c8c ; 0x1c8c #else wdt_reset(); // delay wdt_reset(); // delay #endif TI1_INT_FLAGS = (1< if(timeconstant.w[1] == (F_CPU/100000UL)) { break; //Timeout for Charging, above 0.13 s } } } TCCR1B = (0< timeconstant.w[0]) && (ii & (1< 4534: 13 c0 rjmp .+38 ; 0x455c // Wait, until Input Capture is set ii = TI1_INT_FLAGS; //read Timer flags if (ii & (1< TI1_INT_FLAGS = (1< 454c: e3 cf rjmp .-58 ; 0x4514 } TCCR1B = (0< timeconstant.w[0]) && (ii & (1< // this OV was not counted, but was before the Input Capture TI1_INT_FLAGS = (1< 4570: 4c 01 movw r8, r24 total_r = ReadADC(rpins.pb[1]); 4572: 8a 2d mov r24, r10 4574: 0e 94 80 0e call 0x1d00 ; 0x1d00 if ((umax < 2) && (total_r < 2)) break; // low current detected 4578: 22 e0 ldi r18, 0x02 ; 2 457a: 82 16 cp r8, r18 457c: 91 04 cpc r9, r1 457e: 10 f4 brcc .+4 ; 0x4584 4580: 02 97 sbiw r24, 0x02 ; 2 4582: 10 f0 brcs .+4 ; 0x4588 4584: 7a 94 dec r7 timeconstant.w[1]++; // count one additional OV } ADC_PORT = TXD_VAL; // switch ADC-Port to GND ADCSRA = (1< // #undef CNT_ZERO_42 // #undef CNT_ZERO_720 // #define CNT_ZERO_42 7 // #define CNT_ZERO_720 10 //#endif total_r = (mess_r + resistor + RRpinMI); 4588: 80 90 45 01 lds r8, 0x0145 458c: 90 90 46 01 lds r9, 0x0146 4590: 8a 89 ldd r24, Y+18 ; 0x12 4592: 9b 89 ldd r25, Y+19 ; 0x13 4594: 88 0e add r8, r24 4596: 99 1e adc r9, r25 4598: 80 0e add r8, r16 459a: 91 1e adc r9, r17 // cnt_diff = 0; // if (total_r > 7000) cnt_diff = 1; // if (total_r > 14000) cnt_diff = 2; cnt_diff = total_r / ((14000UL * 8) / (F_CPU/1000000UL)); tmpint = ref_mv_offs; // corrected reference voltage (for C) 459c: 20 91 1c 01 lds r18, 0x011C 45a0: 30 91 1d 01 lds r19, 0x011D if (mess_r < R_L_VAL) { 45a4: 00 39 cpi r16, 0x90 ; 144 45a6: 9a e1 ldi r25, 0x1A ; 26 45a8: 19 07 cpc r17, r25 45aa: b0 f4 brcc .+44 ; 0x45d8 // measurement without 680 Ohm cnt_diff = CNT_ZERO_42; if (timeconstant.dw < 225) { 45ac: 61 ee ldi r22, 0xE1 ; 225 45ae: c6 16 cp r12, r22 45b0: d1 04 cpc r13, r1 45b2: e1 04 cpc r14, r1 45b4: f1 04 cpc r15, r1 45b6: 38 f4 brcc .+14 ; 0x45c6 ukorr = (timeconstant.w[0] / 5) - 20; 45b8: c6 01 movw r24, r12 45ba: 65 e0 ldi r22, 0x05 ; 5 45bc: 70 e0 ldi r23, 0x00 ; 0 45be: 0e 94 75 38 call 0x70ea ; 0x70ea <__udivmodhi4> 45c2: 64 51 subi r22, 0x14 ; 20 45c4: 01 c0 rjmp .+2 ; 0x45c8 } else { ukorr = 25; 45c6: 69 e1 ldi r22, 0x19 ; 25 } tmpint -= (((REF_L_KORR * 10) / 10) + ukorr); 45c8: 28 52 subi r18, 0x28 ; 40 45ca: 31 09 sbc r19, r1 45cc: 26 1b sub r18, r22 45ce: 31 09 sbc r19, r1 45d0: 67 fd sbrc r22, 7 45d2: 33 95 inc r19 // if (total_r > 14000) cnt_diff = 2; cnt_diff = total_r / ((14000UL * 8) / (F_CPU/1000000UL)); tmpint = ref_mv_offs; // corrected reference voltage (for C) if (mess_r < R_L_VAL) { // measurement without 680 Ohm cnt_diff = CNT_ZERO_42; 45d4: 86 e0 ldi r24, 0x06 ; 6 45d6: 09 c0 rjmp .+18 ; 0x45ea //#endif total_r = (mess_r + resistor + RRpinMI); // cnt_diff = 0; // if (total_r > 7000) cnt_diff = 1; // if (total_r > 14000) cnt_diff = 2; cnt_diff = total_r / ((14000UL * 8) / (F_CPU/1000000UL)); 45d8: c4 01 movw r24, r8 45da: 60 eb ldi r22, 0xB0 ; 176 45dc: 76 e3 ldi r23, 0x36 ; 54 45de: 0e 94 75 38 call 0x70ea ; 0x70ea <__udivmodhi4> } tmpint -= (((REF_L_KORR * 10) / 10) + ukorr); } else { // measurement with 680 Ohm resistor // if 680 Ohm resistor is used, use REF_L_KORR for correction cnt_diff += CNT_ZERO_720; 45e2: 87 e0 ldi r24, 0x07 ; 7 45e4: 86 0f add r24, r22 tmpint += REF_L_KORR; 45e6: 28 5d subi r18, 0xD8 ; 216 45e8: 3f 4f sbci r19, 0xFF ; 255 } if (timeconstant.dw > cnt_diff) timeconstant.dw -= cnt_diff; 45ea: 90 e0 ldi r25, 0x00 ; 0 45ec: a0 e0 ldi r26, 0x00 ; 0 45ee: b0 e0 ldi r27, 0x00 ; 0 45f0: 8c 15 cp r24, r12 45f2: 9d 05 cpc r25, r13 45f4: ae 05 cpc r26, r14 45f6: bf 05 cpc r27, r15 45f8: 28 f4 brcc .+10 ; 0x4604 45fa: c8 1a sub r12, r24 45fc: d9 0a sbc r13, r25 45fe: ea 0a sbc r14, r26 4600: fb 0a sbc r15, r27 4602: 03 c0 rjmp .+6 ; 0x460a else timeconstant.dw = 0; 4604: c1 2c mov r12, r1 4606: d1 2c mov r13, r1 4608: 76 01 movw r14, r12 if ((count&0x01) == 1) { 460a: 89 89 ldd r24, Y+17 ; 0x11 460c: 88 23 and r24, r24 460e: 29 f0 breq .+10 ; 0x461a // second pass with delayed counter start timeconstant.dw += (3 * (F_CPU/1000000UL))+10; 4610: 92 e2 ldi r25, 0x22 ; 34 4612: c9 0e add r12, r25 4614: d1 1c adc r13, r1 4616: e1 1c adc r14, r1 4618: f1 1c adc r15, r1 } if (timeconstant.w[1] >= (F_CPU/100000UL)) timeconstant.dw = 0; // no transition found 461a: 60 e5 ldi r22, 0x50 ; 80 461c: e6 16 cp r14, r22 461e: f1 04 cpc r15, r1 4620: 18 f0 brcs .+6 ; 0x4628 4622: c1 2c mov r12, r1 4624: d1 2c mov r13, r1 4626: 76 01 movw r14, r12 if (timeconstant.dw > 10) { 4628: 8b e0 ldi r24, 0x0B ; 11 462a: c8 16 cp r12, r24 462c: d1 04 cpc r13, r1 462e: e1 04 cpc r14, r1 4630: f1 04 cpc r15, r1 4632: 28 f0 brcs .+10 ; 0x463e timeconstant.dw -= 1; 4634: 91 e0 ldi r25, 0x01 ; 1 4636: c9 1a sub r12, r25 4638: d1 08 sbc r13, r1 463a: e1 08 sbc r14, r1 463c: f1 08 sbc r15, r1 } // compute the maximum Voltage umax with the Resistor of the coil umax = ((unsigned long)mess_r * (unsigned long)ADCconfig.U_AVCC) / total_r; 463e: 40 91 33 01 lds r20, 0x0133 4642: 50 91 34 01 lds r21, 0x0134 4646: a1 2c mov r10, r1 4648: b1 2c mov r11, r1 per_ref1 = ((unsigned long)tmpint * 1000) / umax; 464a: a8 ee ldi r26, 0xE8 ; 232 464c: b3 e0 ldi r27, 0x03 ; 3 464e: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 4652: 2b 01 movw r4, r22 4654: 3c 01 movw r6, r24 if (timeconstant.w[1] >= (F_CPU/100000UL)) timeconstant.dw = 0; // no transition found if (timeconstant.dw > 10) { timeconstant.dw -= 1; } // compute the maximum Voltage umax with the Resistor of the coil umax = ((unsigned long)mess_r * (unsigned long)ADCconfig.U_AVCC) / total_r; 4656: 98 01 movw r18, r16 4658: da 01 movw r26, r20 465a: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 465e: a5 01 movw r20, r10 4660: 94 01 movw r18, r8 4662: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> per_ref1 = ((unsigned long)tmpint * 1000) / umax; 4666: 44 27 eor r20, r20 4668: 55 27 eor r21, r21 466a: c3 01 movw r24, r6 466c: b2 01 movw r22, r4 466e: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> // per_ref2 = (uint8_t)MEM2_read_byte(&LogTab[per_ref1]); // -log(1 - per_ref1/100) per_ref2 = get_log(per_ref1); // -log(1 - per_ref1/1000) 4672: c9 01 movw r24, r18 4674: 0e 94 9e 0f call 0x1f3c ; 0x1f3c 4678: fc 01 movw r30, r24 } #endif /* ********************************************************* */ // inductor_lx in 0.01mH units, L = Tau * R per_ref1 = ((per_ref2 * (F_CPU/1000000UL)) + 5) / 10; inductance[count] = (timeconstant.dw * total_r ) / per_ref1; 467a: a5 01 movw r20, r10 467c: 94 01 movw r18, r8 467e: c7 01 movw r24, r14 4680: b6 01 movw r22, r12 4682: 0e 94 65 38 call 0x70ca ; 0x70ca <__mulsi3> 4686: 4b 01 movw r8, r22 4688: 5c 01 movw r10, r24 wait_about2s(); } #endif /* ********************************************************* */ // inductor_lx in 0.01mH units, L = Tau * R per_ref1 = ((per_ref2 * (F_CPU/1000000UL)) + 5) / 10; 468a: bf 01 movw r22, r30 468c: 80 e0 ldi r24, 0x00 ; 0 468e: 90 e0 ldi r25, 0x00 ; 0 4690: 23 e0 ldi r18, 0x03 ; 3 4692: 66 0f add r22, r22 4694: 77 1f adc r23, r23 4696: 88 1f adc r24, r24 4698: 99 1f adc r25, r25 469a: 2a 95 dec r18 469c: d1 f7 brne .-12 ; 0x4692 469e: 6b 5f subi r22, 0xFB ; 251 46a0: 7f 4f sbci r23, 0xFF ; 255 46a2: 8f 4f sbci r24, 0xFF ; 255 46a4: 9f 4f sbci r25, 0xFF ; 255 46a6: 2a e0 ldi r18, 0x0A ; 10 46a8: 30 e0 ldi r19, 0x00 ; 0 46aa: 40 e0 ldi r20, 0x00 ; 0 46ac: 50 e0 ldi r21, 0x00 ; 0 46ae: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> inductance[count] = (timeconstant.dw * total_r ) / per_ref1; 46b2: c5 01 movw r24, r10 46b4: b4 01 movw r22, r8 46b6: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 46ba: 83 2d mov r24, r3 46bc: 90 e0 ldi r25, 0x00 ; 0 46be: e1 e0 ldi r30, 0x01 ; 1 46c0: f0 e0 ldi r31, 0x00 ; 0 46c2: ec 0f add r30, r28 46c4: fd 1f adc r31, r29 46c6: 64 e0 ldi r22, 0x04 ; 4 46c8: 36 9e mul r3, r22 46ca: e0 0d add r30, r0 46cc: f1 1d adc r31, r1 46ce: 11 24 eor r1, r1 46d0: 20 83 st Z, r18 46d2: 31 83 std Z+1, r19 ; 0x01 46d4: 42 83 std Z+2, r20 ; 0x02 46d6: 53 83 std Z+3, r21 ; 0x03 if (((count&0x01) == 0) && (timeconstant.dw > ((F_CPU/1000000UL)+3))) { 46d8: 69 89 ldd r22, Y+17 ; 0x11 46da: 61 11 cpse r22, r1 46dc: 17 c0 rjmp .+46 ; 0x470c 46de: 6c e0 ldi r22, 0x0C ; 12 46e0: c6 16 cp r12, r22 46e2: d1 04 cpc r13, r1 46e4: e1 04 cpc r14, r1 46e6: f1 04 cpc r15, r1 46e8: 88 f0 brcs .+34 ; 0x470c // transition is found, measurement with delayed counter start is not necessary inductance[count+1] = inductance[count]; // set delayed measurement to same value 46ea: fc 01 movw r30, r24 46ec: 31 96 adiw r30, 0x01 ; 1 46ee: ee 0f add r30, r30 46f0: ff 1f adc r31, r31 46f2: ee 0f add r30, r30 46f4: ff 1f adc r31, r31 46f6: 81 e0 ldi r24, 0x01 ; 1 46f8: 90 e0 ldi r25, 0x00 ; 0 46fa: 8c 0f add r24, r28 46fc: 9d 1f adc r25, r29 46fe: e8 0f add r30, r24 4700: f9 1f adc r31, r25 4702: 20 83 st Z, r18 4704: 31 83 std Z+1, r19 ; 0x01 4706: 42 83 std Z+2, r20 ; 0x02 4708: 53 83 std Z+3, r21 ; 0x03 count++; // skip the delayed measurement 470a: 33 94 inc r3 } wdt_reset(); 470c: a8 95 wdr res_num = ResistorList[0]; if (ResistorVal[res_num] > 21000) return; resistor = ResistorVal[res_num]; // we can check for Inductance, if resistance is below 2100 Ohm for (count=0;count<4;count++) { 470e: 33 94 inc r3 4710: 93 e0 ldi r25, 0x03 ; 3 4712: 93 15 cp r25, r3 4714: 08 f0 brcs .+2 ; 0x4718 4716: 84 ce rjmp .-760 ; 0x4420 inductance[count+1] = inductance[count]; // set delayed measurement to same value count++; // skip the delayed measurement } wdt_reset(); } //end for count ADC_PORT = TXD_VAL; // switch ADC Port to GND 4718: 88 e0 ldi r24, 0x08 ; 8 471a: 88 b9 out 0x08, r24 ; 8 wait_about20ms(); 471c: 84 e0 ldi r24, 0x04 ; 4 471e: 0e 94 4a 0e call 0x1c94 ; 0x1c94 nr_pol1 = 0; if (inductance[1] > inductance[0]) { nr_pol1 = 1; } 4722: 21 e0 ldi r18, 0x01 ; 1 4724: 4d 81 ldd r20, Y+5 ; 0x05 4726: 5e 81 ldd r21, Y+6 ; 0x06 4728: 6f 81 ldd r22, Y+7 ; 0x07 472a: 78 85 ldd r23, Y+8 ; 0x08 472c: 89 81 ldd r24, Y+1 ; 0x01 472e: 9a 81 ldd r25, Y+2 ; 0x02 4730: ab 81 ldd r26, Y+3 ; 0x03 4732: bc 81 ldd r27, Y+4 ; 0x04 4734: 84 17 cp r24, r20 4736: 95 07 cpc r25, r21 4738: a6 07 cpc r26, r22 473a: b7 07 cpc r27, r23 473c: 08 f0 brcs .+2 ; 0x4740 473e: 20 e0 ldi r18, 0x00 ; 0 nr_pol2 = 2; if (inductance[3] > inductance[2]) { nr_pol2 = 3; } 4740: 4d 85 ldd r20, Y+13 ; 0x0d 4742: 5e 85 ldd r21, Y+14 ; 0x0e 4744: 6f 85 ldd r22, Y+15 ; 0x0f 4746: 78 89 ldd r23, Y+16 ; 0x10 4748: 89 85 ldd r24, Y+9 ; 0x09 474a: 9a 85 ldd r25, Y+10 ; 0x0a 474c: ab 85 ldd r26, Y+11 ; 0x0b 474e: bc 85 ldd r27, Y+12 ; 0x0c 4750: 84 17 cp r24, r20 4752: 95 07 cpc r25, r21 4754: a6 07 cpc r26, r22 4756: b7 07 cpc r27, r23 4758: 10 f0 brcs .+4 ; 0x475e } //end for count ADC_PORT = TXD_VAL; // switch ADC Port to GND wait_about20ms(); nr_pol1 = 0; if (inductance[1] > inductance[0]) { nr_pol1 = 1; } nr_pol2 = 2; 475a: 32 e0 ldi r19, 0x02 ; 2 475c: 01 c0 rjmp .+2 ; 0x4760 if (inductance[3] > inductance[2]) { nr_pol2 = 3; } 475e: 33 e0 ldi r19, 0x03 ; 3 if (inductance[nr_pol2] < inductance[nr_pol1]) nr_pol1 = nr_pol2; 4760: e2 2f mov r30, r18 4762: f0 e0 ldi r31, 0x00 ; 0 4764: ee 0f add r30, r30 4766: ff 1f adc r31, r31 4768: ee 0f add r30, r30 476a: ff 1f adc r31, r31 476c: 81 e0 ldi r24, 0x01 ; 1 476e: 90 e0 ldi r25, 0x00 ; 0 4770: 8c 0f add r24, r28 4772: 9d 1f adc r25, r29 4774: e8 0f add r30, r24 4776: f9 1f adc r31, r25 4778: dc 01 movw r26, r24 477a: 94 e0 ldi r25, 0x04 ; 4 477c: 39 9f mul r19, r25 477e: a0 0d add r26, r0 4780: b1 1d adc r27, r1 4782: 11 24 eor r1, r1 4784: 4d 91 ld r20, X+ 4786: 5d 91 ld r21, X+ 4788: 6d 91 ld r22, X+ 478a: 7c 91 ld r23, X 478c: 80 81 ld r24, Z 478e: 91 81 ldd r25, Z+1 ; 0x01 4790: a2 81 ldd r26, Z+2 ; 0x02 4792: b3 81 ldd r27, Z+3 ; 0x03 4794: 48 17 cp r20, r24 4796: 59 07 cpc r21, r25 4798: 6a 07 cpc r22, r26 479a: 7b 07 cpc r23, r27 479c: 08 f0 brcs .+2 ; 0x47a0 } wdt_reset(); } //end for count ADC_PORT = TXD_VAL; // switch ADC Port to GND wait_about20ms(); nr_pol1 = 0; 479e: 32 2f mov r19, r18 if (inductance[1] > inductance[0]) { nr_pol1 = 1; } nr_pol2 = 2; if (inductance[3] > inductance[2]) { nr_pol2 = 3; } if (inductance[nr_pol2] < inductance[nr_pol1]) nr_pol1 = nr_pol2; inductor_lx = inductance[nr_pol1]; 47a0: e1 e0 ldi r30, 0x01 ; 1 47a2: f0 e0 ldi r31, 0x00 ; 0 47a4: ec 0f add r30, r28 47a6: fd 1f adc r31, r29 47a8: 24 e0 ldi r18, 0x04 ; 4 47aa: 32 9f mul r19, r18 47ac: e0 0d add r30, r0 47ae: f1 1d adc r31, r1 47b0: 11 24 eor r1, r1 47b2: 80 81 ld r24, Z 47b4: 91 81 ldd r25, Z+1 ; 0x01 47b6: a2 81 ldd r26, Z+2 ; 0x02 47b8: b3 81 ldd r27, Z+3 ; 0x03 47ba: 80 93 0c 01 sts 0x010C, r24 47be: 90 93 0d 01 sts 0x010D, r25 47c2: a0 93 0e 01 sts 0x010E, r26 47c6: b0 93 0f 01 sts 0x010F, r27 inductor_lpre = -5; // 10 uH units if (((nr_pol1 & 1) == 1) || (resistor >= 240)) { 47ca: 30 fd sbrc r19, 0 47cc: 09 c0 rjmp .+18 ; 0x47e0 47ce: 2a 89 ldd r18, Y+18 ; 0x12 47d0: 3b 89 ldd r19, Y+19 ; 0x13 47d2: 20 3f cpi r18, 0xF0 ; 240 47d4: 31 05 cpc r19, r1 47d6: 20 f4 brcc .+8 ; 0x47e0 if (inductance[1] > inductance[0]) { nr_pol1 = 1; } nr_pol2 = 2; if (inductance[3] > inductance[2]) { nr_pol2 = 3; } if (inductance[nr_pol2] < inductance[nr_pol1]) nr_pol1 = nr_pol2; inductor_lx = inductance[nr_pol1]; inductor_lpre = -5; // 10 uH units 47d8: 8b ef ldi r24, 0xFB ; 251 47da: 80 93 02 01 sts 0x0102, r24 47de: 17 c0 rjmp .+46 ; 0x480e if (((nr_pol1 & 1) == 1) || (resistor >= 240)) { // with 680 Ohm resistor total_r is more than 7460 inductor_lpre = -4; // 100 uH units 47e0: 2c ef ldi r18, 0xFC ; 252 47e2: 20 93 02 01 sts 0x0102, r18 inductor_lx = (inductor_lx + 5) / 10; 47e6: bc 01 movw r22, r24 47e8: cd 01 movw r24, r26 47ea: 6b 5f subi r22, 0xFB ; 251 47ec: 7f 4f sbci r23, 0xFF ; 255 47ee: 8f 4f sbci r24, 0xFF ; 255 47f0: 9f 4f sbci r25, 0xFF ; 255 47f2: 2a e0 ldi r18, 0x0A ; 10 47f4: 30 e0 ldi r19, 0x00 ; 0 47f6: 40 e0 ldi r20, 0x00 ; 0 47f8: 50 e0 ldi r21, 0x00 ; 0 47fa: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 47fe: 20 93 0c 01 sts 0x010C, r18 4802: 30 93 0d 01 sts 0x010D, r19 4806: 40 93 0e 01 sts 0x010E, r20 480a: 50 93 0f 01 sts 0x010F, r21 } if (inductor_lx == 0) inductor_lpre = 0; //mark as zero 480e: 80 91 0c 01 lds r24, 0x010C 4812: 90 91 0d 01 lds r25, 0x010D 4816: a0 91 0e 01 lds r26, 0x010E 481a: b0 91 0f 01 lds r27, 0x010F 481e: 89 2b or r24, r25 4820: 8a 2b or r24, r26 4822: 8b 2b or r24, r27 4824: 11 f4 brne .+4 ; 0x482a 4826: 10 92 02 01 sts 0x0102, r1 // switch all ports to input ADC_DDR = TXD_MSK; // switch all ADC ports to input 482a: 88 e0 ldi r24, 0x08 ; 8 482c: 87 b9 out 0x07, r24 ; 7 R_DDR = 0; // switch all resistor ports to input 482e: 14 b8 out 0x04, r1 ; 4 #endif return; } // end ReadInductance() 4830: 63 96 adiw r28, 0x13 ; 19 4832: e2 e1 ldi r30, 0x12 ; 18 4834: 0c 94 59 39 jmp 0x72b2 ; 0x72b2 <__epilogue_restores__> 00004838 : #define EXTRA_DELAY2PULSE wait3us /* current begin after last ADCready: 2.25us (wakeup) + 13us + 6tics = 16.0 us */ /* half puls length = (20us - 16.0 us) = 4.0 us (PL= 8.0 us) */ call wait5us; call wait2us; /* pulse length 7us + 2 clock tics (CALL instead of RCALL) = 7.25 us @ 8 MHz */ push r24; /* 7.5 us */ 4838: 2f 92 push r2 pop r24; /* 7.75 us */ 483a: 3f 92 push r3 wdr ; 483c: 4f 92 push r4 wdr ; /* 8.0 us */ 483e: 5f 92 push r5 #endif 4840: 6f 92 push r6 #endif 4842: 7f 92 push r7 #if F_CPU == 16000000UL 4844: 8f 92 push r8 #ifdef ESR_LONG_PULSE 4846: 9f 92 push r9 // SH at 2.5 ADC clocks behind start = 20 us 4848: af 92 push r10 call wait20us; // SH at 2.5 ADC clocks behind start = 20 us 484a: bf 92 push r11 /* current begin after last ADCready: 1.125us (wakeup) + 5us + 5tics = 6.4375us */ 484c: cf 92 push r12 /* half puls length = (20us - 6.4375us) = 13.5625us (PL=27.125us) */ 484e: df 92 push r13 call wait5us 4850: ef 92 push r14 call wait1us; /* pulse length 26us + 3 clock tics (CALL instead of RCALL) = 26.1875 us */ 4852: ff 92 push r15 push r24; /* 26.3125 us */ 4854: 0f 93 push r16 pop r24; /* 26.4375 us */ 4856: 1f 93 push r17 push r24; /* 26.5625 us */ 4858: df 93 push r29 pop r24; /* 26.6875 us */ 485a: cf 93 push r28 #else /* no ESR_LONG_PULSE, 16MHz, interrupt mode */ 485c: cd b7 in r28, 0x3d ; 61 #if PROCESSOR_TYP == 1280 485e: de b7 in r29, 0x3e ; 62 #define EXTRA_DELAY2PULSE wait4us 4860: 6e 97 sbiw r28, 0x1e ; 30 /* current begin after last ADCready: 1.25us (wakeup) + 14us + 10tics = 15.875 us */ 4862: 0f b6 in r0, 0x3f ; 63 /* half puls length = (20us - 15.5 us) = 4.125 us (PL=8.25 us) */ 4864: f8 94 cli /* adjusted for mega2560 */ 4866: de bf out 0x3e, r29 ; 62 call wait5us 4868: 0f be out 0x3f, r0 ; 63 call wait3us; /* pulse length 8us + 2 clock tics (CALL instead of RCALL) = 8.125 us */ 486a: cd bf out 0x3d, r28 ; 61 wdr ; /* 8.1875 us */ wdr ; /* 8.25 us */ wdr ; /* 8.3125 us */ 486c: 66 2e mov r6, r22 #else 486e: b8 2e mov r11, r24 #define EXTRA_DELAY2PULSE wait4us 4870: 86 0f add r24, r22 /* current begin after last ADCready: 1.125us (wakeup) + 14us + 6tics = 15.5 us */ 4872: 89 83 std Y+1, r24 ; 0x01 /* half puls length = (20us - 15.5 us) = 4.5 us (PL=9.0 us) */ call wait5us 4874: 20 91 20 01 lds r18, 0x0120 call wait3us; /* pulse length 8us + 3 clock tics (CALL instead of RCALL) = 8.1875 us */ 4878: 27 30 cpi r18, 0x07 ; 7 push r24; /* 8.3125 us */ pop r24; /* 8.4375 us */ 487a: 41 f5 brne .+80 ; 0x48cc push r24; /* 8.5625 us */ 487c: 20 91 83 01 lds r18, 0x0183 pop r24; /* 8.6875 us */ 4880: 30 91 84 01 lds r19, 0x0184 push r24; /* 8.8125 us */ 4884: 40 91 85 01 lds r20, 0x0185 pop r24; /* 8.9375 us */ 4888: 50 91 86 01 lds r21, 0x0186 wdr ; /* 9.0 us */ 488c: 10 91 92 01 lds r17, 0x0192 #endif 4890: 09 c0 rjmp .+18 ; 0x48a4 00004892 : #endif /* ESR_LONG_PULSE */ #endif /* 16 MHz */ 4892: ca 01 movw r24, r20 4894: b9 01 movw r22, r18 #else /* Polling mode: lds,sbrc,sts and out Instructions are 7 clock tics */ 4896: 2a e0 ldi r18, 0x0A ; 10 #if F_CPU == 8000000UL 4898: 31 2d mov r19, r1 #ifdef ESR_LONG_PULSE 489a: 41 2d mov r20, r1 // SH at 2.5 ADC clocks behind start = 20 us 489c: 51 2d mov r21, r1 call wait20us; // SH at 2.5 ADC clocks behind start = 20 us 489e: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> /* current begin after last ADCready: 0.875us (loop) + 5us + 5tics = 6.5us */ 48a2: 1f 5f subi r17, 0xFF ; 255 000048a4 : /* half puls length = (20us - 6.5us) = 13.5us (PL=27us) */ call wait5us call wait1us; 48a4: 17 3f cpi r17, 0xF7 ; 247 /* pulse length 26us + 3 clock tics (CALL instead of RCALL) = 26.375 us @ 8 MHz */ 48a6: ac f3 brlt .-22 ; 0x4892 #define EXTRA_DELAY2PULSE wait4us /* current begin after last ADCready: 0.875us (loop) + 14us + 6tics = 15.625us */ /* half puls length = (20us - 15.625us) = 4.375us (PL=8.75us) */ call wait5us call wait3us; /* pulse length 8us + 2 clock tics (CALL instead of RCALL) = 8.25 us @ 8 MHz */ 48a8: 2a 35 cpi r18, 0x5A ; 90 wdr ; /* 8.375 us */ 48aa: 60 e0 ldi r22, 0x00 ; 0 wdr ; /* 8.5 us */ wdr ; /* 8.625 us */ 48ac: 36 07 cpc r19, r22 wdr ; /* 8.75 us */ 48ae: 41 05 cpc r20, r1 #endif /* ESR_LONG_PULSE */ 48b0: 51 05 cpc r21, r1 #endif /* F_CPU == 8000000UL */ 48b2: 18 f4 brcc .+6 ; 0x48ba #if F_CPU == 16000000UL 48b4: 8f ef ldi r24, 0xFF ; 255 // SH at 2.5 ADC clocks behind start = 20 us 48b6: 9f ef ldi r25, 0xFF ; 255 #ifdef ESR_LONG_PULSE 48b8: 82 c1 rjmp .+772 ; 0x4bbe 000048ba : call wait20us; // SH at 2.5 ADC clocks behind start = 20 us /* current begin after last ADCready: 0.4375us (loop) + 5us + 5tics = 5.75us */ 48ba: 17 3f cpi r17, 0xF7 ; 247 /* half puls length = (20us - 5.75us) = 14.25us (PL=28.5us) */ 48bc: 39 f4 brne .+14 ; 0x48cc call wait5us 48be: 80 e0 ldi r24, 0x00 ; 0 call wait3us; 48c0: 28 17 cp r18, r24 /* pulse length 28us + 3 clock tics (CALL instead of RCALL) = 28.1875 us */ 48c2: 8d e7 ldi r24, 0x7D ; 125 push r24; /* 28.3125 us */ 48c4: 38 07 cpc r19, r24 pop r24; /* 28.4375 us */ wdr ; /* 28.50 us */ #else /* no ESR_LONG_PULSE, 16Mhz, polling mode */ 48c6: 41 05 cpc r20, r1 #if PROCESSOR_TYP == 1280 /* For the mega2560 processor the call / ret instructions take one cycle more. */ /* Additionally the STS instruction is used instead of the out instruction for R_PORT and R_DDR. */ 48c8: 41 05 cpc r20, r1 #define EXTRA_DELAY2PULSE wait5us 48ca: 10 f0 brcs .+4 ; 0x48d0 000048cc : /* current begin after last ADCready: 0.4375us (loop) + 15us + 10tics = 16.0625us */ /* half puls length = (20us - 16.0625us) = 3.9375us (PL=7.875us) */ 48cc: 20 e0 ldi r18, 0x00 ; 0 /* adjusted for mega2560 */ 48ce: 3d e7 ldi r19, 0x7D ; 125 000048d0 : call wait5us /* 5.125 us */ call wait2us; /* 7.25 us */ push r24; /* 7.375 us */ pop r24; /* 7.50 us */ 48d0: 2c 8b std Y+20, r18 ; 0x14 push r24; /* 7.625 us */ 48d2: 3d 8b std Y+21, r19 ; 0x15 /* normal ADC-speed, ADC-Clock 8us */ ldi r25, (1< 000048da : #ifdef ADC_Sleep_Mode ldi r25, (1<: ad_3604: #if (((PIN_RL1 + 1) != PIN_RH1) || ((PIN_RL2 + 1) != PIN_RH2) || ((PIN_RL3 + 1) != PIN_RH3)) LDIZ PinRLRHADCtab+6; /* LoADC = pgm_read_byte((&PinRLRHADCtab[6])+cap.ca) | TXD_MSK; */ #else LDIZ PinRLRHADCtab+3; /* LoADC = pgm_read_byte((&PinRLRHADCtab[3])+cap.ca) | TXD_MSK; */ 48de: ef e5 ldi r30, 0x5F ; 95 48e0: f1 e0 ldi r31, 0x01 ; 1 #endif add r30, SelectLowPin; 48e2: e6 0d add r30, r6 adc r31, zero_reg; 48e4: f1 1d adc r31, r1 lpm r24, Z+; 48e6: 85 91 lpm r24, Z+ ori r24, TXD_MSK; 48e8: 88 60 ori r24, 0x08 ; 8 std Y+LoADC, r24; 48ea: 8e 87 std Y+14, r24 ; 0x0e #if (((PIN_RL1 + 1) != PIN_RH1) || ((PIN_RL2 + 1) != PIN_RH2) || ((PIN_RL3 + 1) != PIN_RH3)) LDIZ PinRLRHADCtab+6; /* HiADC = pgm_read_byte((&PinRLRHADCtab[6])+cap.cb) | TXD_MSK; */ #else LDIZ PinRLRHADCtab+3; /* HiADC = pgm_read_byte((&PinRLRHADCtab[3])+cap.cb) | TXD_MSK; */ 48ec: ef e5 ldi r30, 0x5F ; 95 48ee: f1 e0 ldi r31, 0x01 ; 1 #endif add r30, SelectHighPin; 48f0: eb 0d add r30, r11 adc r31, zero_reg; 48f2: f1 1d adc r31, r1 lpm r24, Z+; 48f4: 85 91 lpm r24, Z+ ori r24, TXD_MSK; 48f6: 88 60 ori r24, 0x08 ; 8 std Y+HiADC, r24; 48f8: 8f 87 std Y+15, r24 ; 0x0f LDIZ PinRLRHADCtab; /* LoPinR_L = pgm_read_byte(&PinRLRHADCtab[cap.ca]); //R_L mask for LowPin R_L load */ 48fa: ec e5 ldi r30, 0x5C ; 92 48fc: f1 e0 ldi r31, 0x01 ; 1 add r30, SelectLowPin; 48fe: e6 0d add r30, r6 adc r31, zero_reg; 4900: f1 1d adc r31, r1 lpm LoPinR_L, Z+; 4902: 75 90 lpm r7, Z+ LDIZ PinRLRHADCtab; /* HiPinR_L = pgm_read_byte(&PinRLRHADCtab[cap.cb]); //R_L mask for HighPin R_L load */ 4904: ec e5 ldi r30, 0x5C ; 92 4906: f1 e0 ldi r31, 0x01 ; 1 add r30, SelectHighPin; 4908: eb 0d add r30, r11 adc r31, zero_reg; 490a: f1 1d adc r31, r1 lpm HiPinR_L, Z+; 490c: c5 90 lpm r12, Z+ or SelectLowPin, r25; // SelectHighPin = (cap.cb | (1< ldi r24, TXD_VAL; 493a: 88 e0 ldi r24, 0x08 ; 8 AOUT ADC_PORT, r24; /* ADC_PORT = TXD_VAL; // switch ADC-Port to GND */ 493c: 88 b9 out 0x08, r24 ; 8 sts ADMUX, SelectLowPin; /* ADMUX = SelectLowPin; // set Mux input and Voltage Reference to internal 1.1V */ 493e: 60 92 7c 00 sts 0x007C, r6 #ifdef NO_AREF_CAP call wait100us; /* time for voltage stabilization */ 4942: 0e 94 3e 0e call 0x1c7c ; 0x1c7c #else call wait10ms; /* time for voltage stabilization with 100nF */ #endif /* start voltage should be negativ */ ldd r19, Y+HiADC; /* ADC_DDR = HiADC; // switch High Pin to GND */ 4946: 3f 85 ldd r19, Y+15 ; 0x0f AOUT ADC_DDR, r19; /* switch High Pin to GND */ 4948: 37 b9 out 0x07, r19 ; 7 AOUT R_PORT, LoPinR_L 494a: 75 b8 out 0x05, r7 ; 5 AOUT R_DDR, LoPinR_L 494c: 74 b8 out 0x04, r7 ; 4 #endif #else call wait2us; #endif #else call wait4us; /* Delay about half the current puls-length of measurement loop */ 494e: 0e 94 45 0e call 0x1c8a ; 0x1c8a #endif AOUT R_DDR, zero_reg; /* R_DDR = 0 */ 4952: 14 b8 out 0x04, r1 ; 4 AOUT R_PORT, zero_reg; /* R_PORT = 0 */ 4954: 15 b8 out 0x05, r1 ; 5 // Measurement frequency is given by sum of ADC-Reads < 1116 Hz for normal ADC speed. // ADC Sample and Hold (SH) is done 1.5 ADC clock number after real start of conversion. // Real ADC-conversion is started with the next ADC-Clock (125kHz) after setting the ADSC bit. eor r13, r13; /* for(ii=0;ii: /* ********* Forward direction, connect Low side with GND *********** */ esr_loop: ldd r19, Y+LoADC; 4960: 3e 85 ldd r19, Y+14 ; 0x0e AOUT ADC_DDR, r19; /* ADC_DDR = LoADC; // switch Low-Pin to output (GND) */ 4962: 37 b9 out 0x07, r19 ; 7 AOUT R_PORT, LoPinR_L; /* R_PORT = LoPinR_L */ 4964: 75 b8 out 0x05, r7 ; 5 AOUT R_DDR, LoPinR_L; /* R_DDR = LoPinR_L */ 4966: 74 b8 out 0x04, r7 ; 4 sts ADMUX, SelectLowPin; /* ADMUX = SelectLowPin; */ 4968: 60 92 7c 00 sts 0x007C, r6 wdr ; /* wdt_reset(); */ 496c: a8 95 wdr StartADCwait /* start ADC and wait */ 496e: a0 92 7a 00 sts 0x007A, r10 4972: 80 91 7a 00 lds r24, 0x007A 4976: 86 fd sbrc r24, 6 4978: fc cf rjmp .-8 ; 0x4972 StartADCwait /* start ADC and wait */ 497a: a0 92 7a 00 sts 0x007A, r10 497e: 80 91 7a 00 lds r24, 0x007A 4982: 86 fd sbrc r24, 6 4984: fc cf rjmp .-8 ; 0x497e lds adcv0L, ADCW; /* adcv[0] = ADCW; // Voltage LowPin reference */ 4986: 20 90 78 00 lds r2, 0x0078 lds adcv0H, ADCW+1; 498a: 30 90 79 00 lds r3, 0x0079 sts ADMUX, SelectHighPin; /* ADMUX = SelectHighPin; */ 498e: b0 92 7c 00 sts 0x007C, r11 StartADCwait /* start ADC and wait */ 4992: a0 92 7a 00 sts 0x007A, r10 4996: 80 91 7a 00 lds r24, 0x007A 499a: 86 fd sbrc r24, 6 499c: fc cf rjmp .-8 ; 0x4996 // Start Conversion, real start is next rising edge of ADC clock sts ADCSRA, r8; /* ADCSRA = (1< call EXTRA_DELAY2PULSE; 49a6: 0e 94 45 0e call 0x1c8a ; 0x1c8a #endif AOUT R_PORT, HiPinR_L; /* R_PORT = HiPinR_L; // switch R-Port to VCC */ 49aa: c5 b8 out 0x05, r12 ; 5 AOUT R_DDR, HiPinR_L; /* R_DDR = HiPinR_L; // switch R_L port for HighPin to output (VCC) */ 49ac: c4 b8 out 0x04, r12 ; 4 wdr ; /* 27.0 us */ wdr ; /* 27.125 us */ #else /* no ESR_LONG_PULSE, 8MHz, polling mode */ #define EXTRA_DELAY2PULSE wait4us /* current begin after last ADCready: 0.875us (loop) + 14us + 6tics = 15.625us */ /* half puls length = (20us - 15.625us) = 4.375us (PL=8.75us) */ 49ae: 0e 94 44 0e call 0x1c88 ; 0x1c88 49b2: 0e 94 46 0e call 0x1c8c ; 0x1c8c 49b6: a8 95 wdr 49b8: a8 95 wdr 49ba: a8 95 wdr 49bc: a8 95 wdr call EXTRA_DELAY2PULSE; #endif AOUT R_PORT, HiPinR_L; /* R_PORT = HiPinR_L; // switch R-Port to VCC */ AOUT R_DDR, HiPinR_L; /* R_DDR = HiPinR_L; // switch R_L port for HighPin to output (VCC) */ DelayBigCap; /* wait the time defined by macro */ AOUT R_DDR, zero_reg; /* R_DDR = 0; // switch current off, SH is 1.5 ADC clock behind real start */ 49be: 14 b8 out 0x04, r1 ; 4 AOUT R_PORT, zero_reg; /* R_PORT = 0; */ 49c0: 15 b8 out 0x05, r1 ; 5 000049c2 : ad_370c: lds r24, ADCSRA; /* while (ADCSRA&(1< lds r18, ADCW; /* adcv[1] = ADCW; // Voltage HighPin with current */ 49ca: 20 91 78 00 lds r18, 0x0078 lds r19, ADCW+1; 49ce: 30 91 79 00 lds r19, 0x0079 // sumvolt0 += adcv[0]; // add sum of both LowPin voltages with current // adcv0 = r2/r3 // sumvolt1 += adcv[1]; // add HighPin voltages with current // adcv1 = r18/r19 std Y+adcvv1, r18; 49d2: 28 8b std Y+16, r18 ; 0x10 std Y+adcvv1+1, r19; 49d4: 39 8b std Y+17, r19 ; 0x11 /* ********* Reverse direction, connect High side with GND *********** */ ldd r19, Y+HiADC; /* ADC_DDR = HiADC; // switch High Pin to GND */ 49d6: 3f 85 ldd r19, Y+15 ; 0x0f AOUT ADC_DDR, r19; /* ADC_DDR = HiADC; // switch High-Pin to output (GND) */ 49d8: 37 b9 out 0x07, r19 ; 7 AOUT R_PORT, HiPinR_L; /* R_PORT = HiPinR_L; // switch R-Port to VCC */ 49da: c5 b8 out 0x05, r12 ; 5 AOUT R_DDR, HiPinR_L; /* R_DDR = HiPinR_L; // switch R_L port for HighPin to output (VCC) */ 49dc: c4 b8 out 0x04, r12 ; 4 wdr ; /* wdt_reset(); */ 49de: a8 95 wdr sts ADMUX, SelectHighPin; /* ADMUX = SelectHighPin; */ 49e0: b0 92 7c 00 sts 0x007C, r11 StartADCwait /* start ADC and wait */ 49e4: a0 92 7a 00 sts 0x007A, r10 49e8: 80 91 7a 00 lds r24, 0x007A 49ec: 86 fd sbrc r24, 6 49ee: fc cf rjmp .-8 ; 0x49e8 StartADCwait /* start ADC and wait */ 49f0: a0 92 7a 00 sts 0x007A, r10 49f4: 80 91 7a 00 lds r24, 0x007A 49f8: 86 fd sbrc r24, 6 49fa: fc cf rjmp .-8 ; 0x49f4 lds r22, ADCW; /* adcv[2] = ADCW; // Reverse Reference Voltage HighPin */ 49fc: 60 91 78 00 lds r22, 0x0078 lds r23, ADCW+1; 4a00: 70 91 79 00 lds r23, 0x0079 sts ADMUX, SelectLowPin; /* ADMUX = SelectLowPin; */ 4a04: 60 92 7c 00 sts 0x007C, r6 // ****** Polling mode big cap StartADCwait /* start ADC and wait */ 4a08: a0 92 7a 00 sts 0x007A, r10 4a0c: 80 91 7a 00 lds r24, 0x007A 4a10: 86 fd sbrc r24, 6 4a12: fc cf rjmp .-8 ; 0x4a0c sts ADCSRA, r8; /* ADCSRA = (1< call EXTRA_DELAY2PULSE; 4a1c: 0e 94 45 0e call 0x1c8a ; 0x1c8a #endif AOUT R_PORT, LoPinR_L; /* R_PORT = LoPinR_L; */ 4a20: 75 b8 out 0x05, r7 ; 5 AOUT R_DDR, LoPinR_L; /* R_DDR = LoPinR_L; // switch LowPin with 680 Ohm to VCC */ 4a22: 74 b8 out 0x04, r7 ; 4 wdr ; /* 27.0 us */ wdr ; /* 27.125 us */ #else /* no ESR_LONG_PULSE, 8MHz, polling mode */ #define EXTRA_DELAY2PULSE wait4us /* current begin after last ADCready: 0.875us (loop) + 14us + 6tics = 15.625us */ /* half puls length = (20us - 15.625us) = 4.375us (PL=8.75us) */ 4a24: 0e 94 44 0e call 0x1c88 ; 0x1c88 4a28: 0e 94 46 0e call 0x1c8c ; 0x1c8c 4a2c: a8 95 wdr 4a2e: a8 95 wdr 4a30: a8 95 wdr 4a32: a8 95 wdr AOUT R_PORT, LoPinR_L; /* R_PORT = LoPinR_L; */ AOUT R_DDR, LoPinR_L; /* R_DDR = LoPinR_L; // switch LowPin with 680 Ohm to VCC */ DelayBigCap; /* wait the time defined by macro */ /* } */ AOUT R_DDR, zero_reg; // switch current off, SH is 1.5 ADC clock ticks behind real start 4a34: 14 b8 out 0x04, r1 ; 4 AOUT R_PORT, zero_reg; 4a36: 15 b8 out 0x05, r1 ; 5 00004a38 : ad_37f4: lds r24, ADCSRA; /* while (ADCSRA&(1< lds r20, ADCW; /* adcv[3] = ADCW; // Voltage LowPin with current */ 4a40: 40 91 78 00 lds r20, 0x0078 lds r21, ADCW+1; 4a44: 50 91 79 00 lds r21, 0x0079 #ifdef ADC_Sleep_Mode sts ADCSRA, StartADCmsk; /* ADCSRA = StartADCmsk; // enable ADC and Interrupt */ #endif AOUT R_DDR, zero_reg; /* R_DDR = 0; // switch current off */ 4a48: 14 b8 out 0x04, r1 ; 4 movw r24, r22; /* adcv[2] */ 4a4a: cb 01 movw r24, r22 add r24, adcv0L; /* adcv[0] + adcv[2] // add sum of both LowPin voltages with current */ 4a4c: 82 0d add r24, r2 adc r25, adcv0H; 4a4e: 93 1d adc r25, r3 add r14, r24; /* r14:17 = sumvolt0 += (adcv[0] + adcv[2]); */ 4a50: e8 0e add r14, r24 adc r15, r25; 4a52: f9 1e adc r15, r25 adc r16, zero_reg; 4a54: 01 1d adc r16, r1 adc r17, zero_reg; 4a56: 11 1d adc r17, r1 std Y+sumvolt0, r14; 4a58: ea 82 std Y+2, r14 ; 0x02 std Y+sumvolt0+1, r15; 4a5a: fb 82 std Y+3, r15 ; 0x03 std Y+sumvolt0+2, r16; 4a5c: 0c 83 std Y+4, r16 ; 0x04 std Y+sumvolt0+3, r17; 4a5e: 1d 83 std Y+5, r17 ; 0x05 ldd r24, Y+adcvv1; /* add HighPin voltages with current */ 4a60: 88 89 ldd r24, Y+16 ; 0x10 ldd r25, Y+adcvv1+1; 4a62: 99 89 ldd r25, Y+17 ; 0x11 add r24, r20; /* adcv[1] + adcv[3] */ 4a64: 84 0f add r24, r20 adc r25, r21; 4a66: 95 1f adc r25, r21 ldd r18, Y+sumvolt1; /* sumvolt1 += (adcv[1] + adcv[3]); */ 4a68: 2e 81 ldd r18, Y+6 ; 0x06 ldd r19, Y+sumvolt1+1; 4a6a: 3f 81 ldd r19, Y+7 ; 0x07 ldd r22, Y+sumvolt1+2; 4a6c: 68 85 ldd r22, Y+8 ; 0x08 ldd r23, Y+sumvolt1+3; 4a6e: 79 85 ldd r23, Y+9 ; 0x09 add r18, r24; 4a70: 28 0f add r18, r24 adc r19, r25; 4a72: 39 1f adc r19, r25 adc r22, zero_reg; 4a74: 61 1d adc r22, r1 adc r23, zero_reg; 4a76: 71 1d adc r23, r1 std Y+sumvolt1, r18; 4a78: 2e 83 std Y+6, r18 ; 0x06 std Y+sumvolt1+1, r19; 4a7a: 3f 83 std Y+7, r19 ; 0x07 std Y+sumvolt1+2, r22; 4a7c: 68 87 std Y+8, r22 ; 0x08 std Y+sumvolt1+3, r23; 4a7e: 79 87 std Y+9, r23 ; 0x09 /* Y+adcvv1 is still the voltage of forward direction, r20:21 the voltage of reverse direction */ ldi r18, lo8(50); 4a80: 22 e3 ldi r18, 0x32 ; 50 cp r18, r20; 4a82: 24 17 cp r18, r20 cpc zero_reg, r21; 4a84: 15 06 cpc r1, r21 brcs is_ok1; /* r20:21 >= 50 */ 4a86: 50 f0 brcs .+20 ; 0x4a9c AOUT R_PORT, LoPinR_L; /* R_PORT = LoPinR_L; */ 4a88: 75 b8 out 0x05, r7 ; 5 AOUT R_DDR, LoPinR_L; /* R_DDR = LoPinR_L; // switch LowPin with 680 Ohm to VCC */ 4a8a: 74 b8 out 0x04, r7 ; 4 call wait1us; /* additional charge the capacitor */ 4a8c: 0e 94 48 0e call 0x1c90 ; 0x1c90 AOUT R_DDR, zero_reg; // switch current off 4a90: 14 b8 out 0x04, r1 ; 4 AOUT R_PORT, zero_reg; 4a92: 15 b8 out 0x05, r1 ; 5 ldd r24, Y+LowUpCount; /* count additional load pulses at Low side */ 4a94: 88 8d ldd r24, Y+24 ; 0x18 inc r24; 4a96: 83 95 inc r24 std Y+LowUpCount, r24; 4a98: 88 8f std Y+24, r24 ; 0x18 rjmp is_ok1b; 4a9a: 07 c0 rjmp .+14 ; 0x4aaa 00004a9c : is_ok1: cpi r20, lo8(1000); 4a9c: 48 3e cpi r20, 0xE8 ; 232 ldi r23, hi8(1000); 4a9e: 73 e0 ldi r23, 0x03 ; 3 cpc r21, r23; 4aa0: 57 07 cpc r21, r23 brcs is_ok1b; /* voltage reverse direction < 1000 */ 4aa2: 18 f0 brcs .+6 ; 0x4aaa ldd r24, Y+LowTooHigh; /* count pulses with too high voltage at Low side */ 4aa4: 8a 8d ldd r24, Y+26 ; 0x1a inc r24; 4aa6: 83 95 inc r24 std Y+LowTooHigh, r24; 4aa8: 8a 8f std Y+26, r24 ; 0x1a 00004aaa : is_ok1b: ldd r24, Y+adcvv1; 4aaa: 88 89 ldd r24, Y+16 ; 0x10 ldd r25, Y+adcvv1+1; 4aac: 99 89 ldd r25, Y+17 ; 0x11 cp r18, r24; 4aae: 28 17 cp r18, r24 cpc zero_reg, r25; /* adcvv1 >= 50 */ 4ab0: 19 06 cpc r1, r25 brcs is_ok2; 4ab2: 60 f0 brcs .+24 ; 0x4acc ldd r19, Y+LoADC; 4ab4: 3e 85 ldd r19, Y+14 ; 0x0e AOUT ADC_DDR, r19; /* ADC_DDR = LoADC; // switch Low-Pin to output (GND) */ 4ab6: 37 b9 out 0x07, r19 ; 7 AOUT R_PORT, HiPinR_L; /* R_PORT = HiPinR_L; // switch R-Port to VCC */ 4ab8: c5 b8 out 0x05, r12 ; 5 AOUT R_DDR, HiPinR_L; /* R_DDR = HiPinR_L; // switch R_L port for HighPin to output (VCC) */ 4aba: c4 b8 out 0x04, r12 ; 4 call wait1us; /* additional charge the capacitor */ 4abc: 0e 94 48 0e call 0x1c90 ; 0x1c90 ;## DelayBigCap; /* wait the time defined by macro */ AOUT R_DDR, zero_reg; /* R_DDR = 0; // switch current off, SH is 1.5 ADC clock behind real start */ 4ac0: 14 b8 out 0x04, r1 ; 4 AOUT R_PORT, zero_reg; /* R_PORT = 0; */ 4ac2: 15 b8 out 0x05, r1 ; 5 ldd r24, Y+HighUpCount; /* count additional load pulses at High side */ 4ac4: 89 8d ldd r24, Y+25 ; 0x19 inc r24; 4ac6: 83 95 inc r24 std Y+HighUpCount, r24; 4ac8: 89 8f std Y+25, r24 ; 0x19 rjmp is_ok2b; 4aca: 07 c0 rjmp .+14 ; 0x4ada 00004acc : is_ok2: cpi r24, lo8(1000); 4acc: 88 3e cpi r24, 0xE8 ; 232 ldi r23, hi8(1000); 4ace: 73 e0 ldi r23, 0x03 ; 3 cpc r25, r23; 4ad0: 97 07 cpc r25, r23 brcs is_ok2b; /* voltage forward direction < 1000 */ 4ad2: 18 f0 brcs .+6 ; 0x4ada ldd r24, Y+HighTooHigh; /* count pulses with too high voltage at High side */ 4ad4: 8b 8d ldd r24, Y+27 ; 0x1b inc r24; 4ad6: 83 95 inc r24 std Y+HighTooHigh, r24; 4ad8: 8b 8f std Y+27, r24 ; 0x1b 00004ada : is_ok2b: inc r13; /* for( ;ii rjmp esr_loop; /* } // end for */ 4ae2: 3e cf rjmp .-388 ; 0x4960 00004ae4 : #if RRpinMI == PIN_RM ldi r18, lo8(RRpinMI*10); ldi r19, hi8(RRpinMI*10); #else lds r4, RRpinMI; 4ae4: 40 90 45 01 lds r4, 0x0145 lds r5, RRpinMI+1; 4ae8: 50 90 46 01 lds r5, 0x0146 add r4, r4; RRpinMI*2 4aec: 44 0c add r4, r4 adc r5, r5; 4aee: 55 1c adc r5, r5 movw r18, r4; 4af0: 92 01 movw r18, r4 ldi r30, 4; 4af2: e4 e0 ldi r30, 0x04 ; 4 00004af4 : ad_3924: add r18, r4; + (2*RRpinMI) 4af4: 24 0d add r18, r4 adc r19, r5; 4af6: 35 1d adc r19, r5 dec r30; 4af8: ea 95 dec r30 brne ad_3924; 4afa: e1 f7 brne .-8 ; 0x4af4 #endif movw r4, r18; /* r4:5 = 10 * RRpinMI */ 4afc: 29 01 movw r4, r18 movw r10, r14; /* r10:13 = r14:17 = sumvolt0 */ 4afe: 57 01 movw r10, r14 movw r12, r16; 4b00: 68 01 movw r12, r16 ldd r6, Y+sumvolt1; 4b02: 6e 80 ldd r6, Y+6 ; 0x06 ldd r7, Y+sumvolt1+1; 4b04: 7f 80 ldd r7, Y+7 ; 0x07 ldd r8, Y+sumvolt1+2; 4b06: 88 84 ldd r8, Y+8 ; 0x08 ldd r9, Y+sumvolt1+3; 4b08: 99 84 ldd r9, Y+9 ; 0x09 /* ############################################################ */ lds r18, PartFound; /* if (PartFound == PART_CAPACITOR) { */ 4b0a: 20 91 20 01 lds r18, 0x0120 cpi r18, PART_CAPACITOR; 4b0e: 27 30 cpi r18, 0x07 ; 7 brne no_sub; /* it is not a capacitor */ 4b10: c1 f4 brne .+48 ; 0x4b42 /* Aproximation of 5000*(1 - exp(13.5e-6/(cap_val_nF*1.e-9*(0.1*(PIN_RM+PIN_RP+R_L_VAL)))) - 2500*(1 - exp(-27e-6/(cap_val_nF*1.e-9*(0.1*(PIN_RM+PIN_RP+R_L_VAL))))) */ /* is done by ((6744116/(PIN_RM+PIN_RP+R_L_VAL))*(6744116/(PIN_RM+PIN_RP+R_L_VAL))) / (cap_val_nF * (cap_val_nF + (137180/(PIN_RM+PIN_RP+R_L_VAL)))) */ /* is done by 872520 / (cap_val_nF * (cap_val_nF + 19)) */ ; #define FAKTOR_ESR (9537620/(PIN_RM+PIN_RP+R_L_VAL)) ldd r22, Y+cap_val_nF; /* sumvolt1 -= (1745098UL*MAX_CNT) / (cap_val_nF * (cap_val_nF + 19)); */ 4b12: 6c 89 ldd r22, Y+20 ; 0x14 ldd r23, Y+cap_val_nF+1; 4b14: 7d 89 ldd r23, Y+21 ; 0x15 ; ldd r24, Y+cap_val_nF+2; mov r24, r1 /* upper bits of cap_val_nF are allway zero */ 4b16: 81 2d mov r24, r1 ; ldd r25, Y+cap_val_nF+3; mov r25, r1 /* upper bits of cap_val_nF are allway zero */ 4b18: 91 2d mov r25, r1 #define CAP_OFFSET (410400/(PIN_RM+PIN_RP+R_L_VAL)) /* 57 nF */ #else #define FAKTOR_ESR (920000/(PIN_RM+PIN_RP+R_L_VAL)) /* 127 */ #define CAP_OFFSET (433200/(PIN_RM+PIN_RP+R_L_VAL)) /* 60 nF */ #endif subi r22, lo8(CAP_OFFSET); 0xED; 237 4b1a: 6c 53 subi r22, 0x3C ; 60 sbci r23, hi8(CAP_OFFSET); 0xFF; 255 4b1c: 70 40 sbci r23, 0x00 ; 0 sbci r24, hlo8(CAP_OFFSET); 0xFF; 255 4b1e: 80 40 sbci r24, 0x00 ; 0 sbci r25, hhi8(CAP_OFFSET); 0xFF; 255 4b20: 90 40 sbci r25, 0x00 ; 0 movw r18, r22; /* r18:21 = r22:25 = (cap_val_nF-60); */ 4b22: 9b 01 movw r18, r22 movw r20, r24; 4b24: ac 01 movw r20, r24 call __mulsi3; /* (cap_val_nF - 60) * (cap_val_nF - 60) */ 4b26: 0e 94 65 38 call 0x70ca ; 0x70ca <__mulsi3> #endif movw r18, r22; 4b2a: 9b 01 movw r18, r22 movw r20, r24; 4b2c: ac 01 movw r20, r24 ldi r22, lo8(FAKTOR_ESR*FAKTOR_ESR*MAX_CNT); 0x36; 54 4b2e: 6f ef ldi r22, 0xFF ; 255 ldi r23, hi8(FAKTOR_ESR*FAKTOR_ESR*MAX_CNT); 0x29; 41 4b30: 71 ec ldi r23, 0xC1 ; 193 ldi r24, hlo8(FAKTOR_ESR*FAKTOR_ESR*MAX_CNT); 0x86; 134 4b32: 8e e3 ldi r24, 0x3E ; 62 ldi r25, hhi8(FAKTOR_ESR*FAKTOR_ESR*MAX_CNT); 0x1A; 26 4b34: 90 e0 ldi r25, 0x00 ; 0 call __udivmodsi4; 4b36: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> sub r6, r18 4b3a: 62 1a sub r6, r18 sbc r7, r19 4b3c: 73 0a sbc r7, r19 sbc r8, r20 4b3e: 84 0a sbc r8, r20 sbc r9, r21 4b40: 95 0a sbc r9, r21 00004b42 : no_sub: /* } */ /* ############################################################ */ cp r10, r6; /* if (sumvolt1 > sumvolt0) { */ 4b42: a6 14 cp r10, r6 cpc r11, r7; 4b44: b7 04 cpc r11, r7 cpc r12, r8; 4b46: c8 04 cpc r12, r8 cpc r13, r9; 4b48: d9 04 cpc r13, r9 brcc ad_396c; 4b4a: 28 f4 brcc .+10 ; 0x4b56 sub r6, r10; /* sumvolt1 -= sumvolt0; // difference HighPin - LowPin Voltage with current */ 4b4c: 6a 18 sub r6, r10 sbc r7, r11; 4b4e: 7b 08 sbc r7, r11 sbc r8, r12; 4b50: 8c 08 sbc r8, r12 sbc r9, r13; 4b52: 9d 08 sbc r9, r13 rjmp ad_3972; /* } else { */ 4b54: 03 c0 rjmp .+6 ; 0x4b5c 00004b56 : ad_396c: eor r6, r6; /* sumvolt1 = 0; */ 4b56: 66 24 eor r6, r6 eor r7, r7 4b58: 77 24 eor r7, r7 movw r8, r6 4b5a: 43 01 movw r8, r6 00004b5c : ldi r20, 0; ldi r18, '#'; ldi r16, 4 ; call DisplayValue; #endif movw r22, r4 4b5c: b2 01 movw r22, r4 ldi r24, 0x00; 4b5e: 80 e0 ldi r24, 0x00 ; 0 ldi r25, 0x00; /* r22:25 = 10 * (unsigned long)RRpinMI) */ 4b60: 90 e0 ldi r25, 0x00 ; 0 // mean voltage at the capacitor is higher with current // sumvolt0 is the sum of voltages at LowPin, caused by output resistance of Port // RRpinMI is the port output resistance in 0.1 Ohm units. // we scale up the difference voltage with 10 to get 0.01 Ohm units of ESR /* esrvalue = (sumvolt1 * 10 * (unsigned long)RRpinMI) / sumvolt0; */ movw r18, r6; /* r18:21 = r6:9 = sumvolt1 */ 4b62: 93 01 movw r18, r6 movw r20, r8; 4b64: a4 01 movw r20, r8 call __mulsi3; /* r22:25 = r22:25 * r18:21 */ 4b66: 0e 94 65 38 call 0x70ca ; 0x70ca <__mulsi3> movw r18, r10; /* r18:21 = r10:13 = sumvolt0 */ 4b6a: 95 01 movw r18, r10 movw r20, r12; 4b6c: a6 01 movw r20, r12 call __udivmodsi4; /* r18:21 = r22:25 / r18:21 */ 4b6e: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> ldi r24, lo8(EE_ESR_ZEROtab); /* esr0 = (int8_t)eeprom_read_byte(&EE_ESR_ZEROtab[lopin+hipin]); */ 4b72: 81 e0 ldi r24, 0x01 ; 1 ldi r25, hi8(EE_ESR_ZEROtab); 4b74: 90 e0 ldi r25, 0x00 ; 0 ldd r23, Y+1; 4b76: 79 81 ldd r23, Y+1 ; 0x01 add r24, r23; 4b78: 87 0f add r24, r23 adc r25, zero_reg; 4b7a: 91 1d adc r25, r1 call eeprom_read_byte; 4b7c: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> ldi r25, 0; /* upper bits allways zero */ 4b80: 90 e0 ldi r25, 0x00 ; 0 mov r6, r24; 4b82: 68 2e mov r6, r24 movw r24,r18; /* r24:25 = r18:19 = esrvalue */ 4b84: c9 01 movw r24, r18 ldi r22, 16; 4b86: 60 e1 ldi r22, 0x10 ; 16 ldi r23, 0; 4b88: 70 e0 ldi r23, 0x00 ; 0 call __udivmodhi4 /* r22:23 = r24:25 / r22:23 */ 4b8a: 0e 94 75 38 call 0x70ea ; 0x70ea <__udivmodhi4> add r18, r22; /* esrvalue += esrvalue / 16; */ 4b8e: 26 0f add r18, r22 adc r19, r23; 4b90: 37 1f adc r19, r23 movw r24,r18; /* esrvalue */ 4b92: c9 01 movw r24, r18 cp r6, r24; /* if (esrvalue > esr0) esrvalue -= esr0; */ 4b94: 68 16 cp r6, r24 cpc zero_reg, r25; 4b96: 19 06 cpc r1, r25 brcc esr_too_less; 4b98: 18 f4 brcc .+6 ; 0x4ba0 sub r24, r6; /* - esr0 */ 4b9a: 86 19 sub r24, r6 sbc r25, zero_reg; 4b9c: 91 09 sbc r25, r1 rjmp ad_exit; 4b9e: 0f c0 rjmp .+30 ; 0x4bbe 00004ba0 : esr_too_less: #ifdef AUTO_CAL subi r24, lo8(-R_LIMIT_TO_UNCALIBRATED); /* + 0.20 Ohm */ 4ba0: 8c 5e subi r24, 0xEC ; 236 sbci r25, hi8(-R_LIMIT_TO_UNCALIBRATED); /* esrvalue + 20 */ 4ba2: 9f 4f sbci r25, 0xFF ; 255 cp r24, r6; /* if ((esrvalue+20) < esr0) ; */ 4ba4: 86 15 cp r24, r6 cpc r25, zero_reg; 4ba6: 91 05 cpc r25, r1 brcc esr_too_less2; 4ba8: 40 f4 brcc .+16 ; 0x4bba ldd r24, Y+cap_val_nF; /* mark only, if cap_val_nF > 4500 */ 4baa: 8c 89 ldd r24, Y+20 ; 0x14 ldd r25, Y+cap_val_nF+1; 4bac: 9d 89 ldd r25, Y+21 ; 0x15 ; ldd r26, Y+cap_val_nF+2; /* the upper bits (cap_val_nF+2|3) are always zero */ cpi r24, lo8(4500); 4bae: 84 39 cpi r24, 0x94 ; 148 ldi r24, hi8(4500); 4bb0: 81 e1 ldi r24, 0x11 ; 17 cpc r25, r24; 4bb2: 98 07 cpc r25, r24 brcs esr_too_less2; 4bb4: 10 f0 brcs .+4 ; 0x4bba call mark_as_uncalibrated; 4bb6: 0e 94 5e 14 call 0x28bc ; 0x28bc 00004bba : /* ldi r24,'<'; */ /* call lcd_data; */ esr_too_less2: #endif mov r24, zero_reg; 4bba: 81 2d mov r24, r1 mov r25, zero_reg; 4bbc: 91 2d mov r25, r1 00004bbe : ad_exit: #ifdef ADC_Sleep_Mode out _SFR_IO_ADDR(SMCR), zero_reg; /* SMCR = 0 */ #endif adiw r28, 0x1e; /* 30 */ 4bbe: 6e 96 adiw r28, 0x1e ; 30 in r0, _SFR_IO_ADDR(SREG); 63 4bc0: 0f b6 in r0, 0x3f ; 63 cli 4bc2: f8 94 cli out _SFR_IO_ADDR(SPH), r29; 62 4bc4: de bf out 0x3e, r29 ; 62 out _SFR_IO_ADDR(SREG), r0; 63 4bc6: 0f be out 0x3f, r0 ; 63 out _SFR_IO_ADDR(SPL), r28; 61 4bc8: cd bf out 0x3d, r28 ; 61 pop r28; 4bca: cf 91 pop r28 pop r29; 4bcc: df 91 pop r29 pop r17; 4bce: 1f 91 pop r17 pop r16; 4bd0: 0f 91 pop r16 pop r15; 4bd2: ff 90 pop r15 pop r14; 4bd4: ef 90 pop r14 pop r13; 4bd6: df 90 pop r13 pop r12; 4bd8: cf 90 pop r12 pop r11; 4bda: bf 90 pop r11 pop r10; 4bdc: af 90 pop r10 pop r9; 4bde: 9f 90 pop r9 pop r8; 4be0: 8f 90 pop r8 pop r7; 4be2: 7f 90 pop r7 pop r6; 4be4: 6f 90 pop r6 pop r5; 4be6: 5f 90 pop r5 pop r4; 4be8: 4f 90 pop r4 pop r3; 4bea: 3f 90 pop r3 pop r2; 4bec: 2f 90 pop r2 ret; 4bee: 08 95 ret 00004bf0 : #include #include "Transistortester.h" //================================================================= void GetVloss() { 4bf0: a0 e0 ldi r26, 0x00 ; 0 4bf2: b0 e0 ldi r27, 0x00 ; 0 4bf4: ee ef ldi r30, 0xFE ; 254 4bf6: f5 e2 ldi r31, 0x25 ; 37 4bf8: 0c 94 43 39 jmp 0x7286 ; 0x7286 <__prologue_saves__+0xc> } lval; uint8_t ii; uint8_t HiPinR_L; uint8_t LoADC; if (cap.v_loss > 0) return; // Voltage loss is already known 4bfc: 80 91 8d 01 lds r24, 0x018D 4c00: 90 91 8e 01 lds r25, 0x018E 4c04: 89 2b or r24, r25 4c06: 09 f0 breq .+2 ; 0x4c0a 4c08: 9d c0 rjmp .+314 ; 0x4d44 #if (((PIN_RL1 + 1) != PIN_RH1) || ((PIN_RL2 + 1) != PIN_RH2) || ((PIN_RL3 + 1) != PIN_RH3)) LoADC = pgm_read_byte((&PinRLRHADCtab[6])+cap.ca) | TXD_MSK; #else LoADC = pgm_read_byte((&PinRLRHADCtab[3])+cap.ca) | TXD_MSK; 4c0a: e0 91 8f 01 lds r30, 0x018F 4c0e: f0 e0 ldi r31, 0x00 ; 0 4c10: e1 5a subi r30, 0xA1 ; 161 4c12: fe 4f sbci r31, 0xFE ; 254 4c14: c4 91 lpm r28, Z 4c16: c8 60 ori r28, 0x08 ; 8 #endif HiPinR_L = pgm_read_byte(&PinRLRHADCtab[cap.cb]); //R_L mask for HighPin R_L load 4c18: e0 91 90 01 lds r30, 0x0190 4c1c: f0 e0 ldi r31, 0x00 ; 0 4c1e: e4 5a subi r30, 0xA4 ; 164 4c20: fe 4f sbci r31, 0xFE ; 254 4c22: 14 91 lpm r17, Z EntladePins(); // discharge capacitor 4c24: 0e 94 20 1d call 0x3a40 ; 0x3a40 ADC_PORT = TXD_VAL; // switch ADC-Port to GND 4c28: 88 e0 ldi r24, 0x08 ; 8 4c2a: 88 b9 out 0x08, r24 ; 8 R_PORT = 0; // switch R-Port to GND 4c2c: 15 b8 out 0x05, r1 ; 5 ADC_DDR = LoADC; // switch Low-Pin to output (GND) 4c2e: c7 b9 out 0x07, r28 ; 7 R_DDR = HiPinR_L; // switch R_L port for HighPin to output (GND) 4c30: 14 b9 out 0x04, r17 ; 4 adcv[0] = ReadADC(cap.cb); // voltage before any load 4c32: 80 91 90 01 lds r24, 0x0190 4c36: 0e 94 80 0e call 0x1d00 ; 0x1d00 4c3a: ec 01 movw r28, r24 // ******** should adcv[0] be measured without current??? if (cap.cpre_max > -9) return; // too much capacity 4c3c: 00 91 92 01 lds r16, 0x0192 4c40: 08 3f cpi r16, 0xF8 ; 248 4c42: 0c f0 brlt .+2 ; 0x4c46 4c44: 7f c0 rjmp .+254 ; 0x4d44 lval.dw = cap.cval_max; for (ii=cap.cpre_max+12;ii<4;ii++) { 4c46: 04 5f subi r16, 0xF4 ; 244 4c48: c0 90 83 01 lds r12, 0x0183 4c4c: d0 90 84 01 lds r13, 0x0184 4c50: e0 90 85 01 lds r14, 0x0185 4c54: f0 90 86 01 lds r15, 0x0186 lval.dw = (lval.dw + 5) / 10; 4c58: 8a e0 ldi r24, 0x0A ; 10 4c5a: 88 2e mov r8, r24 4c5c: 91 2c mov r9, r1 4c5e: a1 2c mov r10, r1 4c60: b1 2c mov r11, r1 R_DDR = HiPinR_L; // switch R_L port for HighPin to output (GND) adcv[0] = ReadADC(cap.cb); // voltage before any load // ******** should adcv[0] be measured without current??? if (cap.cpre_max > -9) return; // too much capacity lval.dw = cap.cval_max; for (ii=cap.cpre_max+12;ii<4;ii++) { 4c62: 04 30 cpi r16, 0x04 ; 4 4c64: 70 f4 brcc .+28 ; 0x4c82 lval.dw = (lval.dw + 5) / 10; 4c66: c7 01 movw r24, r14 4c68: b6 01 movw r22, r12 4c6a: 6b 5f subi r22, 0xFB ; 251 4c6c: 7f 4f sbci r23, 0xFF ; 255 4c6e: 8f 4f sbci r24, 0xFF ; 255 4c70: 9f 4f sbci r25, 0xFF ; 255 4c72: a5 01 movw r20, r10 4c74: 94 01 movw r18, r8 4c76: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> R_DDR = HiPinR_L; // switch R_L port for HighPin to output (GND) adcv[0] = ReadADC(cap.cb); // voltage before any load // ******** should adcv[0] be measured without current??? if (cap.cpre_max > -9) return; // too much capacity lval.dw = cap.cval_max; for (ii=cap.cpre_max+12;ii<4;ii++) { 4c7a: 0f 5f subi r16, 0xFF ; 255 lval.dw = (lval.dw + 5) / 10; 4c7c: 69 01 movw r12, r18 4c7e: 7a 01 movw r14, r20 4c80: f0 cf rjmp .-32 ; 0x4c62 } if ((lval.dw == 0) || (lval.dw > 5000)) { 4c82: d7 01 movw r26, r14 4c84: c6 01 movw r24, r12 4c86: 01 97 sbiw r24, 0x01 ; 1 4c88: a1 09 sbc r26, r1 4c8a: b1 09 sbc r27, r1 4c8c: 88 38 cpi r24, 0x88 ; 136 4c8e: 93 41 sbci r25, 0x13 ; 19 4c90: a1 05 cpc r26, r1 4c92: b1 05 cpc r27, r1 4c94: 08 f0 brcs .+2 ; 0x4c98 4c96: 56 c0 rjmp .+172 ; 0x4d44 /* capacity more than 50uF, Voltage loss is already measured */ return; } R_PORT = HiPinR_L; //R_L to 1 (VCC) 4c98: 15 b9 out 0x05, r17 ; 5 R_DDR = HiPinR_L; //switch Pin to output, across R to GND or VCC 4c9a: 14 b9 out 0x04, r17 ; 4 for (tmpint=0;tmpint // wait50us(); // wait exactly 50us wait5us(); // wait exactly 5us 4ca6: 0e 94 44 0e call 0x1c88 ; 0x1c88 /* capacity more than 50uF, Voltage loss is already measured */ return; } R_PORT = HiPinR_L; //R_L to 1 (VCC) R_DDR = HiPinR_L; //switch Pin to output, across R to GND or VCC for (tmpint=0;tmpint // wait50us(); // wait exactly 50us wait5us(); // wait exactly 5us } R_DDR = 0; // switch back to input 4cb2: 14 b8 out 0x04, r1 ; 4 R_PORT = 0; // no Pull up 4cb4: 15 b8 out 0x05, r1 ; 5 // wait10us(); //wait a little time wdt_reset(); 4cb6: a8 95 wdr // read voltage without current ADCconfig.Samples = 5; // set ADC to only 5 samples 4cb8: 85 e0 ldi r24, 0x05 ; 5 4cba: 80 93 2f 01 sts 0x012F, r24 adcv[2] = ReadADC(cap.cb); 4cbe: 80 91 90 01 lds r24, 0x0190 4cc2: 0e 94 80 0e call 0x1d00 ; 0x1d00 if (adcv[2] > adcv[0]) { 4cc6: c8 17 cp r28, r24 4cc8: d9 07 cpc r29, r25 4cca: 20 f4 brcc .+8 ; 0x4cd4 adcv[2] -= adcv[0]; //difference to beginning voltage 4ccc: 5c 01 movw r10, r24 4cce: ac 1a sub r10, r28 4cd0: bd 0a sbc r11, r29 4cd2: 02 c0 rjmp .+4 ; 0x4cd8 } else { adcv[2] = 0; // voltage is lower or same as beginning voltage 4cd4: a1 2c mov r10, r1 4cd6: b1 2c mov r11, r1 } // wait 2x the time which was required for loading for (tmpint=0;tmpint // wait50us(); wait5us(); 4ce2: 0e 94 44 0e call 0x1c88 ; 0x1c88 adcv[2] -= adcv[0]; //difference to beginning voltage } else { adcv[2] = 0; // voltage is lower or same as beginning voltage } // wait 2x the time which was required for loading for (tmpint=0;tmpint // wait50us(); wait5us(); } adcv[3] = ReadADC(cap.cb); // read voltage again, is discharged only a little bit ? 4cee: 80 91 90 01 lds r24, 0x0190 4cf2: 0e 94 80 0e call 0x1d00 ; 0x1d00 ADCconfig.Samples = ANZ_MESS; // set ADC back to configured No. of samples 4cf6: 29 e1 ldi r18, 0x19 ; 25 4cf8: 20 93 2f 01 sts 0x012F, r18 wdt_reset(); 4cfc: a8 95 wdr if (adcv[3] > adcv[0]) { 4cfe: c8 17 cp r28, r24 4d00: d9 07 cpc r29, r25 4d02: 18 f4 brcc .+6 ; 0x4d0a adcv[3] -= adcv[0]; // difference to beginning voltage 4d04: 8c 1b sub r24, r28 4d06: 9d 0b sbc r25, r29 4d08: 02 c0 rjmp .+4 ; 0x4d0e } else { adcv[3] = 0; // voltage is lower or same as beginning voltage 4d0a: 80 e0 ldi r24, 0x00 ; 0 4d0c: 90 e0 ldi r25, 0x00 ; 0 } if (adcv[2] > adcv[3]) { 4d0e: 8a 15 cp r24, r10 4d10: 9b 05 cpc r25, r11 4d12: 88 f4 brcc .+34 ; 0x4d36 // build difference to load voltage adcv[1] = adcv[2] - adcv[3]; // lost voltage during load time wait 4d14: 95 01 movw r18, r10 4d16: 28 1b sub r18, r24 4d18: 39 0b sbc r19, r25 } else { adcv[1] = 0; // no lost voltage } // compute voltage drop as part from loaded voltage if (adcv[1] > 0) { 4d1a: 69 f0 breq .+26 ; 0x4d36 // there is any voltage drop (adcv[1]) ! // adcv[2] is the loaded voltage. cap.v_loss = (unsigned long)(adcv[1] * 500UL) / adcv[2]; 4d1c: a4 ef ldi r26, 0xF4 ; 244 4d1e: b1 e0 ldi r27, 0x01 ; 1 4d20: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 4d24: 95 01 movw r18, r10 4d26: 40 e0 ldi r20, 0x00 ; 0 4d28: 50 e0 ldi r21, 0x00 ; 0 4d2a: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 4d2e: 30 93 8e 01 sts 0x018E, r19 4d32: 20 93 8d 01 sts 0x018D, r18 lcd_line4(); DisplayValue(lval.w[0],0,'x',4); #endif // discharge capacitor again EntladePins(); // discharge capacitors 4d36: 0e 94 20 1d call 0x3a40 ; 0x3a40 //ready // switch all ports to input ADC_DDR = TXD_MSK; // switch all ADC ports to input 4d3a: 88 e0 ldi r24, 0x08 ; 8 4d3c: 87 b9 out 0x07, r24 ; 7 ADC_PORT = TXD_VAL; // switch all ADC outputs to GND, no pull up 4d3e: 88 b9 out 0x08, r24 ; 8 R_DDR = 0; // switch all resistor ports to input 4d40: 14 b8 out 0x04, r1 ; 4 R_PORT = 0; // switch all resistor outputs to GND, no pull up 4d42: 15 b8 out 0x05, r1 ; 5 #endif return; } // end GetVdrop() 4d44: cd b7 in r28, 0x3d ; 61 4d46: de b7 in r29, 0x3e ; 62 4d48: ec e0 ldi r30, 0x0C ; 12 4d4a: 0c 94 5f 39 jmp 0x72be ; 0x72be <__epilogue_restores__+0xc> 00004d4e : #define PCI_CLEAR_BIT PCIF2 #define PCINTx_vect PCINT2_vect #endif #ifdef WITH_MENU void GetFrequency(uint8_t range) { 4d4e: a5 e0 ldi r26, 0x05 ; 5 4d50: b0 e0 ldi r27, 0x00 ; 0 4d52: ed ea ldi r30, 0xAD ; 173 4d54: f6 e2 ldi r31, 0x26 ; 38 4d56: 0c 94 3d 39 jmp 0x727a ; 0x727a <__prologue_saves__> FINP_PORT |= (1< 4d62: 20 ef ldi r18, 0xF0 ; 240 4d64: 2a 83 std Y+2, r18 ; 0x02 // ************************************************************************* // *********** straight frequency measurement by counting 1 second ********* // ************************************************************************* //set up Counter 0 // Counter 0 is used to count the external signal connected to T0 (PD4 or PB0) FREQINP_DDR &= ~(1< TCNT3 = 0; // set counter 3 to zero ext_freq.dw = 0; // set external frequency to zero TIFR3 = (1< wdt_reset(); 4dca: a8 95 wdr if (!(RST_PIN_REG & (1< 4dd0: 31 e0 ldi r19, 0x01 ; 1 4dd2: 39 83 std Y+1, r19 ; 0x01 #if PROCESSOR_TYP == 1280 if (TCCR3B == 0) break; // timer 3 is stopped by interrupt #else if (TCCR0B == 0) break; // timer 0 is stopped by interrupt 4dd4: 85 b5 in r24, 0x25 ; 37 4dd6: 81 11 cpse r24, r1 4dd8: 2d c0 rjmp .+90 ; 0x4e34 // one second is counted #if PROCESSOR_TYP == 1280 TCCR3B = 0; // stop timer 3, if not stopped by timer 1 compare interrupt ext_freq.w[0] = TCNT3; // add lower 16 bit to get total counts #else TCCR0B = 0; // stop timer 0, if not stopped by timer 1 compare interrupt 4dda: 15 bc out 0x25, r1 ; 37 ext_freq.b[0] = TCNT0; // add lower 8 bit to get total counts 4ddc: 86 b5 in r24, 0x26 ; 38 4dde: 80 93 14 01 sts 0x0114, r24 #endif #if PROCESSOR_TYP == 644 freq_count = ext_freq.dw; // save the frequency counter #endif #if (LCD_LINES > 3) lcd_line3(); 4de2: 0e 94 90 08 call 0x1120 ; 0x1120 lcd_clear_line(); 4de6: 0e 94 a1 0a call 0x1542 ; 0x1542 lcd_line4(); 4dea: 0e 94 9b 08 call 0x1136 ; 0x1136 lcd_clear_line(); 4dee: 0e 94 a1 0a call 0x1542 ; 0x1542 lcd_clear_line2(); 4df2: 0e 94 ac 0a call 0x1558 ; 0x1558 #else lcd_clear(); // clear total display #endif lcd_data('f'); 4df6: 86 e6 ldi r24, 0x66 ; 102 4df8: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('='); 4dfc: 8d e3 ldi r24, 0x3D ; 61 4dfe: 0e 94 3f 0a call 0x147e ; 0x147e } else { // frequency divider is activ DisplayValue(ext_freq.dw*FREQ_DIV,0,'H',7); } #else DisplayValue(ext_freq.dw,0,'H',7); 4e02: 60 91 14 01 lds r22, 0x0114 4e06: 70 91 15 01 lds r23, 0x0115 4e0a: 80 91 16 01 lds r24, 0x0116 4e0e: 90 91 17 01 lds r25, 0x0117 4e12: 07 e0 ldi r16, 0x07 ; 7 4e14: 28 e4 ldi r18, 0x48 ; 72 4e16: 40 e0 ldi r20, 0x00 ; 0 4e18: 0e 94 a8 0b call 0x1750 ; 0x1750 #endif lcd_data('z'); 4e1c: 8a e7 ldi r24, 0x7A ; 122 4e1e: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('/'); // Frequency divider is activ } else { lcd_space(); // Frequency divider is not activ } #endif FREQINP_DDR &= ~(1< // Exact 1000ms period is only with "end of period" from timer1 interrupt. // When stopped with the for loop, the time is too long because wait call does not // respect CPU time used for interrupts and loop itself. // For this case show ? behind the Hz. lcd_data('?'); 4e2c: 8f e3 ldi r24, 0x3F ; 63 4e2e: 0e 94 3f 0a call 0x147e ; 0x147e 4e32: 03 c0 rjmp .+6 ; 0x4e3a 4e34: 11 50 subi r17, 0x01 ; 1 TIFR1 = (1< 4e38: d0 cf rjmp .-96 ; 0x4dda // When stopped with the for loop, the time is too long because wait call does not // respect CPU time used for interrupts and loop itself. // For this case show ? behind the Hz. lcd_data('?'); } TCCR1B = 0; // stop timer 1 4e3a: 10 92 81 00 sts 0x0081, r1 TIMSK1 = 0; // disable all timer 1 interrupts 4e3e: 10 92 6f 00 sts 0x006F, r1 if ((ext_freq.dw < FMAX_PERIOD) && (ext_freq.dw > 0)) { 4e42: 20 91 14 01 lds r18, 0x0114 4e46: 30 91 15 01 lds r19, 0x0115 4e4a: 40 91 16 01 lds r20, 0x0116 4e4e: 50 91 17 01 lds r21, 0x0117 4e52: da 01 movw r26, r20 4e54: c9 01 movw r24, r18 4e56: 01 97 sbiw r24, 0x01 ; 1 4e58: a1 09 sbc r26, r1 4e5a: b1 09 sbc r27, r1 4e5c: 89 3d cpi r24, 0xD9 ; 217 4e5e: 91 46 sbci r25, 0x61 ; 97 4e60: a1 05 cpc r26, r1 4e62: b1 05 cpc r27, r1 4e64: 08 f0 brcs .+2 ; 0x4e68 4e66: 2b c1 rjmp .+598 ; 0x50be // ************************************************************************* // ******** Period measurement by counting some periods ******************** // ************************************************************************* pinchange_max = ((10 * (unsigned long)ext_freq.dw) + MHZ_CPU) / MHZ_CPU; // about 10000000 clock tics 4e68: aa e0 ldi r26, 0x0A ; 10 4e6a: b0 e0 ldi r27, 0x00 ; 0 4e6c: 0e 94 5a 38 call 0x70b4 ; 0x70b4 <__muluhisi3> 4e70: 68 5f subi r22, 0xF8 ; 248 4e72: 7f 4f sbci r23, 0xFF ; 255 4e74: 8f 4f sbci r24, 0xFF ; 255 4e76: 9f 4f sbci r25, 0xFF ; 255 4e78: 23 e0 ldi r18, 0x03 ; 3 4e7a: 96 95 lsr r25 4e7c: 87 95 ror r24 4e7e: 77 95 ror r23 4e80: 67 95 ror r22 4e82: 2a 95 dec r18 4e84: d1 f7 brne .-12 ; 0x4e7a pinchange_max += pinchange_max; // * 2 for up and down change 4e86: 66 0f add r22, r22 4e88: 77 1f adc r23, r23 4e8a: 70 93 76 01 sts 0x0176, r23 4e8e: 60 93 75 01 sts 0x0175, r22 FREQINP_DDR &= ~(1< pinchange_count = 0; EICRB = (0< wdt_reset(); 4eda: a8 95 wdr if (!(RST_PIN_REG & (1< 4ee0: e1 e0 ldi r30, 0x01 ; 1 4ee2: e9 83 std Y+1, r30 ; 0x01 if ((PCMSK_FREQ & (1< PCIFR = (1< #if PROCESSOR_TYP == 1280 TCCR3B = 0; // stop counter 3 PCMSK_FREQ &= ~(1< 3) lcd_line3(); // use line3 to report the period with 4-line LCD 4f12: 0e 94 90 08 call 0x1120 ; 0x1120 #else lcd_line2(); // report period on line 2 of 2-line LCD #endif lcd_data('T'); 4f16: 84 e5 ldi r24, 0x54 ; 84 4f18: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('='); 4f1c: 8d e3 ldi r24, 0x3D ; 61 4f1e: 0e 94 3f 0a call 0x147e ; 0x147e ext_period = ((unsigned long long)ext_freq.dw * (200000/MHZ_CPU)) / pinchange_max; 4f22: 80 91 14 01 lds r24, 0x0114 4f26: 90 91 15 01 lds r25, 0x0115 4f2a: a0 91 16 01 lds r26, 0x0116 4f2e: b0 91 17 01 lds r27, 0x0117 4f32: 20 91 75 01 lds r18, 0x0175 4f36: 30 91 76 01 lds r19, 0x0176 4f3a: 3c 83 std Y+4, r19 ; 0x04 4f3c: 2b 83 std Y+3, r18 ; 0x03 4f3e: 1c 01 movw r2, r24 4f40: 2d 01 movw r4, r26 4f42: 9c 01 movw r18, r24 4f44: a2 01 movw r20, r4 4f46: 60 e0 ldi r22, 0x00 ; 0 4f48: 70 e0 ldi r23, 0x00 ; 0 4f4a: 80 e0 ldi r24, 0x00 ; 0 4f4c: 90 e0 ldi r25, 0x00 ; 0 4f4e: 03 e0 ldi r16, 0x03 ; 3 4f50: 0e 94 7a 39 call 0x72f4 ; 0x72f4 <__ashldi3> 4f54: 51 01 movw r10, r2 4f56: 62 01 movw r12, r4 4f58: e1 2c mov r14, r1 4f5a: f1 2c mov r15, r1 4f5c: 00 e0 ldi r16, 0x00 ; 0 4f5e: 10 e0 ldi r17, 0x00 ; 0 4f60: 0e 94 93 39 call 0x7326 ; 0x7326 <__subdi3> 4f64: 59 01 movw r10, r18 4f66: 6a 01 movw r12, r20 4f68: 7b 01 movw r14, r22 4f6a: e8 2f mov r30, r24 4f6c: 19 2f mov r17, r25 4f6e: 03 e0 ldi r16, 0x03 ; 3 4f70: 0e 94 7a 39 call 0x72f4 ; 0x72f4 <__ashldi3> 4f74: 0e 2f mov r16, r30 4f76: 0e 94 93 39 call 0x7326 ; 0x7326 <__subdi3> 4f7a: 03 e0 ldi r16, 0x03 ; 3 4f7c: 0e 94 7a 39 call 0x72f4 ; 0x72f4 <__ashldi3> 4f80: 51 01 movw r10, r2 4f82: 62 01 movw r12, r4 4f84: e1 2c mov r14, r1 4f86: f1 2c mov r15, r1 4f88: 00 e0 ldi r16, 0x00 ; 0 4f8a: 10 e0 ldi r17, 0x00 ; 0 4f8c: 0e 94 93 39 call 0x7326 ; 0x7326 <__subdi3> 4f90: 02 e0 ldi r16, 0x02 ; 2 4f92: 0e 94 7a 39 call 0x72f4 ; 0x72f4 <__ashldi3> 4f96: 00 e0 ldi r16, 0x00 ; 0 4f98: 0e 94 93 39 call 0x7326 ; 0x7326 <__subdi3> 4f9c: 01 e0 ldi r16, 0x01 ; 1 4f9e: 0e 94 7a 39 call 0x72f4 ; 0x72f4 <__ashldi3> 4fa2: 00 e0 ldi r16, 0x00 ; 0 4fa4: 0e 94 93 39 call 0x7326 ; 0x7326 <__subdi3> 4fa8: 03 e0 ldi r16, 0x03 ; 3 4faa: 0e 94 7a 39 call 0x72f4 ; 0x72f4 <__ashldi3> 4fae: eb 81 ldd r30, Y+3 ; 0x03 4fb0: fc 81 ldd r31, Y+4 ; 0x04 4fb2: 5f 01 movw r10, r30 4fb4: c1 2c mov r12, r1 4fb6: d1 2c mov r13, r1 4fb8: 00 e0 ldi r16, 0x00 ; 0 4fba: 0e 94 d8 38 call 0x71b0 ; 0x71b0 <__udivdi3> 4fbe: 39 01 movw r6, r18 4fc0: 4a 01 movw r8, r20 4fc2: 1b 01 movw r2, r22 4fc4: 2c 01 movw r4, r24 if ((FDIV_PORT&(1< 127) { 4fc6: 2b 81 ldd r18, Y+3 ; 0x03 4fc8: 3c 81 ldd r19, Y+4 ; 0x04 4fca: 20 38 cpi r18, 0x80 ; 128 4fcc: 31 05 cpc r19, r1 4fce: 30 f0 brcs .+12 ; 0x4fdc DisplayValue(ext_period,-11,'s',7); // show period converted to 0.01ns units 4fd0: 07 e0 ldi r16, 0x07 ; 7 4fd2: 23 e7 ldi r18, 0x73 ; 115 4fd4: 45 ef ldi r20, 0xF5 ; 245 4fd6: b3 01 movw r22, r6 4fd8: c4 01 movw r24, r8 4fda: 16 c0 rjmp .+44 ; 0x5008 } else { //prevent overflow of 32-Bit DisplayValue((unsigned long)(ext_period/100),-9,'s',7); // show period converted to 1ns units 4fdc: 84 e6 ldi r24, 0x64 ; 100 4fde: a8 2e mov r10, r24 4fe0: b1 2c mov r11, r1 4fe2: c1 2c mov r12, r1 4fe4: d1 2c mov r13, r1 4fe6: e1 2c mov r14, r1 4fe8: f1 2c mov r15, r1 4fea: 00 e0 ldi r16, 0x00 ; 0 4fec: 10 e0 ldi r17, 0x00 ; 0 4fee: 93 01 movw r18, r6 4ff0: c2 01 movw r24, r4 4ff2: 0e 94 d8 38 call 0x71b0 ; 0x71b0 <__udivdi3> 4ff6: e2 2f mov r30, r18 4ff8: f4 2f mov r31, r20 4ffa: 07 e0 ldi r16, 0x07 ; 7 4ffc: 23 e7 ldi r18, 0x73 ; 115 4ffe: 47 ef ldi r20, 0xF7 ; 247 5000: 6e 2f mov r22, r30 5002: 73 2f mov r23, r19 5004: 8f 2f mov r24, r31 5006: 95 2f mov r25, r21 5008: 0e 94 a8 0b call 0x1750 ; 0x1750 } if (ii == 250) { 500c: 3d 81 ldd r19, Y+5 ; 0x05 500e: 3a 3f cpi r19, 0xFA ; 250 5010: 21 f4 brne .+8 ; 0x501a lcd_data('?'); // wait loop has regular finished 5012: 8f e3 ldi r24, 0x3F ; 63 5014: 0e 94 3f 0a call 0x147e ; 0x147e 5018: 52 c0 rjmp .+164 ; 0x50be } else { if (ext_period > 249500) { 501a: 93 01 movw r18, r6 501c: a4 01 movw r20, r8 501e: b1 01 movw r22, r2 5020: c2 01 movw r24, r4 5022: 2c 39 cpi r18, 0x9C ; 156 5024: 3e 4c sbci r19, 0xCE ; 206 5026: 43 40 sbci r20, 0x03 ; 3 5028: 51 05 cpc r21, r1 502a: 61 05 cpc r22, r1 502c: 71 05 cpc r23, r1 502e: 81 05 cpc r24, r1 5030: 91 05 cpc r25, r1 5032: 09 f0 breq .+2 ; 0x5036 5034: 08 f4 brcc .+2 ; 0x5038 5036: 43 c0 rjmp .+134 ; 0x50be #if (LCD_LINES > 3) lcd_line4(); // use line 4 of 4-line LCD to report the computed frequency 5038: 0e 94 9b 08 call 0x1136 ; 0x1136 #else lcd_line1(); // overwrite line 1 of 2-line LCD to report the computed frequency #endif lcd_data('f'); 503c: 86 e6 ldi r24, 0x66 ; 102 503e: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('='); 5042: 8d e3 ldi r24, 0x3D ; 61 5044: 0e 94 3f 0a call 0x147e ; 0x147e if (ext_period > 1000000000) { 5048: 93 01 movw r18, r6 504a: a4 01 movw r20, r8 504c: b1 01 movw r22, r2 504e: c2 01 movw r24, r4 // frequency in 0.000001Hz (1e11*1e6)/(0.01ns count) freq_from_per = (unsigned long long)(100000000000000000) / ext_period; 5050: 53 01 movw r10, r6 5052: 64 01 movw r12, r8 5054: 71 01 movw r14, r2 5056: 82 01 movw r16, r4 #else lcd_line1(); // overwrite line 1 of 2-line LCD to report the computed frequency #endif lcd_data('f'); lcd_data('='); if (ext_period > 1000000000) { 5058: 21 15 cp r18, r1 505a: 3a 4c sbci r19, 0xCA ; 202 505c: 4a 49 sbci r20, 0x9A ; 154 505e: 5b 43 sbci r21, 0x3B ; 59 5060: 61 05 cpc r22, r1 5062: 71 05 cpc r23, r1 5064: 81 05 cpc r24, r1 5066: 91 05 cpc r25, r1 5068: 89 f0 breq .+34 ; 0x508c 506a: 80 f0 brcs .+32 ; 0x508c // frequency in 0.000001Hz (1e11*1e6)/(0.01ns count) freq_from_per = (unsigned long long)(100000000000000000) / ext_period; 506c: 20 e0 ldi r18, 0x00 ; 0 506e: 30 e0 ldi r19, 0x00 ; 0 5070: 4a e8 ldi r20, 0x8A ; 138 5072: 5d e5 ldi r21, 0x5D ; 93 5074: 68 e7 ldi r22, 0x78 ; 120 5076: 75 e4 ldi r23, 0x45 ; 69 5078: 83 e6 ldi r24, 0x63 ; 99 507a: 91 e0 ldi r25, 0x01 ; 1 507c: 0e 94 d8 38 call 0x71b0 ; 0x71b0 <__udivdi3> 5080: e2 2f mov r30, r18 5082: f4 2f mov r31, r20 DisplayValue(freq_from_per,-6,'H',7); // display with 0.000001 Hz resolution 5084: 07 e0 ldi r16, 0x07 ; 7 5086: 28 e4 ldi r18, 0x48 ; 72 5088: 4a ef ldi r20, 0xFA ; 250 508a: 0f c0 rjmp .+30 ; 0x50aa } else { // prevent unsigned long overflow, scale to 0.0001 Hz // frequency in 0.0001Hz (1e11*1e4)/(0.01ns count) freq_from_per = (unsigned long long)(1000000000000000) / ext_period; 508c: 20 e0 ldi r18, 0x00 ; 0 508e: 30 e8 ldi r19, 0x80 ; 128 5090: 46 ec ldi r20, 0xC6 ; 198 5092: 54 ea ldi r21, 0xA4 ; 164 5094: 6e e7 ldi r22, 0x7E ; 126 5096: 7d e8 ldi r23, 0x8D ; 141 5098: 83 e0 ldi r24, 0x03 ; 3 509a: 90 e0 ldi r25, 0x00 ; 0 509c: 0e 94 d8 38 call 0x71b0 ; 0x71b0 <__udivdi3> 50a0: e2 2f mov r30, r18 50a2: f4 2f mov r31, r20 DisplayValue(freq_from_per,-4,'H',7); // display with 0.0001 Hz resolution 50a4: 07 e0 ldi r16, 0x07 ; 7 50a6: 28 e4 ldi r18, 0x48 ; 72 50a8: 4c ef ldi r20, 0xFC ; 252 50aa: 6e 2f mov r22, r30 50ac: 73 2f mov r23, r19 50ae: 8f 2f mov r24, r31 50b0: 95 2f mov r25, r21 50b2: 0e 94 a8 0b call 0x1750 ; 0x1750 } lcd_data('z'); 50b6: 8a e7 ldi r24, 0x7A ; 122 50b8: 0e 94 3f 0a call 0x147e ; 0x147e FREQINP_DDR &= ~(1< 50ca: 29 81 ldd r18, Y+1 ; 0x01 50cc: 82 0f add r24, r18 #ifdef WITH_ROTARY_SWITCH if ((taste != 0) || (rotary.incre > 2)) break; #else if (taste != 0) break; 50ce: 29 f4 brne .+10 ; 0x50da 50d0: 3a 81 ldd r19, Y+2 ; 0x02 50d2: 31 50 subi r19, 0x01 ; 1 50d4: 3a 83 std Y+2, r19 ; 0x02 #else message_key_released(FREQ_str); // Frequency: in line 1 #endif taste = 0; // reset flag for key pressed for (mm=0;mm<240;mm++) { 50d6: 31 11 cpse r19, r1 50d8: 46 ce rjmp .-884 ; 0x4d66 if (taste != 0) break; #endif } /* end for mm */ return; } // end GetFrequency() 50da: 25 96 adiw r28, 0x05 ; 5 50dc: e2 e1 ldi r30, 0x12 ; 18 50de: 0c 94 59 39 jmp 0x72b2 ; 0x72b2 <__epilogue_restores__> 000050e2 <__vector_16>: /* timer 0 Overflow interrupt */ /* timer 0 count up to 0xff, then OV occur. update upper part */ /* to build the total counts within one second or */ /* to build the total counts within the specified pin changes. */ /* ************************************************************ */ ISR(TIMER0_OVF_vect, ISR_BLOCK) { 50e2: 1f 92 push r1 50e4: 0f 92 push r0 50e6: 0f b6 in r0, 0x3f ; 63 50e8: 0f 92 push r0 50ea: 11 24 eor r1, r1 50ec: 8f 93 push r24 50ee: 9f 93 push r25 50f0: af 93 push r26 50f2: bf 93 push r27 sei(); // set interrupt enable 50f4: 78 94 sei ext_freq.dw += 256; // add 256 clock tics to the total time 50f6: 80 91 14 01 lds r24, 0x0114 50fa: 90 91 15 01 lds r25, 0x0115 50fe: a0 91 16 01 lds r26, 0x0116 5102: b0 91 17 01 lds r27, 0x0117 5106: 9f 5f subi r25, 0xFF ; 255 5108: af 4f sbci r26, 0xFF ; 255 510a: bf 4f sbci r27, 0xFF ; 255 510c: 80 93 14 01 sts 0x0114, r24 5110: 90 93 15 01 sts 0x0115, r25 5114: a0 93 16 01 sts 0x0116, r26 5118: b0 93 17 01 sts 0x0117, r27 } 511c: bf 91 pop r27 511e: af 91 pop r26 5120: 9f 91 pop r25 5122: 8f 91 pop r24 5124: 0f 90 pop r0 5126: 0f be out 0x3f, r0 ; 63 5128: 0f 90 pop r0 512a: 1f 90 pop r1 512c: 18 95 reti 0000512e <__vector_12>: /* ************************************************************ */ /* Timer 1 Compare B interrupts with count 1 to start counter 0 */ /* This is defined as start of the measurement second. */ /* ************************************************************ */ ISR(TIMER1_COMPB_vect, ISR_BLOCK) { 512e: 1f 92 push r1 5130: 0f 92 push r0 5132: 0f b6 in r0, 0x3f ; 63 5134: 0f 92 push r0 5136: 11 24 eor r1, r1 5138: 8f 93 push r24 #if PROCESSOR_TYP == 1280 TCCR3B = (1<: /* ************************************************************ */ /* Timer 1 Compare A interrupt after 1 second to stop counter 0 */ /* ************************************************************ */ ISR(TIMER1_COMPA_vect, ISR_BLOCK) { 514a: 1f 92 push r1 514c: 0f 92 push r0 514e: 0f b6 in r0, 0x3f ; 63 5150: 0f 92 push r0 5152: 11 24 eor r1, r1 // The TIMER1_COMPB_vect uses one push and one ldi more than this interrupt. // Therefore we stop timer 1 first and ajust to same time with wdt_reset(); wdt_reset(); // for adjusting to same time as TIMER1_COMPB_vect 5154: a8 95 wdr TCCR1B = 0; // stop counter 1 5156: 10 92 81 00 sts 0x0081, r1 #if PROCESSOR_TYP == 1280 TCCR3B = 0; // stop counter 3 #else TCCR0B = 0; // stop counter 0 515a: 15 bc out 0x25, r1 ; 37 #endif } 515c: 0f 90 pop r0 515e: 0f be out 0x3f, r0 ; 63 5160: 0f 90 pop r0 5162: 1f 90 pop r1 5164: 18 95 reti 00005166 <__vector_5>: /* full periods (no half period) */ /* ************************************************************ */ ISR(PCINTx_vect, ISR_BLOCK) { 5166: 1f 92 push r1 5168: 0f 92 push r0 516a: 0f b6 in r0, 0x3f ; 63 516c: 0f 92 push r0 516e: 11 24 eor r1, r1 5170: 2f 93 push r18 5172: 3f 93 push r19 5174: 8f 93 push r24 5176: 9f 93 push r25 if (pinchange_count == 0) { 5178: 80 91 77 01 lds r24, 0x0177 517c: 90 91 78 01 lds r25, 0x0178 5180: 89 2b or r24, r25 5182: 11 f4 brne .+4 ; 0x5188 <__vector_5+0x22> #if PROCESSOR_TYP == 1280 TCCR3B = (1<= pinchange_max) { 5188: 20 91 77 01 lds r18, 0x0177 518c: 30 91 78 01 lds r19, 0x0178 5190: 80 91 75 01 lds r24, 0x0175 5194: 90 91 76 01 lds r25, 0x0176 5198: 28 17 cp r18, r24 519a: 39 07 cpc r19, r25 519c: 30 f0 brcs .+12 ; 0x51aa <__vector_5+0x44> // stop the counter 3, when maximum value has reached. TCCR3B = 0; // stop counter 3 PCMSK_FREQ &= ~(1<: /* ****************************************************************** */ /* message2line writes the message corresponding to the number to LCD */ /* ****************************************************************** */ void message2line(uint8_t number) { if (number > MODE_LAST) number -= (MODE_LAST + 1); 51ce: 8c 30 cpi r24, 0x0C ; 12 51d0: 08 f0 brcs .+2 ; 0x51d4 51d2: 8c 50 subi r24, 0x0C ; 12 if (number == MODE_TRANS) lcd_MEM2_string(TESTER_str); 51d4: 81 11 cpse r24, r1 51d6: 03 c0 rjmp .+6 ; 0x51de 51d8: 87 e5 ldi r24, 0x57 ; 87 51da: 94 e0 ldi r25, 0x04 ; 4 51dc: 36 c0 rjmp .+108 ; 0x524a if (number == MODE_FREQ) lcd_MEM2_string(FREQ_str); 51de: 81 30 cpi r24, 0x01 ; 1 51e0: 19 f4 brne .+6 ; 0x51e8 51e2: 8d e4 ldi r24, 0x4D ; 77 51e4: 94 e0 ldi r25, 0x04 ; 4 51e6: 31 c0 rjmp .+98 ; 0x524a #if PROCESSOR_TYP == 644 if (number == MODE_HFREQ) lcd_MEM2_string(HFREQ_str); if (number == MODE_H_CRYSTAL) lcd_MEM2_string(H_CRYSTAL_str); if (number == MODE_L_CRYSTAL) lcd_MEM2_string(L_CRYSTAL_str); #endif if (number == MODE_FGEN) lcd_MEM2_string(F_GEN_str); 51e8: 82 30 cpi r24, 0x02 ; 2 51ea: 19 f4 brne .+6 ; 0x51f2 51ec: 84 e2 ldi r24, 0x24 ; 36 51ee: 94 e0 ldi r25, 0x04 ; 4 51f0: 2c c0 rjmp .+88 ; 0x524a if (number == MODE_PWM) lcd_MEM2_string(PWM_10bit_str); 51f2: 83 30 cpi r24, 0x03 ; 3 51f4: 19 f4 brne .+6 ; 0x51fc 51f6: 89 e1 ldi r24, 0x19 ; 25 51f8: 94 e0 ldi r25, 0x04 ; 4 51fa: 27 c0 rjmp .+78 ; 0x524a if (number == MODE_ESR) lcd_MEM2_string(C_ESR_str); 51fc: 84 30 cpi r24, 0x04 ; 4 51fe: 19 f4 brne .+6 ; 0x5206 5200: 82 ec ldi r24, 0xC2 ; 194 5202: 91 e0 ldi r25, 0x01 ; 1 5204: 22 c0 rjmp .+68 ; 0x524a if (number == MODE_RESIS) lcd_MEM_string(RESIS_13_str); 5206: 85 30 cpi r24, 0x05 ; 5 5208: 19 f4 brne .+6 ; 0x5210 520a: 87 eb ldi r24, 0xB7 ; 183 520c: 91 e0 ldi r25, 0x01 ; 1 520e: 1d c0 rjmp .+58 ; 0x524a if (number == MODE_CAP13) lcd_MEM_string(CAP_13_str); 5210: 86 30 cpi r24, 0x06 ; 6 5212: 19 f4 brne .+6 ; 0x521a 5214: 8b ea ldi r24, 0xAB ; 171 5216: 91 e0 ldi r25, 0x01 ; 1 5218: 18 c0 rjmp .+48 ; 0x524a if (number == MODE_ROTARY) lcd_MEM2_string(RotaryEncoder_str); 521a: 87 30 cpi r24, 0x07 ; 7 521c: 19 f4 brne .+6 ; 0x5224 521e: 8a e0 ldi r24, 0x0A ; 10 5220: 94 e0 ldi r25, 0x04 ; 4 5222: 13 c0 rjmp .+38 ; 0x524a #ifdef WITH_SELFTEST if (number == MODE_SELFTEST) lcd_MEM2_string(FULLCHECK_str); 5224: 88 30 cpi r24, 0x08 ; 8 5226: 19 f4 brne .+6 ; 0x522e 5228: 8b ef ldi r24, 0xFB ; 251 522a: 93 e0 ldi r25, 0x03 ; 3 522c: 0e c0 rjmp .+28 ; 0x524a #endif #ifdef WITH_VEXT if (number == MODE_VEXT) lcd_MEM_string(VOLTAGE_str); #endif #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || defined(LCD_DOGM)) if (number == MODE_CONTRAST) lcd_MEM_string(CONTRAST_str); 522e: 89 30 cpi r24, 0x09 ; 9 5230: 19 f4 brne .+6 ; 0x5238 5232: 84 ee ldi r24, 0xE4 ; 228 5234: 93 e0 ldi r25, 0x03 ; 3 5236: 09 c0 rjmp .+18 ; 0x524a #endif if (number == MODE_SHOW) { 5238: 8a 30 cpi r24, 0x0A ; 10 523a: 19 f4 brne .+6 ; 0x5242 lcd_MEM2_string(SHOW_str); 523c: 8b e3 ldi r24, 0x3B ; 59 523e: 94 e0 ldi r25, 0x04 ; 4 5240: 04 c0 rjmp .+8 ; 0x524a } if (number == MODE_OFF) { 5242: 8b 30 cpi r24, 0x0B ; 11 5244: 21 f4 brne .+8 ; 0x524e lcd_MEM2_string(OFF_str); 5246: 80 e3 ldi r24, 0x30 ; 48 5248: 94 e0 ldi r25, 0x04 ; 4 524a: 0e 94 bf 0a call 0x157e ; 0x157e 524e: 08 95 ret 00005250 : } /* ****************************************************************** */ /* show_C_ESR measures the capacity and ESR of a capacitor connected to TP1 and TP3 */ /* ****************************************************************** */ void show_C_ESR() { 5250: 0f 93 push r16 5252: cf 93 push r28 uint8_t key_pressed; message_key_released(C_ESR_str); 5254: 82 ec ldi r24, 0xC2 ; 194 5256: 91 e0 ldi r25, 0x01 ; 1 5258: 0e 94 d1 2c call 0x59a2 ; 0x59a2 #ifdef POWER_OFF uint8_t times; for (times=0;times<250;times++) 525c: c0 e0 ldi r28, 0x00 ; 0 #else while (1) /* wait endless without the POWER_OFF option */ #endif { PartFound = PART_NONE; 525e: 10 92 20 01 sts 0x0120, r1 ReadBigCap(TP3,TP1); 5262: 60 e0 ldi r22, 0x00 ; 0 5264: 82 e0 ldi r24, 0x02 ; 2 5266: 0e 94 ed 2c call 0x59da ; 0x59da if (PartFound == PART_CAPACITOR) { 526a: 80 91 20 01 lds r24, 0x0120 526e: 87 30 cpi r24, 0x07 ; 7 5270: d1 f5 brne .+116 ; 0x52e6 lcd_clear_line1(); // clear old capacity value 5272: 0e 94 a5 0a call 0x154a ; 0x154a lcd_data('C'); 5276: 83 e4 ldi r24, 0x43 ; 67 5278: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('='); 527c: 8d e3 ldi r24, 0x3D ; 61 527e: 0e 94 3f 0a call 0x147e ; 0x147e DisplayValue(cap.cval_max,cap.cpre_max,'F',3); 5282: 60 91 83 01 lds r22, 0x0183 5286: 70 91 84 01 lds r23, 0x0184 528a: 80 91 85 01 lds r24, 0x0185 528e: 90 91 86 01 lds r25, 0x0186 5292: 03 e0 ldi r16, 0x03 ; 3 5294: 26 e4 ldi r18, 0x46 ; 70 5296: 40 91 92 01 lds r20, 0x0192 529a: 0e 94 a8 0b call 0x1750 ; 0x1750 cap.esr = GetESR(cap.cb,cap.ca); 529e: 60 91 8f 01 lds r22, 0x018F 52a2: 80 91 90 01 lds r24, 0x0190 52a6: 0e 94 1c 24 call 0x4838 ; 0x4838 52aa: 90 93 8c 01 sts 0x018C, r25 52ae: 80 93 8b 01 sts 0x018B, r24 lcd_clear_line2(); // clear old ESR value 52b2: 0e 94 ac 0a call 0x1558 ; 0x1558 lcd_MEM_string(&ESR_str[1]); 52b6: 86 e7 ldi r24, 0x76 ; 118 52b8: 93 e0 ldi r25, 0x03 ; 3 52ba: 0e 94 bf 0a call 0x157e ; 0x157e if (cap.esr < 65530) { 52be: 60 91 8b 01 lds r22, 0x018B 52c2: 70 91 8c 01 lds r23, 0x018C 52c6: 6a 3f cpi r22, 0xFA ; 250 52c8: 8f ef ldi r24, 0xFF ; 255 52ca: 78 07 cpc r23, r24 52cc: 40 f4 brcc .+16 ; 0x52de DisplayValue(cap.esr,-2,LCD_CHAR_OMEGA,2); 52ce: 80 e0 ldi r24, 0x00 ; 0 52d0: 90 e0 ldi r25, 0x00 ; 0 52d2: 02 e0 ldi r16, 0x02 ; 2 52d4: 24 e0 ldi r18, 0x04 ; 4 52d6: 4e ef ldi r20, 0xFE ; 254 52d8: 0e 94 a8 0b call 0x1750 ; 0x1750 52dc: 0c c0 rjmp .+24 ; 0x52f6 } else { lcd_data('?'); // too big 52de: 8f e3 ldi r24, 0x3F ; 63 52e0: 0e 94 3f 0a call 0x147e ; 0x147e 52e4: 08 c0 rjmp .+16 ; 0x52f6 } } else { // no cap found lcd_clear_line1(); // clear old capacity value 52e6: 0e 94 a5 0a call 0x154a ; 0x154a lcd_MEM2_string(C_ESR_str); 52ea: 82 ec ldi r24, 0xC2 ; 194 52ec: 91 e0 ldi r25, 0x01 ; 1 52ee: 0e 94 bf 0a call 0x157e ; 0x157e lcd_clear_line2(); // clear old ESR value 52f2: 0e 94 ac 0a call 0x1558 ; 0x1558 } #if defined(POWER_OFF) && defined(BAT_CHECK) Bat_update(times); 52f6: 8c 2f mov r24, r28 52f8: 0e 94 39 30 call 0x6072 ; 0x6072 #endif key_pressed = wait_for_key_ms(1000); 52fc: 88 ee ldi r24, 0xE8 ; 232 52fe: 93 e0 ldi r25, 0x03 ; 3 5300: 0e 94 de 0e call 0x1dbc ; 0x1dbc #ifdef WITH_ROTARY_SWITCH if ((key_pressed != 0) || (rotary.incre > 3)) break; #else if (key_pressed != 0) break; 5304: 81 11 cpse r24, r1 5306: 04 c0 rjmp .+8 ; 0x5310 void show_C_ESR() { uint8_t key_pressed; message_key_released(C_ESR_str); #ifdef POWER_OFF uint8_t times; for (times=0;times<250;times++) 5308: cf 5f subi r28, 0xFF ; 255 530a: ca 3f cpi r28, 0xFA ; 250 530c: 09 f0 breq .+2 ; 0x5310 530e: a7 cf rjmp .-178 ; 0x525e if ((key_pressed != 0) || (rotary.incre > 3)) break; #else if (key_pressed != 0) break; #endif } /* end for times */ } /* end show_C_ESR() */ 5310: cf 91 pop r28 5312: 0f 91 pop r16 5314: 08 95 ret 00005316 : /* *************************************************** */ /* show_vext() read one or two input voltages from */ /* ADC input channel(s) TPext or (TPext and TPex2). */ /* For both inputs a 10:1 voltage divider is required. */ /* *************************************************** */ void show_vext() { 5316: 08 95 ret 00005318 : } /* end make frequency */ /* *************************************************** */ /* switch to a new frequency number and write actual frequency to LCD */ /* *************************************************** */ void switch_frequency(uint8_t freq_num) { 5318: 0f 93 push r16 if (freq_num > MAX_FREQ_NR) freq_num -= (MAX_FREQ_NR + 1); 531a: 84 31 cpi r24, 0x14 ; 20 531c: 08 f0 brcs .+2 ; 0x5320 531e: 84 51 subi r24, 0x14 ; 20 if (freq_num == 19) { 5320: 83 31 cpi r24, 0x13 ; 19 5322: 89 f4 brne .+34 ; 0x5346 // 2 MHz #undef F_TIM1 #define F_TIM1 (F_CPU) #define DIVIDER ((F_TIM1+2000000) / (2*2000000UL)) TCCR1B = (0< } // 1333.333kHz if (freq_num == 18) { 5346: 82 31 cpi r24, 0x12 ; 18 5348: 89 f4 brne .+34 ; 0x536c // 1 MHz #undef F_TIM1 #define F_TIM1 (F_CPU) #undef DIVIDER #define DIVIDER ((F_TIM1+1000000) / (2*1000000UL)) TCCR1B = (0< } // 800kHz, 666.666kHz if (freq_num == 17) { 536c: 81 31 cpi r24, 0x11 ; 17 536e: 69 f4 brne .+26 ; 0x538a // 500 kHz #undef F_TIM1 #define F_TIM1 (F_CPU) #undef DIVIDER #define DIVIDER ((F_TIM1+500000) / (2*500000UL)) TCCR1B = (0< } // 444.444kHz, 400kHz, 362.636kHz, 333.333kHz, 307.692kHz 285.714kHz if (freq_num == 16) { 538a: 80 31 cpi r24, 0x10 ; 16 538c: 69 f4 brne .+26 ; 0x53a8 // 250 kHz #undef F_TIM1 #define F_TIM1 (F_CPU) #undef DIVIDER #define DIVIDER ((F_TIM1+250000) / (2*250000UL)) TCCR1B = (0< } // 235.294kHz, 222.222kHz, 210.526kHz, 200kHz, 190.476kHz, 181.818kHz, 173.913kHz, 166.666kHz // 160kHz, 153.846kHz, 148.148kHz, 142.857kHz, 137.931kHz, 133.333kHz, 129.032kHz, 125kHz, // (33) 121.212kHz, 117.647kHz, 114.285kHz, 111.111kHz, 108.108kHz, 105.263kHz , 102.564kHz if (freq_num == 15) { 53a8: 8f 30 cpi r24, 0x0F ; 15 53aa: 89 f4 brne .+34 ; 0x53ce // 153.6 kHz (Baud rate clock for 9600 baud) #undef F_TIM1 #define F_TIM1 (F_CPU) #undef DIVIDER #define DIVIDER ((F_TIM1+153600) / (2*153600UL)) TCCR1B = (0< } if (freq_num == 14) { 53ce: 8e 30 cpi r24, 0x0E ; 14 53d0: 69 f4 brne .+26 ; 0x53ec // 100 kHz #undef DIVIDER #define DIVIDER ((F_TIM1+100000) / (2*100000UL)) TCCR1B = (0< } if (freq_num == 13) { 53ec: 8d 30 cpi r24, 0x0D ; 13 53ee: 69 f4 brne .+26 ; 0x540a // 50 kHz #undef DIVIDER #define DIVIDER ((F_TIM1+50000) / (2*50000UL)) TCCR1B = (0< } if (freq_num == 12) { 540a: 8c 30 cpi r24, 0x0C ; 12 540c: 69 f4 brne .+26 ; 0x5428 // 25 kHz #undef DIVIDER #define DIVIDER ((F_TIM1+25000) / (2*25000UL)) TCCR1B = (0< } if (freq_num == 11) { 5428: 8b 30 cpi r24, 0x0B ; 11 542a: 69 f4 brne .+26 ; 0x5446 // 10 kHz #undef DIVIDER #define DIVIDER ((F_TIM1+10000) / (2*10000UL)) TCCR1B = (0< } if (freq_num == 10) { 5446: 8a 30 cpi r24, 0x0A ; 10 5448: 89 f4 brne .+34 ; 0x546c // 5 kHz #undef DIVIDER #define DIVIDER ((F_TIM1+5000) / (2*5000UL)) TCCR1B = (0< } if (freq_num == 9) { 546c: 89 30 cpi r24, 0x09 ; 9 546e: 81 f4 brne .+32 ; 0x5490 // 2500 Hz #undef DIVIDER #define DIVIDER ((F_TIM1+2500) / (2*2500UL)) TCCR1B = (0< } if (freq_num == 8) { 5490: 88 30 cpi r24, 0x08 ; 8 5492: 89 f4 brne .+34 ; 0x54b6 // 1000 Hz #undef DIVIDER #define DIVIDER ((F_TIM1+1000) / (2*1000UL)) TCCR1B = (0< } if (freq_num == 7) { 54b6: 87 30 cpi r24, 0x07 ; 7 54b8: 89 f4 brne .+34 ; 0x54dc // 443 Hz #undef DIVIDER #define DIVIDER ((F_TIM1+443) / (2*443UL)) TCCR1B = (0< } if (freq_num == 6) { 54dc: 86 30 cpi r24, 0x06 ; 6 54de: 89 f4 brne .+34 ; 0x5502 // 442 Hz #undef DIVIDER #define DIVIDER ((F_TIM1+442) / (2*442UL)) TCCR1B = (0< } if (freq_num == 5) { 5502: 85 30 cpi r24, 0x05 ; 5 5504: 89 f4 brne .+34 ; 0x5528 // 440 Hz #undef DIVIDER #define DIVIDER ((F_TIM1+440) / (2*440UL)) TCCR1B = (0< } if (freq_num == 4) { 5528: 84 30 cpi r24, 0x04 ; 4 552a: 89 f4 brne .+34 ; 0x554e // 250 Hz #undef F_TIM1 #define F_TIM1 (F_CPU) #undef DIVIDER #define DIVIDER ((F_TIM1+250) / (2*250UL)) TCCR1B = (0< } // please use clock divider to build frequencies lower than 250 Hz (DIVIDER=64000 with 16MHz clock) if (freq_num == 3) { 554e: 83 30 cpi r24, 0x03 ; 3 5550: 69 f4 brne .+26 ; 0x556c // 100 Hz #undef F_TIM1 #define F_TIM1 (F_CPU/64) #undef DIVIDER #define DIVIDER ((F_TIM1+100) / (2*100UL)) TCCR1B = (0< } if (freq_num == 2) { 556c: 82 30 cpi r24, 0x02 ; 2 556e: 71 f4 brne .+28 ; 0x558c // 50 Hz #undef DIVIDER #define DIVIDER ((F_TIM1+50) / (2*50UL)) // TCCR1B = (0< } if (freq_num == 1) { 558c: 81 30 cpi r24, 0x01 ; 1 558e: 89 f4 brne .+34 ; 0x55b2 // 10 Hz #undef F_TIM1 #define F_TIM1 (F_CPU/64) #undef DIVIDER #define DIVIDER ((F_TIM1+10) / (2*10UL)) TCCR1B = (0< } if (freq_num == 0) { 55b2: 81 11 cpse r24, r1 55b4: 12 c0 rjmp .+36 ; 0x55da // 1 Hz #undef F_TIM1 #define F_TIM1 (F_CPU/256) #undef DIVIDER #define DIVIDER (F_TIM1 / (2*1UL)) TCCR1B = (0< } lcd_data('z'); // append the z to get Hz unit 55da: 8a e7 ldi r24, 0x7A ; 122 55dc: 0e 94 3f 0a call 0x147e ; 0x147e } /* end switch_frequency */ 55e0: 0f 91 pop r16 55e2: 08 95 ret 000055e4 : /* *************************************************** */ /* make frequency starts a frequency generator at TP2 with 680 Ohm resistor */ /* some predefined frequencies can be switched with the key */ /* a long key press returns to the selection menu */ /* *************************************************** */ void make_frequency() { 55e4: a0 e0 ldi r26, 0x00 ; 0 55e6: b0 e0 ldi r27, 0x00 ; 0 55e8: e8 ef ldi r30, 0xF8 ; 248 55ea: fa e2 ldi r31, 0x2A ; 42 55ec: 0c 94 48 39 jmp 0x7290 ; 0x7290 <__prologue_saves__+0x16> #define MAX_FREQ_NR 19 uint8_t key_pressed; uint8_t freq_nr; uint8_t old_freq; message_key_released(F_GEN_str); // display f-Generator and wait for key released 55f0: 84 e2 ldi r24, 0x24 ; 36 55f2: 94 e0 ldi r25, 0x04 ; 4 55f4: 0e 94 d1 2c call 0x59a2 ; 0x59a2 // OC1B is connected with 680 Ohm resistor to TP2 (middle test pin) TCCR1A = (0< 564e: f6 2e mov r15, r22 if (new_points != shown_points) { 5650: 62 17 cp r22, r18 5652: 71 f0 breq .+28 ; 0x5670 // count of points has changed, build LCD line1 new lcd_clear_line1(); // clear line 1 5654: 0e 94 a5 0a call 0x154a ; 0x154a lcd_MEM2_string(F_GEN_str); // display f-Generator 5658: 84 e2 ldi r24, 0x24 ; 36 565a: 94 e0 ldi r25, 0x04 ; 4 565c: 0e 94 bf 0a call 0x157e ; 0x157e shown_points = new_points; for (new_points=0; new_points lcd_data('.'); // show elapsed time, one point is 30 seconds 5666: 8e e2 ldi r24, 0x2E ; 46 5668: 0e 94 3f 0a call 0x147e ; 0x147e if (new_points != shown_points) { // count of points has changed, build LCD line1 new lcd_clear_line1(); // clear line 1 lcd_MEM2_string(F_GEN_str); // display f-Generator shown_points = new_points; for (new_points=0; new_points 5670: f2 2e mov r15, r18 } } #undef KEYPRESS_LENGTH_10ms #define KEYPRESS_LENGTH_10ms 20 /* change frequency only with >200ms key press */ #endif if (old_freq != freq_nr) { 5672: d1 16 cp r13, r17 5674: 21 f1 breq .+72 ; 0x56be // new frequency is selected if (freq_nr > MAX_FREQ_NR) freq_nr -= (MAX_FREQ_NR + 1); 5676: 14 31 cpi r17, 0x14 ; 20 5678: 08 f0 brcs .+2 ; 0x567c 567a: 14 51 subi r17, 0x14 ; 20 old_freq = freq_nr; // update the last active frequency number #if (LCD_LINES > 3) lcd_clear_line2(); // clear line 2 for previous frequency 567c: 0e 94 ac 0a call 0x1558 ; 0x1558 lcd_space(); // add a space to row 1 of line2 5680: 0e 94 8b 0a call 0x1516 ; 0x1516 switch_frequency(freq_nr + MAX_FREQ_NR); 5684: 83 e1 ldi r24, 0x13 ; 19 5686: 81 0f add r24, r17 5688: 0e 94 8c 29 call 0x5318 ; 0x5318 lcd_line4(); 568c: 0e 94 9b 08 call 0x1136 ; 0x1136 lcd_clear_line(); // clear line 4 for next frequency 5690: 0e 94 a1 0a call 0x1542 ; 0x1542 lcd_line4(); 5694: 0e 94 9b 08 call 0x1136 ; 0x1136 lcd_space(); // add a space to row 1 of line4 5698: 0e 94 8b 0a call 0x1516 ; 0x1516 switch_frequency(freq_nr + 1); 569c: 81 e0 ldi r24, 0x01 ; 1 569e: 81 0f add r24, r17 56a0: 0e 94 8c 29 call 0x5318 ; 0x5318 lcd_line3(); 56a4: 0e 94 90 08 call 0x1120 ; 0x1120 lcd_clear_line(); // clear line 3 for new frequency 56a8: 0e 94 a1 0a call 0x1542 ; 0x1542 lcd_line3(); 56ac: 0e 94 90 08 call 0x1120 ; 0x1120 lcd_data('>'); 56b0: 8e e3 ldi r24, 0x3E ; 62 56b2: 0e 94 3f 0a call 0x147e ; 0x147e switch_frequency(freq_nr); 56b6: 81 2f mov r24, r17 56b8: 0e 94 8c 29 call 0x5318 ; 0x5318 #define KEYPRESS_LENGTH_10ms 20 /* change frequency only with >200ms key press */ #endif if (old_freq != freq_nr) { // new frequency is selected if (freq_nr > MAX_FREQ_NR) freq_nr -= (MAX_FREQ_NR + 1); old_freq = freq_nr; // update the last active frequency number 56bc: d1 2e mov r13, r17 #else lcd_clear_line2(); // clear line 2 for next frequency switch_frequency(freq_nr); #endif } /* end if (old_freq != freq_nr) */ key_pressed = wait_for_key_ms(1000); 56be: 88 ee ldi r24, 0xE8 ; 232 56c0: 93 e0 ldi r25, 0x03 ; 3 56c2: 0e 94 de 0e call 0x1dbc ; 0x1dbc #ifdef POWER_OFF #ifdef WITH_ROTARY_SWITCH if ((key_pressed != 0) || (rotary.incre > 0)) times = 0; // reset counter, operator is active #else if (key_pressed != 0) times = 0; // reset counter, operator is active 56c6: 88 23 and r24, r24 56c8: 31 f0 breq .+12 ; 0x56d6 freq_nr += rotary.count; // increase the frequency number by rotary.count } else { freq_nr += (MAX_FREQ_NR + 1 + rotary.count); // decrease the frequency by rotary.count } #endif if (key_pressed > KEYPRESS_LENGTH_10ms) freq_nr++; // longer key press select next frequency 56ca: 85 31 cpi r24, 0x15 ; 21 56cc: 18 f0 brcs .+6 ; 0x56d4 56ce: 1f 5f subi r17, 0xFF ; 255 if(key_pressed >= 80) break; // more than 0.8 seconds 56d0: 80 35 cpi r24, 0x50 ; 80 56d2: 30 f4 brcc .+12 ; 0x56e0 key_pressed = wait_for_key_ms(1000); #ifdef POWER_OFF #ifdef WITH_ROTARY_SWITCH if ((key_pressed != 0) || (rotary.incre > 0)) times = 0; // reset counter, operator is active #else if (key_pressed != 0) times = 0; // reset counter, operator is active 56d4: 00 e0 ldi r16, 0x00 ; 0 #ifdef POWER_OFF uint8_t new_points; // one point for every 30 seconds wait time uint8_t shown_points; // one point for every 30 seconds wait time uint8_t times; // total wait time shown_points = 0; for (times=0; times<240; times++) 56d6: 0f 5f subi r16, 0xFF ; 255 56d8: 00 3f cpi r16, 0xF0 ; 240 56da: 10 f4 brcc .+4 ; 0x56e0 56dc: 2f 2d mov r18, r15 56de: b1 cf rjmp .-158 ; 0x5642 } #endif if (key_pressed > KEYPRESS_LENGTH_10ms) freq_nr++; // longer key press select next frequency if(key_pressed >= 80) break; // more than 0.8 seconds } /* end for times */ TCCR1B = 0; // stop counter 56e0: 10 92 81 00 sts 0x0081, r1 TCCR1A = 0; // stop counter 56e4: 10 92 80 00 sts 0x0080, r1 ADC_DDR = TXD_MSK; // disconnect TP1 56e8: 88 e0 ldi r24, 0x08 ; 8 56ea: 87 b9 out 0x07, r24 ; 7 R_DDR = 0; // switch resistor ports to Input 56ec: 14 b8 out 0x04, r1 ; 4 #if PROCESSOR_TYP == 1280 DDRB &= ~(1< 000056fa : /* do_10bit PWM */ /* a short key press increase the duty cycle with 1% */ /* a longer key press incrrase with 10% */ /* a very long key press returns to menue */ /* *************************************************** */ void do_10bit_PWM() { 56fa: a4 e0 ldi r26, 0x04 ; 4 56fc: b0 e0 ldi r27, 0x00 ; 0 56fe: e3 e8 ldi r30, 0x83 ; 131 5700: fb e2 ldi r31, 0x2B ; 43 5702: 0c 94 41 39 jmp 0x7282 ; 0x7282 <__prologue_saves__+0x8> uint8_t key_pressed; uint8_t percent; // requestet duty-cycle in % uint8_t old_perc; // old duty-cycle in % unsigned int pwm_flip; // value for counter to flip the state message_key_released(PWM_10bit_str); // display PWM-Generator and wait for key released 5706: 89 e1 ldi r24, 0x19 ; 25 5708: 94 e0 ldi r25, 0x04 ; 4 570a: 0e 94 d1 2c call 0x59a2 ; 0x59a2 // OC1B is connected with 680 Ohm resistor to TP2 (middle test pin) TCCR1A = (1<= 100) { percent -= 100; //reset to 0 percent or higher } pwm_flip = (((unsigned long)0x3ff * percent) + 50) / 100; 5756: 94 e6 ldi r25, 0x64 ; 100 5758: c9 2e mov r12, r25 575a: d1 2c mov r13, r1 575c: e1 2c mov r14, r1 575e: f1 2c mov r15, r1 OCR1B = pwm_flip; // new percentage lcd_clear_line2(); // clear line 2 DisplayValue((((unsigned long)pwm_flip * 1000) + 0x1ff) / 0x3ff,-1,'%',5); 5760: 88 24 eor r8, r8 5762: 8a 94 dec r8 5764: 23 e0 ldi r18, 0x03 ; 3 5766: 92 2e mov r9, r18 5768: a1 2c mov r10, r1 576a: b1 2c mov r11, r1 for (times=0; times<240; times++) #else while (1) /* wait endless without option POWER_OFF */ #endif { if (percent != old_perc) { 576c: 70 16 cp r7, r16 576e: d9 f1 breq .+118 ; 0x57e6 // new duty cycle is requested if (percent >= 100) { 5770: 83 e6 ldi r24, 0x63 ; 99 5772: 87 15 cp r24, r7 5774: 10 f4 brcc .+4 ; 0x577a percent -= 100; //reset to 0 percent or higher 5776: ec e9 ldi r30, 0x9C ; 156 5778: 7e 0e add r7, r30 } pwm_flip = (((unsigned long)0x3ff * percent) + 50) / 100; 577a: 27 2d mov r18, r7 577c: 30 e0 ldi r19, 0x00 ; 0 577e: af ef ldi r26, 0xFF ; 255 5780: b3 e0 ldi r27, 0x03 ; 3 5782: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 5786: 6e 5c subi r22, 0xCE ; 206 5788: 7f 4f sbci r23, 0xFF ; 255 578a: 8f 4f sbci r24, 0xFF ; 255 578c: 9f 4f sbci r25, 0xFF ; 255 578e: a7 01 movw r20, r14 5790: 96 01 movw r18, r12 5792: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> OCR1B = pwm_flip; // new percentage 5796: 30 93 8b 00 sts 0x008B, r19 579a: 20 93 8a 00 sts 0x008A, r18 lcd_clear_line2(); // clear line 2 579e: 29 83 std Y+1, r18 ; 0x01 57a0: 3a 83 std Y+2, r19 ; 0x02 57a2: 4b 83 std Y+3, r20 ; 0x03 57a4: 5c 83 std Y+4, r21 ; 0x04 57a6: 0e 94 ac 0a call 0x1558 ; 0x1558 DisplayValue((((unsigned long)pwm_flip * 1000) + 0x1ff) / 0x3ff,-1,'%',5); 57aa: a8 ee ldi r26, 0xE8 ; 232 57ac: b3 e0 ldi r27, 0x03 ; 3 57ae: 29 81 ldd r18, Y+1 ; 0x01 57b0: 3a 81 ldd r19, Y+2 ; 0x02 57b2: 4b 81 ldd r20, Y+3 ; 0x03 57b4: 5c 81 ldd r21, Y+4 ; 0x04 57b6: 0e 94 5a 38 call 0x70b4 ; 0x70b4 <__muluhisi3> 57ba: 61 50 subi r22, 0x01 ; 1 57bc: 7e 4f sbci r23, 0xFE ; 254 57be: 8f 4f sbci r24, 0xFF ; 255 57c0: 9f 4f sbci r25, 0xFF ; 255 57c2: a5 01 movw r20, r10 57c4: 94 01 movw r18, r8 57c6: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 57ca: ca 01 movw r24, r20 57cc: b9 01 movw r22, r18 57ce: 05 e0 ldi r16, 0x05 ; 5 57d0: 25 e2 ldi r18, 0x25 ; 37 57d2: 4f ef ldi r20, 0xFF ; 255 57d4: 0e 94 a8 0b call 0x1750 ; 0x1750 lcd_data('0'+rotary.state[kk]); // debugging output of rotary state kk = (kk + 1) & ROT_MSK; } while (kk != rotary.ind); #endif old_perc = percent; // update the old duty cycle if (key_pressed > 40) { 57d8: f8 e2 ldi r31, 0x28 ; 40 57da: f6 15 cp r31, r6 57dc: 18 f4 brcc .+6 ; 0x57e4 wait_about300ms(); // wait some time to release the button 57de: 8c e3 ldi r24, 0x3C ; 60 57e0: 0e 94 4a 0e call 0x1c94 ; 0x1c94 do { lcd_data('0'+rotary.state[kk]); // debugging output of rotary state kk = (kk + 1) & ROT_MSK; } while (kk != rotary.ind); #endif old_perc = percent; // update the old duty cycle 57e4: 07 2d mov r16, r7 if (key_pressed > 40) { wait_about300ms(); // wait some time to release the button } } /* end if percent != old_perc */ key_pressed = wait_for_key_ms(1600); 57e6: 80 e4 ldi r24, 0x40 ; 64 57e8: 96 e0 ldi r25, 0x06 ; 6 57ea: 0e 94 de 0e call 0x1dbc ; 0x1dbc 57ee: 68 2e mov r6, r24 if(key_pressed > 130) break; // more than 1.3 seconds 57f0: 82 e8 ldi r24, 0x82 ; 130 57f2: 86 15 cp r24, r6 57f4: 70 f0 brcs .+28 ; 0x5812 percent += rotary.count; // increase the duty cycle by rotary.count } else { percent += (100 + rotary.count); // decrease the duty cycle by rotary.count } #endif if (key_pressed > 50) { 57f6: e2 e3 ldi r30, 0x32 ; 50 57f8: e6 15 cp r30, r6 57fa: 18 f4 brcc .+6 ; 0x5802 percent += 10; // duty cycle will be increased with 10 57fc: fa e0 ldi r31, 0x0A ; 10 57fe: 7f 0e add r7, r31 5800: 03 c0 rjmp .+6 ; 0x5808 } else { if (key_pressed > 0) percent += 1; // duty cycle will be increased with 1 5802: 66 20 and r6, r6 5804: 11 f0 breq .+4 ; 0x580a 5806: 73 94 inc r7 } #ifdef POWER_OFF #ifdef WITH_ROTARY_SWITCH if ((key_pressed > 0) || (rotary.incre > 0)) times = 0; // reset the loop counter, operator is active #else if (key_pressed > 0) times = 0; //reset the loop counter, operator is active 5808: 10 e0 ldi r17, 0x00 ; 0 key_pressed = 0; old_perc = 0; percent = 10; #ifdef POWER_OFF uint8_t times; // time limit for (times=0; times<240; times++) 580a: 1f 5f subi r17, 0xFF ; 255 580c: 10 3f cpi r17, 0xF0 ; 240 580e: 08 f4 brcc .+2 ; 0x5812 5810: ad cf rjmp .-166 ; 0x576c if (key_pressed > 0) times = 0; //reset the loop counter, operator is active #endif #endif } /* end for times */ ADC_DDR = TXD_MSK; // disconnect TP1 5812: 88 e0 ldi r24, 0x08 ; 8 5814: 87 b9 out 0x07, r24 ; 7 TCCR1B = 0; // stop counter 5816: 10 92 81 00 sts 0x0081, r1 TCCR1A = 0; // stop counter 581a: 10 92 80 00 sts 0x0080, r1 R_DDR = 0; // switch resistor ports to Input 581e: 14 b8 out 0x04, r1 ; 4 #if PROCESSOR_TYP == 1280 DDRB &= ~(1< 0000582a : #if (LCD_ST_TYPE == 1306) #define MAX_CONTRAST 0xff #else #define MAX_CONTRAST 0x3f #endif void set_contrast(void) { 582a: 0f 93 push r16 582c: cf 93 push r28 582e: df 93 push r29 uint8_t key_pressed; uint8_t contrast; // set the contrast value message_key_released(CONTRAST_str); // display Contrast and wait for key released 5830: 84 ee ldi r24, 0xE4 ; 228 5832: 93 e0 ldi r25, 0x03 ; 3 5834: 0e 94 d1 2c call 0x59a2 ; 0x59a2 contrast = eeprom_read_byte(&EE_Volume_Value); 5838: 80 e0 ldi r24, 0x00 ; 0 583a: 90 e0 ldi r25, 0x00 ; 0 583c: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> 5840: c8 2f mov r28, r24 #ifdef POWER_OFF uint8_t times; for (times=0;times<240;times++) 5842: d0 e0 ldi r29, 0x00 ; 0 #else while (1) /* wait endless without option POWER_OFF */ #endif { #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306)) lcd_command(CMD_SET_VOLUME_FIRST); // 0x81 set volume command 5844: 81 e8 ldi r24, 0x81 ; 129 5846: 0e 94 e5 08 call 0x11ca ; 0x11ca lcd_command(contrast); // value from 1 to 63 (0x3f) */ 584a: 8c 2f mov r24, r28 584c: 0e 94 e5 08 call 0x11ca ; 0x11ca #else /* DOGM display */ lcd_command(CMD1_PowerControl | ((contrast>>4)&0x03)); // booster off / set contrast C5:C4 lcd_command(CMD1_SetContrast | (contrast&0x0f)); // set contrast C3:0 #endif lcd_clear_line2(); 5850: 0e 94 ac 0a call 0x1558 ; 0x1558 DisplayValue(contrast,0,' ',4); 5854: 8c 2f mov r24, r28 5856: 90 e0 ldi r25, 0x00 ; 0 5858: a0 e0 ldi r26, 0x00 ; 0 585a: b0 e0 ldi r27, 0x00 ; 0 585c: 04 e0 ldi r16, 0x04 ; 4 585e: 20 e2 ldi r18, 0x20 ; 32 5860: 40 e0 ldi r20, 0x00 ; 0 5862: bc 01 movw r22, r24 5864: cd 01 movw r24, r26 5866: 0e 94 a8 0b call 0x1750 ; 0x1750 key_pressed = wait_for_key_ms(1600); 586a: 80 e4 ldi r24, 0x40 ; 64 586c: 96 e0 ldi r25, 0x06 ; 6 586e: 0e 94 de 0e call 0x1dbc ; 0x1dbc #ifdef POWER_OFF #ifdef WITH_ROTARY_SWITCH if ((key_pressed != 0) || (rotary.incre > 0)) times = 0; // reset counter, operator is active #else if (key_pressed != 0) times = 0; // reset counter, operator is active 5872: 88 23 and r24, r24 5874: 31 f0 breq .+12 ; 0x5882 #endif #endif if(key_pressed >= 130) break; // more than 1.3 seconds 5876: 82 38 cpi r24, 0x82 ; 130 5878: 40 f4 brcc .+16 ; 0x588a } else { contrast += (MAX_CONTRAST + 1 + rotary.count); // decrease the contrast by rotary.count } #endif if (key_pressed > 0) { if (key_pressed > 40) { 587a: 89 32 cpi r24, 0x29 ; 41 587c: 78 f0 brcs .+30 ; 0x589c contrast++; // longer key press select higher contrast value 587e: cf 5f subi r28, 0xFF ; 255 key_pressed = wait_for_key_ms(1600); #ifdef POWER_OFF #ifdef WITH_ROTARY_SWITCH if ((key_pressed != 0) || (rotary.incre > 0)) times = 0; // reset counter, operator is active #else if (key_pressed != 0) times = 0; // reset counter, operator is active 5880: d0 e0 ldi r29, 0x00 ; 0 contrast++; // longer key press select higher contrast value } else { contrast += MAX_CONTRAST; // decrease the contrast } } contrast &= MAX_CONTRAST; 5882: cf 73 andi r28, 0x3F ; 63 // set the contrast value message_key_released(CONTRAST_str); // display Contrast and wait for key released contrast = eeprom_read_byte(&EE_Volume_Value); #ifdef POWER_OFF uint8_t times; for (times=0;times<240;times++) 5884: df 5f subi r29, 0xFF ; 255 5886: d0 3f cpi r29, 0xF0 ; 240 5888: e8 f2 brcs .-70 ; 0x5844 } } contrast &= MAX_CONTRAST; } /* end for times */ eeprom_write_byte((uint8_t *)(&EE_Volume_Value), (int8_t)contrast); // save contrast value 588a: 6c 2f mov r22, r28 588c: 80 e0 ldi r24, 0x00 ; 0 588e: 90 e0 ldi r25, 0x00 ; 0 5890: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> } 5894: df 91 pop r29 5896: cf 91 pop r28 5898: 0f 91 pop r16 589a: 08 95 ret #endif if (key_pressed > 0) { if (key_pressed > 40) { contrast++; // longer key press select higher contrast value } else { contrast += MAX_CONTRAST; // decrease the contrast 589c: c1 5c subi r28, 0xC1 ; 193 589e: f0 cf rjmp .-32 ; 0x5880 000058a0 : #endif #ifdef WITH_MENU /* ****************************************************************** */ /* ****************************************************************** */ void function_menu() { 58a0: 1f 93 push r17 58a2: cf 93 push r28 58a4: df 93 push r29 #endif func_number = 0; #ifdef POWER_OFF uint8_t ll; for (ll=0;ll<((MODE_LAST+1)*10);ll++) 58a6: d0 e0 ldi r29, 0x00 ; 0 #ifdef WITH_ROTARY_SWITCH rotary.count = 0; #endif #endif func_number = 0; 58a8: c0 e0 ldi r28, 0x00 ; 0 #else while (1) /* without end, if no power off specified */ #endif { if (func_number > MODE_LAST) func_number -= (MODE_LAST + 1); message_key_released(SELECTION_str); 58aa: 82 e6 ldi r24, 0x62 ; 98 58ac: 94 e0 ldi r25, 0x04 ; 4 58ae: 0e 94 d1 2c call 0x59a2 ; 0x59a2 } else { lcd_space(); // put a blank to 1. row of line 4 } message2line(p_nr); // show 3. page function #else /* no PAGE_MODE */ lcd_clear_line2(); // clear line 2 58b2: 0e 94 ac 0a call 0x1558 ; 0x1558 lcd_space(); // put a blank to 1. row of line 2 58b6: 0e 94 8b 0a call 0x1516 ; 0x1516 message2line(func_number + MODE_LAST); // show lower (previous) function 58ba: 8b e0 ldi r24, 0x0B ; 11 58bc: 8c 0f add r24, r28 58be: 0e 94 e7 28 call 0x51ce ; 0x51ce lcd_line3(); 58c2: 0e 94 90 08 call 0x1120 ; 0x1120 lcd_clear_line(); // clear line 3 58c6: 0e 94 a1 0a call 0x1542 ; 0x1542 lcd_line3(); // reset cursor to begin of line 3 58ca: 0e 94 90 08 call 0x1120 ; 0x1120 lcd_data('>'); // put a '>' marker to row 1 of line 3 58ce: 8e e3 ldi r24, 0x3E ; 62 58d0: 0e 94 3f 0a call 0x147e ; 0x147e message2line(func_number); // show selectable function 58d4: 8c 2f mov r24, r28 58d6: 0e 94 e7 28 call 0x51ce ; 0x51ce lcd_line4(); 58da: 0e 94 9b 08 call 0x1136 ; 0x1136 lcd_clear_line(); // clear line 4 58de: 0e 94 a1 0a call 0x1542 ; 0x1542 lcd_line4(); // reset cursor to begin of line 4 58e2: 0e 94 9b 08 call 0x1136 ; 0x1136 lcd_space(); // put a blank to 1. row of line 4 58e6: 0e 94 8b 0a call 0x1516 ; 0x1516 message2line(func_number + 1); // show higher (next) function 58ea: 11 e0 ldi r17, 0x01 ; 1 58ec: 1c 0f add r17, r28 58ee: 81 2f mov r24, r17 58f0: 0e 94 e7 28 call 0x51ce ; 0x51ce #else /* not LCD_LINES > 3 */ lcd_clear_line2(); // clear line 2 message2line(func_number); #endif /* (LCD_LINES > 3) */ #ifdef POWER_OFF ii = wait_for_key_ms(SHORT_WAIT_TIME); // wait about 5 seconds 58f4: 80 e4 ldi r24, 0x40 ; 64 58f6: 9f e1 ldi r25, 0x1F ; 31 58f8: 0e 94 de 0e call 0x1dbc ; 0x1dbc if (ii > 0) ll = 0; // reset timer, operator present 58fc: 88 23 and r24, r24 58fe: 09 f4 brne .+2 ; 0x5902 5900: 44 c0 rjmp .+136 ; 0x598a ii = wait_for_key_ms(0); // wait endless #endif #ifdef WITH_ROTARY_SWITCH if ((ii >= MIN_SELECT_TIME) || ((rotary_switch_present != 0) && (ii > 0))) #else if (ii >= MIN_SELECT_TIME) 5902: 82 33 cpi r24, 0x32 ; 50 5904: 08 f4 brcc .+2 ; 0x5908 5906: 3f c0 rjmp .+126 ; 0x5986 #endif { // selection only with key-press if (func_number == MODE_TRANS) break; // return to TransistorTester 5908: cc 23 and r28, r28 590a: 09 f4 brne .+2 ; 0x590e 590c: 46 c0 rjmp .+140 ; 0x599a if (func_number == MODE_FREQ) GetFrequency(0); 590e: c1 30 cpi r28, 0x01 ; 1 5910: 21 f4 brne .+8 ; 0x591a 5912: 80 e0 ldi r24, 0x00 ; 0 5914: 0e 94 a7 26 call 0x4d4e ; 0x4d4e 5918: 37 c0 rjmp .+110 ; 0x5988 #if PROCESSOR_TYP == 644 if (func_number == MODE_HFREQ) GetFrequency(1); // measure high frequency with 16:1 divider if (func_number == MODE_H_CRYSTAL) GetFrequency(5); // HF crystal input + 16:1 divider if (func_number == MODE_L_CRYSTAL) GetFrequency(6); // LF crystal input, 1:1 divider #endif if (func_number == MODE_FGEN) { 591a: c2 30 cpi r28, 0x02 ; 2 591c: 19 f4 brne .+6 ; 0x5924 make_frequency(); // make some sample frequencies 591e: 0e 94 f2 2a call 0x55e4 ; 0x55e4 5922: 32 c0 rjmp .+100 ; 0x5988 } if (func_number == MODE_PWM) { 5924: c3 30 cpi r28, 0x03 ; 3 5926: 19 f4 brne .+6 ; 0x592e do_10bit_PWM(); // generate 10bit PWM 5928: 0e 94 7d 2b call 0x56fa ; 0x56fa 592c: 2d c0 rjmp .+90 ; 0x5988 } if (func_number == MODE_ESR) { 592e: c4 30 cpi r28, 0x04 ; 4 5930: 19 f4 brne .+6 ; 0x5938 show_C_ESR(); // measure capacity and ESR at TP1 and TP3 5932: 0e 94 28 29 call 0x5250 ; 0x5250 5936: 28 c0 rjmp .+80 ; 0x5988 } if (func_number == MODE_RESIS) { 5938: c5 30 cpi r28, 0x05 ; 5 593a: 19 f4 brne .+6 ; 0x5942 show_Resis13(); // measure resistor at TP1 and TP3 593c: 0e 94 40 30 call 0x6080 ; 0x6080 5940: 23 c0 rjmp .+70 ; 0x5988 } if (func_number == MODE_CAP13) { 5942: c6 30 cpi r28, 0x06 ; 6 5944: 19 f4 brne .+6 ; 0x594c show_Cap13(); // measure capacitor at TP1 and TP3 5946: 0e 94 aa 30 call 0x6154 ; 0x6154 594a: 1e c0 rjmp .+60 ; 0x5988 } if (func_number == MODE_ROTARY) { 594c: c7 30 cpi r28, 0x07 ; 7 594e: 19 f4 brne .+6 ; 0x5956 CheckRotaryEncoder(); // check rotary encoder 5950: 0e 94 17 2e call 0x5c2e ; 0x5c2e 5954: 19 c0 rjmp .+50 ; 0x5988 } #ifdef WITH_SELFTEST if (func_number == MODE_SELFTEST) AutoCheck(0x11); // Full selftest with calibration 5956: c8 30 cpi r28, 0x08 ; 8 5958: 21 f4 brne .+8 ; 0x5962 595a: 81 e1 ldi r24, 0x11 ; 17 595c: 0e 94 36 10 call 0x206c ; 0x206c 5960: 13 c0 rjmp .+38 ; 0x5988 #endif if (func_number == MODE_VEXT) show_vext(); #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306) || defined(LCD_DOGM)) if (func_number == MODE_CONTRAST) set_contrast(); 5962: c9 30 cpi r28, 0x09 ; 9 5964: 19 f4 brne .+6 ; 0x596c 5966: 0e 94 15 2c call 0x582a ; 0x582a 596a: 0e c0 rjmp .+28 ; 0x5988 #endif if (func_number == MODE_SHOW) { 596c: ca 30 cpi r28, 0x0A ; 10 596e: 19 f4 brne .+6 ; 0x5976 ShowData(); // Show Calibration Data 5970: 0e 94 6d 2f call 0x5eda ; 0x5eda 5974: 09 c0 rjmp .+18 ; 0x5988 } if (func_number == MODE_OFF) { 5976: cb 30 cpi r28, 0x0B ; 11 5978: 39 f4 brne .+14 ; 0x5988 ON_PORT &= ~(1< 5984: 01 c0 rjmp .+2 ; 0x5988 func_number += rotary.count; // function number is increased by rotary steps } else { func_number += (MODE_LAST + 1 + rotary.count); // function is decreased by rotary steps } #endif if (ii > 0) func_number++; // increase the function number with key press 5986: c1 2f mov r28, r17 lcd_clear_line2(); // clear line 2 message2line(func_number); #endif /* (LCD_LINES > 3) */ #ifdef POWER_OFF ii = wait_for_key_ms(SHORT_WAIT_TIME); // wait about 5 seconds if (ii > 0) ll = 0; // reset timer, operator present 5988: d0 e0 ldi r29, 0x00 ; 0 #endif func_number = 0; #ifdef POWER_OFF uint8_t ll; for (ll=0;ll<((MODE_LAST+1)*10);ll++) 598a: df 5f subi r29, 0xFF ; 255 598c: d8 37 cpi r29, 0x78 ; 120 598e: 28 f4 brcc .+10 ; 0x599a #else while (1) /* without end, if no power off specified */ #endif { if (func_number > MODE_LAST) func_number -= (MODE_LAST + 1); 5990: cc 30 cpi r28, 0x0C ; 12 5992: 08 f4 brcc .+2 ; 0x5996 5994: 8a cf rjmp .-236 ; 0x58aa 5996: cc 50 subi r28, 0x0C ; 12 5998: 88 cf rjmp .-240 ; 0x58aa } #endif if (ii > 0) func_number++; // increase the function number with key press } /* end for ll */ return; } // end function_menu() 599a: df 91 pop r29 599c: cf 91 pop r28 599e: 1f 91 pop r17 59a0: 08 95 ret 000059a2 : //================================================================= // Clear display, show Message XX_str and wait for key release #if FLASHEND > 0x3fff void message_key_released(const unsigned char XX_str[]) { 59a2: a2 e0 ldi r26, 0x02 ; 2 59a4: b0 e0 ldi r27, 0x00 ; 0 59a6: e7 ed ldi r30, 0xD7 ; 215 59a8: fc e2 ldi r31, 0x2C ; 44 59aa: 0c 94 4c 39 jmp 0x7298 ; 0x7298 <__prologue_saves__+0x1e> // lcd_clear_line(); // lcd_line2(); // lcd_clear_line(); // lcd_line1(); //#else lcd_clear(); 59ae: 89 83 std Y+1, r24 ; 0x01 59b0: 9a 83 std Y+2, r25 ; 0x02 59b2: 0e 94 f9 08 call 0x11f2 ; 0x11f2 //#endif lcd_MEM2_string(XX_str); // display MEM2_str in row 1 59b6: 89 81 ldd r24, Y+1 ; 0x01 59b8: 9a 81 ldd r25, Y+2 ; 0x02 59ba: 0e 94 bf 0a call 0x157e ; 0x157e 59be: 14 e6 ldi r17, 0x64 ; 100 for (times=0;times<100;times++) { wait_about10ms(); 59c0: 82 e0 ldi r24, 0x02 ; 2 59c2: 0e 94 4a 0e call 0x1c94 ; 0x1c94 if((RST_PIN_REG & (1< 59ca: 11 50 subi r17, 0x01 ; 1 // lcd_line1(); //#else lcd_clear(); //#endif lcd_MEM2_string(XX_str); // display MEM2_str in row 1 for (times=0;times<100;times++) { 59cc: c9 f7 brne .-14 ; 0x59c0 wait_about10ms(); if((RST_PIN_REG & (1< return; } /* end message_key_released() */ 59d2: 22 96 adiw r28, 0x02 ; 2 59d4: e3 e0 ldi r30, 0x03 ; 3 59d6: 0c 94 68 39 jmp 0x72d0 ; 0x72d0 <__epilogue_restores__+0x1e> 000059da : #include "Transistortester.h" #ifdef WITH_MENU //================================================================= void ReadBigCap(uint8_t HighPin, uint8_t LowPin) { 59da: a0 e0 ldi r26, 0x00 ; 0 59dc: b0 e0 ldi r27, 0x00 ; 0 59de: e3 ef ldi r30, 0xF3 ; 243 59e0: fc e2 ldi r31, 0x2C ; 44 59e2: 0c 94 44 39 jmp 0x7288 ; 0x7288 <__prologue_saves__+0xe> 59e6: c8 2f mov r28, r24 59e8: d6 2f mov r29, r22 #endif uint8_t HiPinR_L; uint8_t LoADC; #ifdef AUTO_CAL pin_combination = (HighPin * 3) + LowPin - 1; // coded Pin combination for capacity zero offset 59ea: 8f ef ldi r24, 0xFF ; 255 59ec: 86 0f add r24, r22 59ee: 9c 2f mov r25, r28 59f0: 99 0f add r25, r25 59f2: 9c 0f add r25, r28 59f4: 89 0f add r24, r25 59f6: 80 93 5c 01 sts 0x015C, r24 #endif #if (((PIN_RL1 + 1) != PIN_RH1) || ((PIN_RL2 + 1) != PIN_RH2) || ((PIN_RL3 + 1) != PIN_RH3)) LoADC = pgm_read_byte((&PinRLRHADCtab[6])+LowPin) | TXD_MSK; #else LoADC = pgm_read_byte((&PinRLRHADCtab[3])+LowPin) | TXD_MSK; 59fa: e6 2f mov r30, r22 59fc: f0 e0 ldi r31, 0x00 ; 0 59fe: e1 5a subi r30, 0xA1 ; 161 5a00: fe 4f sbci r31, 0xFE ; 254 5a02: 14 91 lpm r17, Z 5a04: 18 60 ori r17, 0x08 ; 8 #endif HiPinR_L = pgm_read_byte(&PinRLRHADCtab[HighPin]); //R_L mask for HighPin R_L load 5a06: ec 2f mov r30, r28 5a08: f0 e0 ldi r31, 0x00 ; 0 5a0a: e4 5a subi r30, 0xA4 ; 164 5a0c: fe 4f sbci r31, 0xFE ; 254 5a0e: b4 90 lpm r11, Z #if FLASHEND > 0x1fff cap.esr = 0; // set ESR of capacitor to zero 5a10: 10 92 8c 01 sts 0x018C, r1 5a14: 10 92 8b 01 sts 0x018B, r1 #endif cap.cval = 0; // set capacity value to zero 5a18: 10 92 7f 01 sts 0x017F, r1 5a1c: 10 92 80 01 sts 0x0180, r1 5a20: 10 92 81 01 sts 0x0181, r1 5a24: 10 92 82 01 sts 0x0182, r1 cap.cpre = -9; //default unit is nF 5a28: 87 ef ldi r24, 0xF7 ; 247 5a2a: 80 93 91 01 sts 0x0191, r24 EntladePins(); // discharge capacitor 5a2e: 0e 94 20 1d call 0x3a40 ; 0x3a40 ADC_PORT = TXD_VAL; // switch ADC-Port to GND 5a32: 88 e0 ldi r24, 0x08 ; 8 5a34: 88 b9 out 0x08, r24 ; 8 R_PORT = 0; // switch R-Port to GND 5a36: 15 b8 out 0x05, r1 ; 5 ADC_DDR = LoADC; // switch Low-Pin to output (GND) 5a38: 17 b9 out 0x07, r17 ; 7 // R_DDR = HiPinR_L; // switch R_L port for HighPin to output (GND) R_DDR = 0; // set all R Ports to input (no current) 5a3a: 14 b8 out 0x04, r1 ; 4 adcv[0] = ReadADC(HighPin); // voltage before any load 5a3c: 8c 2f mov r24, r28 5a3e: 0e 94 80 0e call 0x1d00 ; 0x1d00 5a42: 8c 01 movw r16, r24 adcv[2] = adcv[0]; // preset to prevent compiler warning ovcnt16 = 0; 5a44: 10 92 5e 01 sts 0x015E, r1 5a48: 10 92 5d 01 sts 0x015D, r1 ADC_PORT = TXD_VAL; // switch ADC-Port to GND R_PORT = 0; // switch R-Port to GND ADC_DDR = LoADC; // switch Low-Pin to output (GND) // R_DDR = HiPinR_L; // switch R_L port for HighPin to output (GND) R_DDR = 0; // set all R Ports to input (no current) adcv[0] = ReadADC(HighPin); // voltage before any load 5a4c: 9c 01 movw r18, r24 ovcnt16 = 0; #define MAX_LOAD_TIME 12500 #define MIN_VOLTAGE 300 while (ovcnt16 < MAX_LOAD_TIME) { R_PORT = HiPinR_L; //R_L to 1 (VCC) if ((ovcnt16 == 0) || ((MIN_VOLTAGE-adcv[2]) < (adcv[2]*10/ovcnt16))) { 5a4e: 9c e2 ldi r25, 0x2C ; 44 5a50: e9 2e mov r14, r25 5a52: ff 24 eor r15, r15 5a54: f3 94 inc r15 5a56: 4a e0 ldi r20, 0x0A ; 10 5a58: a4 2e mov r10, r20 R_DDR = HiPinR_L; //switch Pin to output, across R to VCC wait200us(); // wait exactly 0.2ms, do not sleep R_DDR = 0; // switch back to input ovcnt16++; } else if ((ovcnt16 > 10) && ((MIN_VOLTAGE-adcv[2]) > ((adcv[2]*100)/ovcnt16))){ 5a5a: 54 e6 ldi r21, 0x64 ; 100 5a5c: 95 2e mov r9, r21 adcv[2] = adcv[0]; // preset to prevent compiler warning ovcnt16 = 0; #define MAX_LOAD_TIME 12500 #define MIN_VOLTAGE 300 while (ovcnt16 < MAX_LOAD_TIME) { 5a5e: 80 91 5d 01 lds r24, 0x015D 5a62: 90 91 5e 01 lds r25, 0x015E 5a66: 84 3d cpi r24, 0xD4 ; 212 5a68: 90 43 sbci r25, 0x30 ; 48 5a6a: 08 f0 brcs .+2 ; 0x5a6e 5a6c: 6f c0 rjmp .+222 ; 0x5b4c R_PORT = HiPinR_L; //R_L to 1 (VCC) 5a6e: b5 b8 out 0x05, r11 ; 5 if ((ovcnt16 == 0) || ((MIN_VOLTAGE-adcv[2]) < (adcv[2]*10/ovcnt16))) { 5a70: 80 91 5d 01 lds r24, 0x015D 5a74: 90 91 5e 01 lds r25, 0x015E 5a78: 89 2b or r24, r25 5a7a: 89 f0 breq .+34 ; 0x5a9e 5a7c: 67 01 movw r12, r14 5a7e: c2 1a sub r12, r18 5a80: d3 0a sbc r13, r19 5a82: 60 91 5d 01 lds r22, 0x015D 5a86: 70 91 5e 01 lds r23, 0x015E 5a8a: a2 9e mul r10, r18 5a8c: c0 01 movw r24, r0 5a8e: a3 9e mul r10, r19 5a90: 90 0d add r25, r0 5a92: 11 24 eor r1, r1 5a94: 0e 94 75 38 call 0x70ea ; 0x70ea <__udivmodhi4> 5a98: c6 16 cp r12, r22 5a9a: d7 06 cpc r13, r23 5a9c: 50 f4 brcc .+20 ; 0x5ab2 R_DDR = HiPinR_L; //switch Pin to output, across R to VCC 5a9e: b4 b8 out 0x04, r11 ; 4 wait200us(); // wait exactly 0.2ms, do not sleep 5aa0: 0e 94 3d 0e call 0x1c7a ; 0x1c7a R_DDR = 0; // switch back to input 5aa4: 14 b8 out 0x04, r1 ; 4 ovcnt16++; 5aa6: 80 91 5d 01 lds r24, 0x015D 5aaa: 90 91 5e 01 lds r25, 0x015E 5aae: 01 96 adiw r24, 0x01 ; 1 5ab0: 28 c0 rjmp .+80 ; 0x5b02 } else if ((ovcnt16 > 10) && ((MIN_VOLTAGE-adcv[2]) > ((adcv[2]*100)/ovcnt16))){ 5ab2: 80 91 5d 01 lds r24, 0x015D 5ab6: 90 91 5e 01 lds r25, 0x015E 5aba: 0b 97 sbiw r24, 0x0b ; 11 5abc: c8 f0 brcs .+50 ; 0x5af0 5abe: 60 91 5d 01 lds r22, 0x015D 5ac2: 70 91 5e 01 lds r23, 0x015E 5ac6: 92 9e mul r9, r18 5ac8: c0 01 movw r24, r0 5aca: 93 9e mul r9, r19 5acc: 90 0d add r25, r0 5ace: 11 24 eor r1, r1 5ad0: 0e 94 75 38 call 0x70ea ; 0x70ea <__udivmodhi4> 5ad4: 6c 15 cp r22, r12 5ad6: 7d 05 cpc r23, r13 5ad8: 58 f4 brcc .+22 ; 0x5af0 R_DDR = HiPinR_L; //switch Pin to output, across R to VCC 5ada: b4 b8 out 0x04, r11 ; 4 wait20ms(); // wait exactly 20ms, do not sleep 5adc: 0e 94 33 0e call 0x1c66 ; 0x1c66 R_DDR = 0; // switch back to input 5ae0: 14 b8 out 0x04, r1 ; 4 ovcnt16 += 100; 5ae2: 80 91 5d 01 lds r24, 0x015D 5ae6: 90 91 5e 01 lds r25, 0x015E 5aea: 8c 59 subi r24, 0x9C ; 156 5aec: 9f 4f sbci r25, 0xFF ; 255 5aee: 09 c0 rjmp .+18 ; 0x5b02 } else { R_DDR = HiPinR_L; //switch Pin to output, across R to VCC 5af0: b4 b8 out 0x04, r11 ; 4 wait2ms(); // wait exactly 2ms, do not sleep 5af2: 0e 94 38 0e call 0x1c70 ; 0x1c70 R_DDR = 0; // switch back to input 5af6: 14 b8 out 0x04, r1 ; 4 ovcnt16 += 10; 5af8: 80 91 5d 01 lds r24, 0x015D 5afc: 90 91 5e 01 lds r25, 0x015E 5b00: 0a 96 adiw r24, 0x0a ; 10 5b02: 90 93 5e 01 sts 0x015E, r25 5b06: 80 93 5d 01 sts 0x015D, r24 } R_PORT = 0; // no Pull up 5b0a: 15 b8 out 0x05, r1 ; 5 wait50us(); //wait a little time 5b0c: 0e 94 3f 0e call 0x1c7e ; 0x1c7e wdt_reset(); 5b10: a8 95 wdr // read voltage without current, is already charged enough? adcv[2] = ReadADC(HighPin); 5b12: 8c 2f mov r24, r28 5b14: 0e 94 80 0e call 0x1d00 ; 0x1d00 if (adcv[2] > adcv[0]) { 5b18: 08 17 cp r16, r24 5b1a: 19 07 cpc r17, r25 5b1c: 20 f4 brcc .+8 ; 0x5b26 adcv[2] -= adcv[0]; //difference to beginning voltage 5b1e: 9c 01 movw r18, r24 5b20: 20 1b sub r18, r16 5b22: 31 0b sbc r19, r17 5b24: 02 c0 rjmp .+4 ; 0x5b2a } else { adcv[2] = 0; // voltage is lower or same as beginning voltage 5b26: 20 e0 ldi r18, 0x00 ; 0 5b28: 30 e0 ldi r19, 0x00 ; 0 } if ((ovcnt16 > (MAX_LOAD_TIME/8)) && (adcv[2] < (MIN_VOLTAGE/8))) { 5b2a: 80 91 5d 01 lds r24, 0x015D 5b2e: 90 91 5e 01 lds r25, 0x015E 5b32: 8b 31 cpi r24, 0x1B ; 27 5b34: 96 40 sbci r25, 0x06 ; 6 5b36: 20 f0 brcs .+8 ; 0x5b40 5b38: 25 32 cpi r18, 0x25 ; 37 5b3a: 31 05 cpc r19, r1 5b3c: 08 f4 brcc .+2 ; 0x5b40 5b3e: 6d c0 rjmp .+218 ; 0x5c1a // 300mV can not be reached well-timed break; // don't try to load any more } // probably 50mF can be charged well-timed if (adcv[2] > MIN_VOLTAGE) { 5b40: 2d 32 cpi r18, 0x2D ; 45 5b42: 81 e0 ldi r24, 0x01 ; 1 5b44: 38 07 cpc r19, r24 5b46: 08 f4 brcc .+2 ; 0x5b4a 5b48: 8a cf rjmp .-236 ; 0x5a5e 5b4a: 05 c0 rjmp .+10 ; 0x5b56 } } // wait 5ms and read voltage again, does the capacitor keep the voltage? // adcv[1] = W5msReadADC(HighPin) - adcv[0]; // wdt_reset(); if (adcv[2] <= MIN_VOLTAGE) { 5b4c: 2d 32 cpi r18, 0x2D ; 45 5b4e: 81 e0 ldi r24, 0x01 ; 1 5b50: 38 07 cpc r19, r24 5b52: 08 f4 brcc .+2 ; 0x5b56 5b54: 62 c0 rjmp .+196 ; 0x5c1a goto keinC; // was never charged enough, >20mF or shorted } //voltage is rised properly and keeps the voltage enough if ((ovcnt16 == 1 ) && (adcv[2] > 1300)) { 5b56: 80 91 5d 01 lds r24, 0x015D 5b5a: 90 91 5e 01 lds r25, 0x015E 5b5e: 01 97 sbiw r24, 0x01 ; 1 5b60: 29 f4 brne .+10 ; 0x5b6c 5b62: 25 31 cpi r18, 0x15 ; 21 5b64: 45 e0 ldi r20, 0x05 ; 5 5b66: 34 07 cpc r19, r20 5b68: 08 f0 brcs .+2 ; 0x5b6c 5b6a: 57 c0 rjmp .+174 ; 0x5c1a goto keinC; // Voltage of more than 1300mV is reached in one pulse, too fast loaded } // Capacity is more than about 50µF cap.cval_uncorrected.dw = ovcnt16*2; 5b6c: 00 91 5d 01 lds r16, 0x015D 5b70: 10 91 5e 01 lds r17, 0x015E 5b74: 00 0f add r16, r16 5b76: 11 1f adc r17, r17 5b78: a8 01 movw r20, r16 5b7a: 60 e0 ldi r22, 0x00 ; 0 5b7c: 70 e0 ldi r23, 0x00 ; 0 5b7e: 40 93 87 01 sts 0x0187, r20 5b82: 50 93 88 01 sts 0x0188, r21 5b86: 60 93 89 01 sts 0x0189, r22 5b8a: 70 93 8a 01 sts 0x018A, r23 // compute factor with load voltage + lost voltage during the voltage load time cap.cval_uncorrected.dw *= GetRLmultip(adcv[2]); // get factor to convert time to capacity from table 5b8e: c9 01 movw r24, r18 5b90: 0e 94 ef 20 call 0x41de ; 0x41de 5b94: 9c 01 movw r18, r24 5b96: d8 01 movw r26, r16 5b98: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 5b9c: 60 93 87 01 sts 0x0187, r22 5ba0: 70 93 88 01 sts 0x0188, r23 5ba4: 80 93 89 01 sts 0x0189, r24 5ba8: 90 93 8a 01 sts 0x018A, r25 cap.cval = cap.cval_uncorrected.dw; // set result to uncorrected 5bac: 60 93 7f 01 sts 0x017F, r22 5bb0: 70 93 80 01 sts 0x0180, r23 5bb4: 80 93 81 01 sts 0x0181, r24 5bb8: 90 93 82 01 sts 0x0182, r25 Scale_C_with_vcc(); 5bbc: 0e 94 ad 1d call 0x3b5a ; 0x3b5a // cap.cval for this type is at least 40000nF, so the last digit will be never shown cap.cval -= ((cap.cval * C_H_KORR) / 1000); // correct with C_H_KORR with 0.1% resolution, but prevent overflow cap.cval /= 10; 5bc0: 60 91 7f 01 lds r22, 0x017F 5bc4: 70 91 80 01 lds r23, 0x0180 5bc8: 80 91 81 01 lds r24, 0x0181 5bcc: 90 91 82 01 lds r25, 0x0182 5bd0: 2a e0 ldi r18, 0x0A ; 10 5bd2: 30 e0 ldi r19, 0x00 ; 0 5bd4: 40 e0 ldi r20, 0x00 ; 0 5bd6: 50 e0 ldi r21, 0x00 ; 0 5bd8: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 5bdc: 20 93 7f 01 sts 0x017F, r18 5be0: 30 93 80 01 sts 0x0180, r19 5be4: 40 93 81 01 sts 0x0181, r20 5be8: 50 93 82 01 sts 0x0182, r21 //================================================================================== PartFound = PART_CAPACITOR; //capacitor is found 5bec: 87 e0 ldi r24, 0x07 ; 7 5bee: 80 93 20 01 sts 0x0120, r24 cap.cval_max = cap.cval; 5bf2: 20 93 83 01 sts 0x0183, r18 5bf6: 30 93 84 01 sts 0x0184, r19 5bfa: 40 93 85 01 sts 0x0185, r20 5bfe: 50 93 86 01 sts 0x0186, r21 cap.cpre_max = cap.cpre; 5c02: 80 91 91 01 lds r24, 0x0191 5c06: 80 93 92 01 sts 0x0192, r24 #if FLASHEND > 0x1fff cap.v_loss = 0; // set lost voltage to zero 5c0a: 10 92 8e 01 sts 0x018E, r1 5c0e: 10 92 8d 01 sts 0x018D, r1 #endif cap.ca = LowPin; // save LowPin 5c12: d0 93 8f 01 sts 0x018F, r29 cap.cb = HighPin; // save HighPin 5c16: c0 93 90 01 sts 0x0190, r28 keinC: // discharge capacitor again // EntladePins(); // discharge capacitors //ready // switch all ports to input ADC_DDR = TXD_MSK; // switch all ADC ports to input 5c1a: 88 e0 ldi r24, 0x08 ; 8 5c1c: 87 b9 out 0x07, r24 ; 7 ADC_PORT = TXD_VAL; // switch all ADC outputs to GND, no pull up 5c1e: 88 b9 out 0x08, r24 ; 8 R_DDR = 0; // switch all resistor ports to input 5c20: 14 b8 out 0x04, r1 ; 4 R_PORT = 0; // switch all resistor outputs to GND, no pull up 5c22: 15 b8 out 0x05, r1 ; 5 return; } // end ReadBigCap() 5c24: cd b7 in r28, 0x3d ; 61 5c26: de b7 in r29, 0x3e ; 62 5c28: eb e0 ldi r30, 0x0B ; 11 5c2a: 0c 94 60 39 jmp 0x72c0 ; 0x72c0 <__epilogue_restores__+0xe> 00005c2e : //================================================================= // CheckRotaryEndoder #ifdef WITH_MENU void CheckRotaryEncoder(void) { 5c2e: a8 e1 ldi r26, 0x18 ; 24 5c30: b0 e0 ldi r27, 0x00 ; 0 5c32: ed e1 ldi r30, 0x1D ; 29 5c34: fe e2 ldi r31, 0x2E ; 46 5c36: 0c 94 43 39 jmp 0x7286 ; 0x7286 <__prologue_saves__+0xc> uint8_t switch1; // pin number of first switch uint8_t switch2; // pin number of second switch uint8_t switchm; // common pin number of both switches unsigned int kk; // loop counter for polling the pins message_key_released(RotaryEncoder_str); // RotaryEncoder in line 1 5c3a: 8a e0 ldi r24, 0x0A ; 10 5c3c: 94 e0 ldi r25, 0x04 ; 4 5c3e: 0e 94 d1 2c call 0x59a2 ; 0x59a2 lcd_line2(); 5c42: 0e 94 85 08 call 0x110a ; 0x110a lcd_MEM_string(TURN_str); // "turn!" at line 2 of LCD 5c46: 84 e0 ldi r24, 0x04 ; 4 5c48: 94 e0 ldi r25, 0x04 ; 4 5c4a: 0e 94 bf 0a call 0x157e ; 0x157e 5c4e: de 01 movw r26, r28 5c50: 51 96 adiw r26, 0x11 ; 17 5c52: ce 01 movw r24, r28 5c54: 09 96 adiw r24, 0x09 ; 9 5c56: ae 01 movw r20, r28 5c58: 4f 5f subi r20, 0xFF ; 255 5c5a: 5f 4f sbci r21, 0xFF ; 255 5c5c: 9e 01 movw r18, r28 5c5e: 27 5e subi r18, 0xE7 ; 231 5c60: 3f 4f sbci r19, 0xFF ; 255 5c62: f4 2e mov r15, r20 5c64: e5 2e mov r14, r21 lcd_refresh(); // write the pixels to display, ST7920 only for (ii=0;ii<4;ii++) { TP13tab[ii] = 0; //reset count of bit TP1:TP3 to zero 5c66: 1d 92 st X+, r1 5c68: 1d 92 st X+, r1 TP23tab[ii] = 0; //reset count of bit TP2:TP3 to zero 5c6a: fc 01 movw r30, r24 5c6c: 11 92 st Z+, r1 5c6e: 11 92 st Z+, r1 5c70: cf 01 movw r24, r30 TP12tab[ii] = 0; //reset count of bit TP1:TP2 to zero 5c72: fa 01 movw r30, r20 5c74: 11 92 st Z+, r1 5c76: 11 92 st Z+, r1 5c78: af 01 movw r20, r30 message_key_released(RotaryEncoder_str); // RotaryEncoder in line 1 lcd_line2(); lcd_MEM_string(TURN_str); // "turn!" at line 2 of LCD lcd_refresh(); // write the pixels to display, ST7920 only for (ii=0;ii<4;ii++) { 5c7a: a2 17 cp r26, r18 5c7c: b3 07 cpc r27, r19 5c7e: 99 f7 brne .-26 ; 0x5c66 TP13tab[ii] = 0; //reset count of bit TP1:TP3 to zero TP23tab[ii] = 0; //reset count of bit TP2:TP3 to zero TP12tab[ii] = 0; //reset count of bit TP1:TP2 to zero } R_PORT = (1< // look, what the other two levels are (TP2 and TP3) index = 0; // index for both switches closed ii = ADC_PIN; // Read port 5ca4: 86 b1 in r24, 0x06 ; 6 if ((ii & (1< 5cb0: 93 94 inc r9 5cb2: 93 94 inc r9 if (kk == 0) { 5cb4: 01 15 cp r16, r1 5cb6: 11 05 cpc r17, r1 5cb8: 89 f0 breq .+34 ; 0x5cdc start_index23 = index; // save the start state } else { if (index != start_index23) { 5cba: 98 14 cp r9, r8 5cbc: 69 f0 breq .+26 ; 0x5cd8 TP23tab[index]++; // add one to the found state of TP2:TP3 5cbe: ef 2d mov r30, r15 5cc0: fe 2d mov r31, r14 5cc2: e9 0d add r30, r9 5cc4: f1 1d adc r31, r1 5cc6: e9 0d add r30, r9 5cc8: f1 1d adc r31, r1 5cca: 80 85 ldd r24, Z+8 ; 0x08 5ccc: 91 85 ldd r25, Z+9 ; 0x09 5cce: 01 96 adiw r24, 0x01 ; 1 5cd0: 91 87 std Z+9, r25 ; 0x09 5cd2: 80 87 std Z+8, r24 ; 0x08 5cd4: 98 2c mov r9, r8 5cd6: 02 c0 rjmp .+4 ; 0x5cdc } else { start_index23 = 4; // now every state will be counted 5cd8: 34 e0 ldi r19, 0x04 ; 4 5cda: 93 2e mov r9, r19 } } ADC_DDR = (1< // look, what the other two levels are (TP1 and TP3) index = 0; // index for both switches closed ii = ADC_PIN; // Read port 5ce2: 96 b1 in r25, 0x06 ; 6 if ((ii & (1< TP13tab[index]++; //add one to the found state of TP1:TP3 5cf2: ef 2d mov r30, r15 5cf4: fe 2d mov r31, r14 5cf6: e8 0f add r30, r24 5cf8: f1 1d adc r31, r1 5cfa: e8 0f add r30, r24 5cfc: f1 1d adc r31, r1 5cfe: 80 89 ldd r24, Z+16 ; 0x10 5d00: 91 89 ldd r25, Z+17 ; 0x11 5d02: 01 96 adiw r24, 0x01 ; 1 5d04: 91 8b std Z+17, r25 ; 0x11 5d06: 80 8b std Z+16, r24 ; 0x10 } ADC_DDR = (1< // look, what the other two levels are (TP1 and TP3) index = 0; // index for both switches closed ii = ADC_PIN; // Read port 5d0e: 96 b1 in r25, 0x06 ; 6 if ((ii & (1< TP12tab[index]++; //add one to the found state of TP1:TP2 5d1e: ef 2d mov r30, r15 5d20: fe 2d mov r31, r14 5d22: e8 0f add r30, r24 5d24: f1 1d adc r31, r1 5d26: e8 0f add r30, r24 5d28: f1 1d adc r31, r1 5d2a: 80 81 ld r24, Z 5d2c: 91 81 ldd r25, Z+1 ; 0x01 5d2e: 01 96 adiw r24, 0x01 ; 1 5d30: 91 83 std Z+1, r25 ; 0x01 5d32: 80 83 st Z, r24 } wdt_reset(); 5d34: a8 95 wdr wait1ms(); // wait a little for next sample 5d36: 0e 94 39 0e call 0x1c72 ; 0x1c72 if ((RST_PIN_REG & (1< taste = wait_for_key_ms(400); // this state is monitored only for a short time } if (taste != 0) break; } /* end for ii */ end_rotary: R_PORT = 0; // all resistor ports to GND 5d3e: 15 b8 out 0x05, r1 ; 5 R_DDR = 0; // all resistor ports to input 5d40: 14 b8 out 0x04, r1 ; 4 ADC_DDR = TXD_MSK; // switch ADC port to input 5d42: 88 e0 ldi r24, 0x08 ; 8 5d44: 87 b9 out 0x07, r24 ; 7 5d46: c5 c0 rjmp .+394 ; 0x5ed2 TP12tab[index]++; //add one to the found state of TP1:TP2 } wdt_reset(); wait1ms(); // wait a little for next sample if ((RST_PIN_REG & (1< 20) &&(TP13tab[1] > 20) && (TP13tab[2] > 20) && (TP13tab[3] > 20)) { 5d48: 49 89 ldd r20, Y+17 ; 0x11 5d4a: 5a 89 ldd r21, Y+18 ; 0x12 5d4c: 45 31 cpi r20, 0x15 ; 21 5d4e: 51 05 cpc r21, r1 5d50: 08 f1 brcs .+66 ; 0x5d94 5d52: 6b 89 ldd r22, Y+19 ; 0x13 5d54: 7c 89 ldd r23, Y+20 ; 0x14 5d56: 65 31 cpi r22, 0x15 ; 21 5d58: 71 05 cpc r23, r1 5d5a: e0 f0 brcs .+56 ; 0x5d94 5d5c: 2d 89 ldd r18, Y+21 ; 0x15 5d5e: 3e 89 ldd r19, Y+22 ; 0x16 5d60: 25 31 cpi r18, 0x15 ; 21 5d62: 31 05 cpc r19, r1 5d64: b8 f0 brcs .+46 ; 0x5d94 5d66: 8f 89 ldd r24, Y+23 ; 0x17 5d68: 98 8d ldd r25, Y+24 ; 0x18 5d6a: 85 31 cpi r24, 0x15 ; 21 5d6c: 91 05 cpc r25, r1 5d6e: 90 f0 brcs .+36 ; 0x5d94 switch1 = TP1; switch2 = TP3; switchm = TP2; if ((TP13tab[1] + TP13tab[2]) < TP13tab[0]) { 5d70: 26 0f add r18, r22 5d72: 37 1f adc r19, r23 5d74: 11 e0 ldi r17, 0x01 ; 1 5d76: 24 17 cp r18, r20 5d78: 35 07 cpc r19, r21 5d7a: 08 f0 brcs .+2 ; 0x5d7e 5d7c: 10 e0 ldi r17, 0x00 ; 0 close_state = 1; // both switches are often monitored in close state } if ((TP13tab[1] + TP13tab[2]) < TP13tab[3]) { 5d7e: ff 24 eor r15, r15 5d80: f3 94 inc r15 5d82: 28 17 cp r18, r24 5d84: 39 07 cpc r19, r25 5d86: 08 f0 brcs .+2 ; 0x5d8a 5d88: f1 2c mov r15, r1 wait1ms(); // wait a little for next sample if ((RST_PIN_REG & (1< 20) &&(TP13tab[1] > 20) && (TP13tab[2] > 20) && (TP13tab[3] > 20)) { switch1 = TP1; switch2 = TP3; switchm = TP2; 5d8a: cc 24 eor r12, r12 5d8c: c3 94 inc r12 wdt_reset(); wait1ms(); // wait a little for next sample if ((RST_PIN_REG & (1< 20) &&(TP13tab[1] > 20) && (TP13tab[2] > 20) && (TP13tab[3] > 20)) { switch1 = TP1; switch2 = TP3; 5d8e: 22 e0 ldi r18, 0x02 ; 2 5d90: e2 2e mov r14, r18 5d92: 4c c0 rjmp .+152 ; 0x5e2c if ((TP13tab[1] + TP13tab[2]) < TP13tab[3]) { open_state = 1; // both switches are often monitored in open state } break; } if ((TP23tab[0] > 20) &&(TP23tab[1] > 20) && (TP23tab[2] > 20) && (TP23tab[3] > 20)) { 5d94: 49 85 ldd r20, Y+9 ; 0x09 5d96: 5a 85 ldd r21, Y+10 ; 0x0a 5d98: 45 31 cpi r20, 0x15 ; 21 5d9a: 51 05 cpc r21, r1 5d9c: 10 f1 brcs .+68 ; 0x5de2 5d9e: 6b 85 ldd r22, Y+11 ; 0x0b 5da0: 7c 85 ldd r23, Y+12 ; 0x0c 5da2: 65 31 cpi r22, 0x15 ; 21 5da4: 71 05 cpc r23, r1 5da6: e8 f0 brcs .+58 ; 0x5de2 5da8: 2d 85 ldd r18, Y+13 ; 0x0d 5daa: 3e 85 ldd r19, Y+14 ; 0x0e 5dac: 25 31 cpi r18, 0x15 ; 21 5dae: 31 05 cpc r19, r1 5db0: c0 f0 brcs .+48 ; 0x5de2 5db2: 8f 85 ldd r24, Y+15 ; 0x0f 5db4: 98 89 ldd r25, Y+16 ; 0x10 5db6: 85 31 cpi r24, 0x15 ; 21 5db8: 91 05 cpc r25, r1 5dba: 98 f0 brcs .+38 ; 0x5de2 switch1 = TP2; switch2 = TP3; switchm = TP1; if ((TP23tab[1] + TP23tab[2]) < TP23tab[0]) { 5dbc: 26 0f add r18, r22 5dbe: 37 1f adc r19, r23 5dc0: 11 e0 ldi r17, 0x01 ; 1 5dc2: 24 17 cp r18, r20 5dc4: 35 07 cpc r19, r21 5dc6: 08 f0 brcs .+2 ; 0x5dca 5dc8: 10 e0 ldi r17, 0x00 ; 0 close_state = 1; // both switches are often monitored in close state } if ((TP23tab[1] + TP23tab[2]) < TP23tab[3]) { 5dca: ff 24 eor r15, r15 5dcc: f3 94 inc r15 5dce: 28 17 cp r18, r24 5dd0: 39 07 cpc r19, r25 5dd2: 08 f0 brcs .+2 ; 0x5dd6 5dd4: f1 2c mov r15, r1 break; } if ((TP23tab[0] > 20) &&(TP23tab[1] > 20) && (TP23tab[2] > 20) && (TP23tab[3] > 20)) { switch1 = TP2; switch2 = TP3; switchm = TP1; 5dd6: c1 2c mov r12, r1 } break; } if ((TP23tab[0] > 20) &&(TP23tab[1] > 20) && (TP23tab[2] > 20) && (TP23tab[3] > 20)) { switch1 = TP2; switch2 = TP3; 5dd8: 92 e0 ldi r25, 0x02 ; 2 5dda: e9 2e mov r14, r25 open_state = 1; // both switches are often monitored in open state } break; } if ((TP23tab[0] > 20) &&(TP23tab[1] > 20) && (TP23tab[2] > 20) && (TP23tab[3] > 20)) { switch1 = TP2; 5ddc: dd 24 eor r13, r13 5dde: d3 94 inc r13 5de0: 30 c0 rjmp .+96 ; 0x5e42 if ((TP23tab[1] + TP23tab[2]) < TP23tab[3]) { open_state = 1; // both switches are often monitored in open state } break; } if ((TP12tab[0] > 20) &&(TP12tab[1] > 20) && (TP12tab[2] > 20) && (TP12tab[3] > 20)) { 5de2: 49 81 ldd r20, Y+1 ; 0x01 5de4: 5a 81 ldd r21, Y+2 ; 0x02 5de6: 45 31 cpi r20, 0x15 ; 21 5de8: 51 05 cpc r21, r1 5dea: 10 f1 brcs .+68 ; 0x5e30 5dec: 6b 81 ldd r22, Y+3 ; 0x03 5dee: 7c 81 ldd r23, Y+4 ; 0x04 5df0: 65 31 cpi r22, 0x15 ; 21 5df2: 71 05 cpc r23, r1 5df4: e8 f0 brcs .+58 ; 0x5e30 5df6: 2d 81 ldd r18, Y+5 ; 0x05 5df8: 3e 81 ldd r19, Y+6 ; 0x06 5dfa: 25 31 cpi r18, 0x15 ; 21 5dfc: 31 05 cpc r19, r1 5dfe: c0 f0 brcs .+48 ; 0x5e30 5e00: 8f 81 ldd r24, Y+7 ; 0x07 5e02: 98 85 ldd r25, Y+8 ; 0x08 5e04: 85 31 cpi r24, 0x15 ; 21 5e06: 91 05 cpc r25, r1 5e08: 98 f0 brcs .+38 ; 0x5e30 switch1 = TP1; switch2 = TP2; switchm = TP3; if ((TP12tab[1] + TP12tab[2]) < TP12tab[0]) { 5e0a: 26 0f add r18, r22 5e0c: 37 1f adc r19, r23 5e0e: 11 e0 ldi r17, 0x01 ; 1 5e10: 24 17 cp r18, r20 5e12: 35 07 cpc r19, r21 5e14: 08 f0 brcs .+2 ; 0x5e18 5e16: 10 e0 ldi r17, 0x00 ; 0 close_state = 1; // both switches are often monitored in close state } if ((TP12tab[1] + TP12tab[2]) < TP12tab[3]) { 5e18: ff 24 eor r15, r15 5e1a: f3 94 inc r15 5e1c: 28 17 cp r18, r24 5e1e: 39 07 cpc r19, r25 5e20: 08 f0 brcs .+2 ; 0x5e24 5e22: f1 2c mov r15, r1 break; } if ((TP12tab[0] > 20) &&(TP12tab[1] > 20) && (TP12tab[2] > 20) && (TP12tab[3] > 20)) { switch1 = TP1; switch2 = TP2; switchm = TP3; 5e24: 82 e0 ldi r24, 0x02 ; 2 5e26: c8 2e mov r12, r24 } break; } if ((TP12tab[0] > 20) &&(TP12tab[1] > 20) && (TP12tab[2] > 20) && (TP12tab[3] > 20)) { switch1 = TP1; switch2 = TP2; 5e28: ee 24 eor r14, r14 5e2a: e3 94 inc r14 open_state = 1; // both switches are often monitored in open state } break; } if ((TP12tab[0] > 20) &&(TP12tab[1] > 20) && (TP12tab[2] > 20) && (TP12tab[3] > 20)) { switch1 = TP1; 5e2c: d1 2c mov r13, r1 5e2e: 09 c0 rjmp .+18 ; 0x5e42 switch1 = TP1; // no middle pin found, set all pins equal switch2 = TP1; switchm = TP1; open_state = 0; // open state for both switches is not often found close_state = 0; // close state for both switches is not often found for (kk=0; kk<63001; kk++) { 5e30: 0f 5f subi r16, 0xFF ; 255 5e32: 1f 4f sbci r17, 0xFF ; 255 5e34: 09 31 cpi r16, 0x19 ; 25 5e36: e6 ef ldi r30, 0xF6 ; 246 5e38: 1e 07 cpc r17, r30 5e3a: 09 f4 brne .+2 ; 0x5e3e 5e3c: 4a c0 rjmp .+148 ; 0x5ed2 5e3e: 89 2c mov r8, r9 5e40: 2d cf rjmp .-422 ; 0x5c9c break; } } if (switch1 == switch2) return; // no rotary encoder found lcd_clear_line2(); // clear line 2 of LCD 5e42: 0e 94 ac 0a call 0x1558 ; 0x1558 for (ii=0;ii<120;ii++) { 5e46: 00 e0 ldi r16, 0x00 ; 0 lcd_line2(); 5e48: 0e 94 85 08 call 0x110a ; 0x110a lcd_testpin(switch1); 5e4c: 8d 2d mov r24, r13 5e4e: 0e 94 87 0a call 0x150e ; 0x150e lcd_data('-'); 5e52: 8d e2 ldi r24, 0x2D ; 45 5e54: 0e 94 3f 0a call 0x147e ; 0x147e if ((ii & 0x01) == 0) { 5e58: 00 fd sbrc r16, 0 5e5a: 02 c0 rjmp .+4 ; 0x5e60 lcd_data('-'); // close state of switch 5e5c: 8d e2 ldi r24, 0x2D ; 45 5e5e: 01 c0 rjmp .+2 ; 0x5e62 } else { lcd_data('/'); // open state of switch 5e60: 8f e2 ldi r24, 0x2F ; 47 5e62: 0e 94 3f 0a call 0x147e ; 0x147e } lcd_data('-'); 5e66: 8d e2 ldi r24, 0x2D ; 45 5e68: 0e 94 3f 0a call 0x147e ; 0x147e lcd_testpin(switchm); // show the found pin number of the common pin 5e6c: 8c 2d mov r24, r12 5e6e: 0e 94 87 0a call 0x150e ; 0x150e lcd_data('-'); 5e72: 8d e2 ldi r24, 0x2D ; 45 5e74: 0e 94 3f 0a call 0x147e ; 0x147e if ((ii & 0x02) == 0) { 5e78: 01 fd sbrc r16, 1 5e7a: 02 c0 rjmp .+4 ; 0x5e80 lcd_data('-'); // close state of switch 5e7c: 8d e2 ldi r24, 0x2D ; 45 5e7e: 01 c0 rjmp .+2 ; 0x5e82 } else { lcd_data('/'); // open state of switch 5e80: 8f e2 ldi r24, 0x2F ; 47 5e82: 0e 94 3f 0a call 0x147e ; 0x147e } lcd_data('-'); 5e86: 8d e2 ldi r24, 0x2D ; 45 5e88: 0e 94 3f 0a call 0x147e ; 0x147e lcd_testpin(switch2); 5e8c: 8e 2d mov r24, r14 5e8e: 0e 94 87 0a call 0x150e ; 0x150e lcd_space(); 5e92: 0e 94 8b 0a call 0x1516 ; 0x1516 iim = (ii & 0x03); 5e96: 80 2f mov r24, r16 5e98: 83 70 andi r24, 0x03 ; 3 if (((iim == 0) && (close_state != 0)) || ((iim == 3) && (open_state != 0))) { 5e9a: 21 f4 brne .+8 ; 0x5ea4 5e9c: 11 23 and r17, r17 5e9e: 61 f0 breq .+24 ; 0x5eb8 if (iim == 0) lcd_data('C'); 5ea0: 83 e4 ldi r24, 0x43 ; 67 5ea2: 05 c0 rjmp .+10 ; 0x5eae } lcd_data('-'); lcd_testpin(switch2); lcd_space(); iim = (ii & 0x03); if (((iim == 0) && (close_state != 0)) || ((iim == 3) && (open_state != 0))) { 5ea4: 83 30 cpi r24, 0x03 ; 3 5ea6: 41 f4 brne .+16 ; 0x5eb8 5ea8: ff 20 and r15, r15 5eaa: 31 f0 breq .+12 ; 0x5eb8 if (iim == 0) lcd_data('C'); if (iim == 3) lcd_data('o'); 5eac: 8f e6 ldi r24, 0x6F ; 111 5eae: 0e 94 3f 0a call 0x147e ; 0x147e taste = wait_for_key_ms(2000); // this state is monitored for a long time 5eb2: 80 ed ldi r24, 0xD0 ; 208 5eb4: 97 e0 ldi r25, 0x07 ; 7 5eb6: 04 c0 rjmp .+8 ; 0x5ec0 } else { lcd_space(); 5eb8: 0e 94 8b 0a call 0x1516 ; 0x1516 taste = wait_for_key_ms(400); // this state is monitored only for a short time 5ebc: 80 e9 ldi r24, 0x90 ; 144 5ebe: 91 e0 ldi r25, 0x01 ; 1 5ec0: 0e 94 de 0e call 0x1dbc ; 0x1dbc } if (taste != 0) break; 5ec4: 81 11 cpse r24, r1 5ec6: 3b cf rjmp .-394 ; 0x5d3e } } if (switch1 == switch2) return; // no rotary encoder found lcd_clear_line2(); // clear line 2 of LCD for (ii=0;ii<120;ii++) { 5ec8: 0f 5f subi r16, 0xFF ; 255 5eca: 08 37 cpi r16, 0x78 ; 120 5ecc: 09 f0 breq .+2 ; 0x5ed0 5ece: bc cf rjmp .-136 ; 0x5e48 5ed0: 36 cf rjmp .-404 ; 0x5d3e } /* end for ii */ end_rotary: R_PORT = 0; // all resistor ports to GND R_DDR = 0; // all resistor ports to input ADC_DDR = TXD_MSK; // switch ADC port to input } 5ed2: 68 96 adiw r28, 0x18 ; 24 5ed4: ec e0 ldi r30, 0x0C ; 12 5ed6: 0c 94 5f 39 jmp 0x72be ; 0x72be <__epilogue_restores__+0xc> 00005eda : #include "Transistortester.h" /* ShowData shows the Software version number and */ /* the calibration data at the 2-line or 4-line LCD */ #ifdef WITH_MENU void ShowData(void) { 5eda: 0f 93 push r16 #ifdef WITH_ROTARY_SWITCH show_page_1: #endif lcd_clear(); 5edc: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_MEM2_string(VERSION_str); // "Version x.xxk" 5ee0: 80 e3 ldi r24, 0x30 ; 48 5ee2: 92 e0 ldi r25, 0x02 ; 2 5ee4: 0e 94 bf 0a call 0x157e ; 0x157e lcd_line2(); 5ee8: 0e 94 85 08 call 0x110a ; 0x110a lcd_MEM2_string(R0_str); // "R0=" 5eec: 8c ee ldi r24, 0xEC ; 236 5eee: 91 e0 ldi r25, 0x01 ; 1 5ef0: 0e 94 bf 0a call 0x157e ; 0x157e DisplayValue(eeprom_read_byte(&EE_ESR_ZEROtab[2]),-2,' ',3); 5ef4: 83 e0 ldi r24, 0x03 ; 3 5ef6: 90 e0 ldi r25, 0x00 ; 0 5ef8: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> 5efc: 68 2f mov r22, r24 5efe: 70 e0 ldi r23, 0x00 ; 0 5f00: 80 e0 ldi r24, 0x00 ; 0 5f02: 90 e0 ldi r25, 0x00 ; 0 5f04: 03 e0 ldi r16, 0x03 ; 3 5f06: 20 e2 ldi r18, 0x20 ; 32 5f08: 4e ef ldi r20, 0xFE ; 254 5f0a: 0e 94 a8 0b call 0x1750 ; 0x1750 DisplayValue(eeprom_read_byte(&EE_ESR_ZEROtab[3]),-2,' ',3); 5f0e: 84 e0 ldi r24, 0x04 ; 4 5f10: 90 e0 ldi r25, 0x00 ; 0 5f12: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> 5f16: 68 2f mov r22, r24 5f18: 70 e0 ldi r23, 0x00 ; 0 5f1a: 80 e0 ldi r24, 0x00 ; 0 5f1c: 90 e0 ldi r25, 0x00 ; 0 5f1e: 20 e2 ldi r18, 0x20 ; 32 5f20: 4e ef ldi r20, 0xFE ; 254 5f22: 0e 94 a8 0b call 0x1750 ; 0x1750 DisplayValue(eeprom_read_byte(&EE_ESR_ZEROtab[1]),-2,LCD_CHAR_OMEGA,3); 5f26: 82 e0 ldi r24, 0x02 ; 2 5f28: 90 e0 ldi r25, 0x00 ; 0 5f2a: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> 5f2e: 68 2f mov r22, r24 5f30: 70 e0 ldi r23, 0x00 ; 0 5f32: 80 e0 ldi r24, 0x00 ; 0 5f34: 90 e0 ldi r25, 0x00 ; 0 5f36: 24 e0 ldi r18, 0x04 ; 4 5f38: 4e ef ldi r20, 0xFE ; 254 5f3a: 0e 94 a8 0b call 0x1750 ; 0x1750 #if (LCD_LINES > 3) lcd_line3(); 5f3e: 0e 94 90 08 call 0x1120 ; 0x1120 show_page_2: #endif lcd_clear(); #endif /* output line 3 */ lcd_MEM_string(RIHI); // "RiHi=" 5f42: 85 ee ldi r24, 0xE5 ; 229 5f44: 91 e0 ldi r25, 0x01 ; 1 5f46: 0e 94 bf 0a call 0x157e ; 0x157e DisplayValue(RRpinPL,-1,LCD_CHAR_OMEGA,3); 5f4a: 60 91 35 01 lds r22, 0x0135 5f4e: 70 91 36 01 lds r23, 0x0136 5f52: 80 e0 ldi r24, 0x00 ; 0 5f54: 90 e0 ldi r25, 0x00 ; 0 5f56: 24 e0 ldi r18, 0x04 ; 4 5f58: 4f ef ldi r20, 0xFF ; 255 5f5a: 0e 94 a8 0b call 0x1750 ; 0x1750 #if (LCD_LINES > 3) lcd_line4(); 5f5e: 0e 94 9b 08 call 0x1136 ; 0x1136 #else lcd_line2(); #endif /* output line 4 */ lcd_MEM_string(RILO); // "RiLo=" 5f62: 8e ed ldi r24, 0xDE ; 222 5f64: 91 e0 ldi r25, 0x01 ; 1 5f66: 0e 94 bf 0a call 0x157e ; 0x157e DisplayValue(RRpinMI,-1,LCD_CHAR_OMEGA,3); 5f6a: 60 91 45 01 lds r22, 0x0145 5f6e: 70 91 46 01 lds r23, 0x0146 5f72: 80 e0 ldi r24, 0x00 ; 0 5f74: 90 e0 ldi r25, 0x00 ; 0 5f76: 24 e0 ldi r18, 0x04 ; 4 5f78: 4f ef ldi r20, 0xFF ; 255 5f7a: 0e 94 a8 0b call 0x1750 ; 0x1750 wait_for_key_ms(MIDDLE_WAIT_TIME); 5f7e: 88 e9 ldi r24, 0x98 ; 152 5f80: 9a e3 ldi r25, 0x3A ; 58 5f82: 0e 94 de 0e call 0x1dbc ; 0x1dbc if (rotary.count < -1) goto show_page_1; if (rotary.count < 0) goto show_page_2; #endif show_page_3: #endif lcd_clear(); 5f86: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_MEM_string(C0_str); //output "C0 " 5f8a: 8a ed ldi r24, 0xDA ; 218 5f8c: 91 e0 ldi r25, 0x01 ; 1 5f8e: 0e 94 bf 0a call 0x157e ; 0x157e DisplayValue(eeprom_read_byte(&c_zero_tab[5]),0,' ',3); //output cap0 1:3 5f92: 8a e0 ldi r24, 0x0A ; 10 5f94: 90 e0 ldi r25, 0x00 ; 0 5f96: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> 5f9a: 68 2f mov r22, r24 5f9c: 70 e0 ldi r23, 0x00 ; 0 5f9e: 80 e0 ldi r24, 0x00 ; 0 5fa0: 90 e0 ldi r25, 0x00 ; 0 5fa2: 20 e2 ldi r18, 0x20 ; 32 5fa4: 40 e0 ldi r20, 0x00 ; 0 5fa6: 0e 94 a8 0b call 0x1750 ; 0x1750 DisplayValue(eeprom_read_byte(&c_zero_tab[6]),0,' ',3); //output cap0 2:3 5faa: 8b e0 ldi r24, 0x0B ; 11 5fac: 90 e0 ldi r25, 0x00 ; 0 5fae: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> 5fb2: 68 2f mov r22, r24 5fb4: 70 e0 ldi r23, 0x00 ; 0 5fb6: 80 e0 ldi r24, 0x00 ; 0 5fb8: 90 e0 ldi r25, 0x00 ; 0 5fba: 20 e2 ldi r18, 0x20 ; 32 5fbc: 40 e0 ldi r20, 0x00 ; 0 5fbe: 0e 94 a8 0b call 0x1750 ; 0x1750 DisplayValue(eeprom_read_byte(&c_zero_tab[2]),-12,'F',3); //output cap0 1:2 5fc2: 87 e0 ldi r24, 0x07 ; 7 5fc4: 90 e0 ldi r25, 0x00 ; 0 5fc6: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> 5fca: 68 2f mov r22, r24 5fcc: 70 e0 ldi r23, 0x00 ; 0 5fce: 80 e0 ldi r24, 0x00 ; 0 5fd0: 90 e0 ldi r25, 0x00 ; 0 5fd2: 26 e4 ldi r18, 0x46 ; 70 5fd4: 44 ef ldi r20, 0xF4 ; 244 5fd6: 0e 94 a8 0b call 0x1750 ; 0x1750 lcd_line2(); 5fda: 0e 94 85 08 call 0x110a ; 0x110a lcd_spaces(3); 5fde: 83 e0 ldi r24, 0x03 ; 3 5fe0: 0e 94 8f 0a call 0x151e ; 0x151e DisplayValue(eeprom_read_byte(&c_zero_tab[1]),0,' ',3); //output cap0 3:1 5fe4: 86 e0 ldi r24, 0x06 ; 6 5fe6: 90 e0 ldi r25, 0x00 ; 0 5fe8: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> 5fec: 68 2f mov r22, r24 5fee: 70 e0 ldi r23, 0x00 ; 0 5ff0: 80 e0 ldi r24, 0x00 ; 0 5ff2: 90 e0 ldi r25, 0x00 ; 0 5ff4: 20 e2 ldi r18, 0x20 ; 32 5ff6: 40 e0 ldi r20, 0x00 ; 0 5ff8: 0e 94 a8 0b call 0x1750 ; 0x1750 DisplayValue(eeprom_read_byte(&c_zero_tab[4]),0,' ',3); //output cap0 3:2 5ffc: 89 e0 ldi r24, 0x09 ; 9 5ffe: 90 e0 ldi r25, 0x00 ; 0 6000: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> 6004: 68 2f mov r22, r24 6006: 70 e0 ldi r23, 0x00 ; 0 6008: 80 e0 ldi r24, 0x00 ; 0 600a: 90 e0 ldi r25, 0x00 ; 0 600c: 20 e2 ldi r18, 0x20 ; 32 600e: 40 e0 ldi r20, 0x00 ; 0 6010: 0e 94 a8 0b call 0x1750 ; 0x1750 DisplayValue(eeprom_read_byte(&c_zero_tab[0]),-12,'F',3); //output cap0 2:1 6014: 85 e0 ldi r24, 0x05 ; 5 6016: 90 e0 ldi r25, 0x00 ; 0 6018: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> 601c: 68 2f mov r22, r24 601e: 70 e0 ldi r23, 0x00 ; 0 6020: 80 e0 ldi r24, 0x00 ; 0 6022: 90 e0 ldi r25, 0x00 ; 0 6024: 26 e4 ldi r18, 0x46 ; 70 6026: 44 ef ldi r20, 0xF4 ; 244 6028: 0e 94 a8 0b call 0x1750 ; 0x1750 #if (LCD_LINES > 3) lcd_line3(); 602c: 0e 94 90 08 call 0x1120 ; 0x1120 show_page_4: #endif lcd_clear(); #endif /* output line 7 */ lcd_MEM2_string(REF_C_str); // "REF_C=" 6030: 86 e4 ldi r24, 0x46 ; 70 6032: 91 e0 ldi r25, 0x01 ; 1 6034: 0e 94 bf 0a call 0x157e ; 0x157e i2lcd((int16_t)eeprom_read_word((uint16_t *)(&ref_offset))); 6038: 8c e0 ldi r24, 0x0C ; 12 603a: 90 e0 ldi r25, 0x00 ; 0 603c: 0e 94 df 39 call 0x73be ; 0x73be <__eerd_word_m328p> 6040: 0e 94 f5 0a call 0x15ea ; 0x15ea #if (LCD_LINES > 3) lcd_line4(); 6044: 0e 94 9b 08 call 0x1136 ; 0x1136 #else lcd_line2(); #endif /* output line 8 */ lcd_MEM2_string(REF_R_str); // "REF_R=" 6048: 8f e3 ldi r24, 0x3F ; 63 604a: 91 e0 ldi r25, 0x01 ; 1 604c: 0e 94 bf 0a call 0x157e ; 0x157e i2lcd((int8_t)eeprom_read_byte((uint8_t *)(&RefDiff))); 6050: 8e e0 ldi r24, 0x0E ; 14 6052: 90 e0 ldi r25, 0x00 ; 0 6054: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> 6058: 99 27 eor r25, r25 605a: 87 fd sbrc r24, 7 605c: 90 95 com r25 605e: 0e 94 f5 0a call 0x15ea ; 0x15ea wait_for_key_ms(MIDDLE_WAIT_TIME); 6062: 88 e9 ldi r24, 0x98 ; 152 6064: 9a e3 ldi r25, 0x3A ; 58 6066: 0e 94 de 0e call 0x1dbc ; 0x1dbc if (rotary.count < -1) goto show_page_3; if (rotary.count < 0) goto show_page_4; #endif #endif #ifdef WITH_GRAPHICS ShowIcons(); // show all Icons 606a: 0e 94 ac 0c call 0x1958 ; 0x1958 #endif } 606e: 0f 91 pop r16 6070: 08 95 ret 00006072 : #endif #if defined(POWER_OFF) && defined(BAT_CHECK) // monitor Battery in line 4 or line2, if a two line display void Bat_update(uint8_t tt) { if((tt % 16) == 0) { 6072: 8f 70 andi r24, 0x0F ; 15 6074: 21 f4 brne .+8 ; 0x607e #if (LCD_LINES > 3) lcd_line4(); 6076: 0e 94 9b 08 call 0x1136 ; 0x1136 Battery_check(); 607a: 0e 94 c4 14 call 0x2988 ; 0x2988 607e: 08 95 ret 00006080 : /* ****************************************************************** */ /* show_Resis13 measures the resistance of a part connected to TP1 and TP3 */ /* if RMETER_WITH_L is configured, inductance is also measured */ /* ****************************************************************** */ void show_Resis13(void) { 6080: 0f 93 push r16 6082: cf 93 push r28 uint8_t key_pressed; message_key_released(RESIS_13_str); // "1-|=|-3 .." 6084: 87 eb ldi r24, 0xB7 ; 183 6086: 91 e0 ldi r25, 0x01 ; 1 6088: 0e 94 d1 2c call 0x59a2 ; 0x59a2 lcd_set_cursor(0,LCD_LINE_LENGTH-RLMETER_len); 608c: 6c e0 ldi r22, 0x0C ; 12 608e: 80 e0 ldi r24, 0x00 ; 0 6090: 0e 94 a6 08 call 0x114c ; 0x114c lcd_MEM2_string(RLMETER_13_str); // "[RL]" at the end of line 1 6094: 82 eb ldi r24, 0xB2 ; 178 6096: 91 e0 ldi r25, 0x01 ; 1 6098: 0e 94 bf 0a call 0x157e ; 0x157e #ifdef POWER_OFF uint8_t times; for (times=0;times<250;times++) 609c: c0 e0 ldi r28, 0x00 ; 0 #else while (1) /* wait endless without the POWER_OFF option */ #endif { init_parts(); // set all parts to nothing found 609e: 0e 94 bf 0f call 0x1f7e ; 0x1f7e // PartFound = PART_NONE; // ResistorsFound = 0; // ResistorChecked[1] = 0; GetResistance(TP3, TP1); 60a2: 60 e0 ldi r22, 0x00 ; 0 60a4: 82 e0 ldi r24, 0x02 ; 2 60a6: 0e 94 1c 1b call 0x3638 ; 0x3638 GetResistance(TP1, TP3); 60aa: 62 e0 ldi r22, 0x02 ; 2 60ac: 80 e0 ldi r24, 0x00 ; 0 60ae: 0e 94 1c 1b call 0x3638 ; 0x3638 lcd_line2(); // clear old Resistance value 60b2: 0e 94 85 08 call 0x110a ; 0x110a if (ResistorsFound != 0) { 60b6: 80 91 7b 01 lds r24, 0x017B 60ba: 88 23 and r24, r24 60bc: 49 f1 breq .+82 ; 0x6110 #ifdef RMETER_WITH_L ReadInductance(); // measure inductance, possible only with R<2.1k 60be: 0e 94 e8 21 call 0x43d0 ; 0x43d0 RvalOut(1); // show Resistance, probably ESR 60c2: 81 e0 ldi r24, 0x01 ; 1 60c4: 0e 94 39 0b call 0x1672 ; 0x1672 if (inductor_lpre != 0) { 60c8: 80 91 02 01 lds r24, 0x0102 60cc: 88 23 and r24, r24 60ce: f1 f0 breq .+60 ; 0x610c // resistor has also inductance lcd_MEM_string(Lis_str); // "L=" 60d0: 8a e6 ldi r24, 0x6A ; 106 60d2: 93 e0 ldi r25, 0x03 ; 3 60d4: 0e 94 bf 0a call 0x157e ; 0x157e DisplayValue(inductor_lx,inductor_lpre,'H',3); // output inductance 60d8: 60 91 0c 01 lds r22, 0x010C 60dc: 70 91 0d 01 lds r23, 0x010D 60e0: 80 91 0e 01 lds r24, 0x010E 60e4: 90 91 0f 01 lds r25, 0x010F 60e8: 03 e0 ldi r16, 0x03 ; 3 60ea: 28 e4 ldi r18, 0x48 ; 72 60ec: 40 91 02 01 lds r20, 0x0102 60f0: 0e 94 a8 0b call 0x1750 ; 0x1750 lcd_set_cursor(0,5); 60f4: 65 e0 ldi r22, 0x05 ; 5 60f6: 80 e0 ldi r24, 0x00 ; 0 60f8: 0e 94 a6 08 call 0x114c ; 0x114c lcd_MEM_string(Inductor_str); // -ww- 60fc: 8e e3 ldi r24, 0x3E ; 62 60fe: 92 e0 ldi r25, 0x02 ; 2 6100: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(TP3); 6104: 82 e0 ldi r24, 0x02 ; 2 6106: 0e 94 87 0a call 0x150e ; 0x150e 610a: 12 c0 rjmp .+36 ; 0x6130 } else { lcd_spaces(12); // clear old L= 610c: 8c e0 ldi r24, 0x0C ; 12 610e: 04 c0 rjmp .+8 ; 0x6118 #else /* without Inductance measurement, only show resistance */ inductor_lpre = -1; // prevent ESR measurement because Inductance is not tested RvalOut(1); // show Resistance, no ESR #endif } else { /* no resistor found */ lcd_data('?'); // too big 6110: 8f e3 ldi r24, 0x3F ; 63 6112: 0e 94 3f 0a call 0x147e ; 0x147e lcd_spaces(19); 6116: 83 e1 ldi r24, 0x13 ; 19 6118: 0e 94 8f 0a call 0x151e ; 0x151e #ifdef RMETER_WITH_L lcd_set_cursor(0,5); 611c: 65 e0 ldi r22, 0x05 ; 5 611e: 80 e0 ldi r24, 0x00 ; 0 6120: 0e 94 a6 08 call 0x114c ; 0x114c lcd_testpin(TP3); 6124: 82 e0 ldi r24, 0x02 ; 2 6126: 0e 94 87 0a call 0x150e ; 0x150e lcd_spaces(4); // clear ww-3 612a: 84 e0 ldi r24, 0x04 ; 4 612c: 0e 94 8f 0a call 0x151e ; 0x151e #endif } #if defined(POWER_OFF) && defined(BAT_CHECK) Bat_update(times); 6130: 8c 2f mov r24, r28 6132: 0e 94 39 30 call 0x6072 ; 0x6072 #endif key_pressed = wait_for_key_ms(1000); 6136: 88 ee ldi r24, 0xE8 ; 232 6138: 93 e0 ldi r25, 0x03 ; 3 613a: 0e 94 de 0e call 0x1dbc ; 0x1dbc #ifdef WITH_ROTARY_SWITCH if ((key_pressed != 0) || (rotary.incre > 3)) break; #else if (key_pressed != 0) break; 613e: 81 11 cpse r24, r1 6140: 04 c0 rjmp .+8 ; 0x614a message_key_released(RESIS_13_str); // "1-|=|-3 .." lcd_set_cursor(0,LCD_LINE_LENGTH-RLMETER_len); lcd_MEM2_string(RLMETER_13_str); // "[RL]" at the end of line 1 #ifdef POWER_OFF uint8_t times; for (times=0;times<250;times++) 6142: cf 5f subi r28, 0xFF ; 255 6144: ca 3f cpi r28, 0xFA ; 250 6146: 09 f0 breq .+2 ; 0x614a 6148: aa cf rjmp .-172 ; 0x609e if ((key_pressed != 0) || (rotary.incre > 3)) break; #else if (key_pressed != 0) break; #endif } /* end for times */ lcd_clear(); 614a: 0e 94 f9 08 call 0x11f2 ; 0x11f2 } /* end show_Resis13() */ 614e: cf 91 pop r28 6150: 0f 91 pop r16 6152: 08 95 ret 00006154 : #if (LCD_LINES > 2) #define SCREEN_TIME 1000 #else #define SCREEN_TIME 2000 /* line 2 is multi use, wait longer to read */ #endif void show_Cap13(void) { 6154: 0f 93 push r16 6156: cf 93 push r28 6158: df 93 push r29 uint8_t key_pressed; message_key_released(CAP_13_str); // 1-||-3 at the beginning of line 1 615a: 8b ea ldi r24, 0xAB ; 171 615c: 91 e0 ldi r25, 0x01 ; 1 615e: 0e 94 d1 2c call 0x59a2 ; 0x59a2 lcd_set_cursor(0,LCD_LINE_LENGTH-3); 6162: 6d e0 ldi r22, 0x0D ; 13 6164: 80 e0 ldi r24, 0x00 ; 0 6166: 0e 94 a6 08 call 0x114c ; 0x114c lcd_MEM2_string(CMETER_13_str); // "[C]" at the end of line 1 616a: 87 ea ldi r24, 0xA7 ; 167 616c: 91 e0 ldi r25, 0x01 ; 1 616e: 0e 94 bf 0a call 0x157e ; 0x157e #ifdef POWER_OFF uint8_t times; for (times=0;times<250;times++) 6172: c0 e0 ldi r28, 0x00 ; 0 if (cap.cpre < 0) { // a cap is detected lcd_spaces(8); // clear Capacity value lcd_line2(); // overwrite old Capacity value DisplayValue(cap.cval,cap.cpre,'F',4); // display capacity PartFound = PART_CAPACITOR; // GetESR should check the Capacity value 6174: d7 e0 ldi r29, 0x07 ; 7 for (times=0;times<250;times++) #else while (1) /* wait endless without the POWER_OFF option */ #endif { init_parts(); // set all parts to nothing found 6176: 0e 94 bf 0f call 0x1f7e ; 0x1f7e // PartFound = PART_NONE; // NumOfDiodes = 0; // cap.cval_max = 0; // clear cval_max for update of vloss // cap.cpre_max = -12; // set to pF unit cap.v_loss = 0; // clear vloss for low capacity values (<25pF)! 617a: 10 92 8e 01 sts 0x018E, r1 617e: 10 92 8d 01 sts 0x018D, r1 ReadCapacity(TP3, TP1); 6182: 60 e0 ldi r22, 0x00 ; 0 6184: 82 e0 ldi r24, 0x02 ; 2 6186: 0e 94 ed 1d call 0x3bda ; 0x3bda lcd_line2(); // overwrite old Capacity value 618a: 0e 94 85 08 call 0x110a ; 0x110a if (cap.cpre < 0) { 618e: 80 91 91 01 lds r24, 0x0191 6192: 87 ff sbrs r24, 7 6194: 6f c0 rjmp .+222 ; 0x6274 // a cap is detected lcd_spaces(8); // clear Capacity value 6196: 88 e0 ldi r24, 0x08 ; 8 6198: 0e 94 8f 0a call 0x151e ; 0x151e lcd_line2(); // overwrite old Capacity value 619c: 0e 94 85 08 call 0x110a ; 0x110a DisplayValue(cap.cval,cap.cpre,'F',4); // display capacity 61a0: 60 91 7f 01 lds r22, 0x017F 61a4: 70 91 80 01 lds r23, 0x0180 61a8: 80 91 81 01 lds r24, 0x0181 61ac: 90 91 82 01 lds r25, 0x0182 61b0: 04 e0 ldi r16, 0x04 ; 4 61b2: 26 e4 ldi r18, 0x46 ; 70 61b4: 40 91 91 01 lds r20, 0x0191 61b8: 0e 94 a8 0b call 0x1750 ; 0x1750 PartFound = PART_CAPACITOR; // GetESR should check the Capacity value 61bc: d0 93 20 01 sts 0x0120, r29 cap.esr = GetESR(TP3,TP1); 61c0: 60 e0 ldi r22, 0x00 ; 0 61c2: 82 e0 ldi r24, 0x02 ; 2 61c4: 0e 94 1c 24 call 0x4838 ; 0x4838 61c8: 90 93 8c 01 sts 0x018C, r25 61cc: 80 93 8b 01 sts 0x018B, r24 if ( cap.esr < 65530) { // ESR is measured lcd_set_cursor(1 * PAGES_PER_LINE, 8); // position behind the capacity 61d0: 68 e0 ldi r22, 0x08 ; 8 lcd_spaces(8); // clear Capacity value lcd_line2(); // overwrite old Capacity value DisplayValue(cap.cval,cap.cpre,'F',4); // display capacity PartFound = PART_CAPACITOR; // GetESR should check the Capacity value cap.esr = GetESR(TP3,TP1); if ( cap.esr < 65530) { 61d2: 8a 3f cpi r24, 0xFA ; 250 61d4: 9f 4f sbci r25, 0xFF ; 255 61d6: 08 f5 brcc .+66 ; 0x621a // ESR is measured lcd_set_cursor(1 * PAGES_PER_LINE, 8); // position behind the capacity 61d8: 82 e0 ldi r24, 0x02 ; 2 61da: 0e 94 a6 08 call 0x114c ; 0x114c lcd_MEM_string(&ESR_str[1]); // show also "ESR=" 61de: 86 e7 ldi r24, 0x76 ; 118 61e0: 93 e0 ldi r25, 0x03 ; 3 61e2: 0e 94 bf 0a call 0x157e ; 0x157e DisplayValue(cap.esr,-2,LCD_CHAR_OMEGA,2); // and ESR value 61e6: 60 91 8b 01 lds r22, 0x018B 61ea: 70 91 8c 01 lds r23, 0x018C 61ee: 80 e0 ldi r24, 0x00 ; 0 61f0: 90 e0 ldi r25, 0x00 ; 0 61f2: 02 e0 ldi r16, 0x02 ; 2 61f4: 24 e0 ldi r18, 0x04 ; 4 61f6: 4e ef ldi r20, 0xFE ; 254 61f8: 0e 94 a8 0b call 0x1750 ; 0x1750 lcd_spaces(2); // clear old remainder of last ESR message 61fc: 82 e0 ldi r24, 0x02 ; 2 61fe: 0e 94 8f 0a call 0x151e ; 0x151e lcd_set_cursor(0,4); 6202: 64 e0 ldi r22, 0x04 ; 4 6204: 80 e0 ldi r24, 0x00 ; 0 6206: 0e 94 a6 08 call 0x114c ; 0x114c lcd_MEM2_string(Resistor_str); // "-[=]- .." 620a: 83 e4 ldi r24, 0x43 ; 67 620c: 92 e0 ldi r25, 0x02 ; 2 620e: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(TP3); // add the TP3 6212: 82 e0 ldi r24, 0x02 ; 2 6214: 0e 94 87 0a call 0x150e ; 0x150e 6218: 10 c0 rjmp .+32 ; 0x623a } else { // no ESR known lcd_set_cursor(1 * PAGES_PER_LINE, 8); // position behind the capacity 621a: 82 e0 ldi r24, 0x02 ; 2 621c: 0e 94 a6 08 call 0x114c ; 0x114c lcd_spaces(10); // clear ESR text and value 6220: 8a e0 ldi r24, 0x0A ; 10 6222: 0e 94 8f 0a call 0x151e ; 0x151e lcd_set_cursor(0,4); // clear ESR resistor 6226: 64 e0 ldi r22, 0x04 ; 4 6228: 80 e0 ldi r24, 0x00 ; 0 622a: 0e 94 a6 08 call 0x114c ; 0x114c lcd_testpin(TP3); // write the TP3 622e: 82 e0 ldi r24, 0x02 ; 2 6230: 0e 94 87 0a call 0x150e ; 0x150e lcd_spaces(5); // overwrite ESR resistor symbol 6234: 85 e0 ldi r24, 0x05 ; 5 6236: 0e 94 8f 0a call 0x151e ; 0x151e } GetVloss(); // get Voltage loss of capacitor 623a: 0e 94 f8 25 call 0x4bf0 ; 0x4bf0 #if (LCD_LINES > 2) lcd_line3(); 623e: 0e 94 90 08 call 0x1120 ; 0x1120 if (cap.v_loss != 0) { 6242: 80 91 8d 01 lds r24, 0x018D 6246: 90 91 8e 01 lds r25, 0x018E 624a: 89 2b or r24, r25 624c: d9 f0 breq .+54 ; 0x6284 lcd_MEM_string(&VLOSS_str[1]); // "Vloss=" 624e: 8e e6 ldi r24, 0x6E ; 110 6250: 93 e0 ldi r25, 0x03 ; 3 6252: 0e 94 bf 0a call 0x157e ; 0x157e DisplayValue(cap.v_loss,-1,'%',2); 6256: 60 91 8d 01 lds r22, 0x018D 625a: 70 91 8e 01 lds r23, 0x018E 625e: 80 e0 ldi r24, 0x00 ; 0 6260: 90 e0 ldi r25, 0x00 ; 0 6262: 02 e0 ldi r16, 0x02 ; 2 6264: 25 e2 ldi r18, 0x25 ; 37 6266: 4f ef ldi r20, 0xFF ; 255 6268: 0e 94 a8 0b call 0x1750 ; 0x1750 lcd_spaces(4); 626c: 84 e0 ldi r24, 0x04 ; 4 626e: 0e 94 8f 0a call 0x151e ; 0x151e 6272: 0a c0 rjmp .+20 ; 0x6288 lcd_MEM_string(&VLOSS_str[1]); // "Vloss=" DisplayValue(cap.v_loss,-1,'%',2); } #endif } else { /* no cap detected */ lcd_data('?'); 6274: 8f e3 ldi r24, 0x3F ; 63 6276: 0e 94 3f 0a call 0x147e ; 0x147e lcd_spaces(18); // clear rest of line 2 627a: 82 e1 ldi r24, 0x12 ; 18 627c: 0e 94 8f 0a call 0x151e ; 0x151e #if (LCD_LINES > 2) lcd_line3(); 6280: 0e 94 90 08 call 0x1120 ; 0x1120 lcd_clear_line(); // clear old Vloss= message 6284: 0e 94 a1 0a call 0x1542 ; 0x1542 #endif } #if defined(POWER_OFF) && defined(BAT_CHECK) Bat_update(times); 6288: 8c 2f mov r24, r28 628a: 0e 94 39 30 call 0x6072 ; 0x6072 #endif key_pressed = wait_for_key_ms(SCREEN_TIME); 628e: 88 ee ldi r24, 0xE8 ; 232 6290: 93 e0 ldi r25, 0x03 ; 3 6292: 0e 94 de 0e call 0x1dbc ; 0x1dbc #ifdef WITH_ROTARY_SWITCH if ((key_pressed != 0) || (rotary.incre > 3)) break; #else if (key_pressed != 0) break; 6296: 81 11 cpse r24, r1 6298: 04 c0 rjmp .+8 ; 0x62a2 message_key_released(CAP_13_str); // 1-||-3 at the beginning of line 1 lcd_set_cursor(0,LCD_LINE_LENGTH-3); lcd_MEM2_string(CMETER_13_str); // "[C]" at the end of line 1 #ifdef POWER_OFF uint8_t times; for (times=0;times<250;times++) 629a: cf 5f subi r28, 0xFF ; 255 629c: ca 3f cpi r28, 0xFA ; 250 629e: 09 f0 breq .+2 ; 0x62a2 62a0: 6a cf rjmp .-300 ; 0x6176 if ((key_pressed != 0) || (rotary.incre > 3)) break; #else if (key_pressed != 0) break; #endif } /* end for times */ lcd_clear(); 62a2: 0e 94 f9 08 call 0x11f2 ; 0x11f2 } /* end show_Cap13() */ 62a6: df 91 pop r29 62a8: cf 91 pop r28 62aa: 0f 91 pop r16 62ac: 08 95 ret 000062ae : #include #include #include "Transistortester.h" // check some EEprom values for correct values void EE_check_init(void) { 62ae: 1f 93 push r17 62b0: cf 93 push r28 62b2: df 93 push r29 #ifndef USE_EEPROM uint8_t tt; // read test value tt = (uint8_t)eeprom_read_byte(&EE_ESR_ZEROtab[0]); 62b4: 81 e0 ldi r24, 0x01 ; 1 62b6: 90 e0 ldi r25, 0x00 ; 0 62b8: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> 62bc: 18 2f mov r17, r24 // this value will never be changed by calibration if (tt != ESR_ZERO) goto init_ee; 62be: 84 31 cpi r24, 0x14 ; 20 62c0: 31 f5 brne .+76 ; 0x630e 62c2: c0 e0 ldi r28, 0x00 ; 0 62c4: d0 e0 ldi r29, 0x00 ; 0 #ifdef AUTO_CAL uint8_t tt0; // value of first c_zero_tab uint8_t ww; // loop counter tt0 = tt; // init tt0 value for (ww=0;ww<7;ww++) { //checking loop tt = (uint8_t)eeprom_read_byte(&c_zero_tab[ww]); 62c6: ce 01 movw r24, r28 62c8: 8b 5f subi r24, 0xFB ; 251 62ca: 9f 4f sbci r25, 0xFF ; 255 62cc: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> if (ww == 0) tt0 = tt; // save first value 62d0: cc 23 and r28, r28 62d2: a1 f0 breq .+40 ; 0x62fc // for forth element, tt must be tt0 or tt0+1 if ((ww == 3) && ((tt != tt0) && (tt != (tt0+1)) && (tt != (tt0+2)) )) goto init_ee; 62d4: c3 30 cpi r28, 0x03 ; 3 62d6: 99 f4 brne .+38 ; 0x62fe 62d8: 81 17 cp r24, r17 62da: 89 f0 breq .+34 ; 0x62fe 62dc: 28 2f mov r18, r24 62de: 30 e0 ldi r19, 0x00 ; 0 62e0: 41 2f mov r20, r17 62e2: 50 e0 ldi r21, 0x00 ; 0 62e4: ba 01 movw r22, r20 62e6: 6f 5f subi r22, 0xFF ; 255 62e8: 7f 4f sbci r23, 0xFF ; 255 62ea: 26 17 cp r18, r22 62ec: 37 07 cpc r19, r23 62ee: 39 f0 breq .+14 ; 0x62fe 62f0: 4e 5f subi r20, 0xFE ; 254 62f2: 5f 4f sbci r21, 0xFF ; 255 62f4: 24 17 cp r18, r20 62f6: 35 07 cpc r19, r21 62f8: 11 f0 breq .+4 ; 0x62fe 62fa: 09 c0 rjmp .+18 ; 0x630e #ifdef AUTO_CAL uint8_t tt0; // value of first c_zero_tab uint8_t ww; // loop counter tt0 = tt; // init tt0 value for (ww=0;ww<7;ww++) { //checking loop tt = (uint8_t)eeprom_read_byte(&c_zero_tab[ww]); 62fc: 18 2f mov r17, r24 if (ww == 0) tt0 = tt; // save first value // for forth element, tt must be tt0 or tt0+1 if ((ww == 3) && ((tt != tt0) && (tt != (tt0+1)) && (tt != (tt0+2)) )) goto init_ee; if ((tt > 190) || (tt < 10)) goto init_ee; // value too low or too big 62fe: 8a 50 subi r24, 0x0A ; 10 6300: 85 3b cpi r24, 0xB5 ; 181 6302: 28 f4 brcc .+10 ; 0x630e 6304: 21 96 adiw r28, 0x01 ; 1 if (tt != ESR_ZERO) goto init_ee; #ifdef AUTO_CAL uint8_t tt0; // value of first c_zero_tab uint8_t ww; // loop counter tt0 = tt; // init tt0 value for (ww=0;ww<7;ww++) { //checking loop 6306: c7 30 cpi r28, 0x07 ; 7 6308: d1 05 cpc r29, r1 630a: e9 f6 brne .-70 ; 0x62c6 630c: 42 c0 rjmp .+132 ; 0x6392 #endif return; init_ee: // init all EEprom values lcd_line1(); 630e: 0e 94 7c 08 call 0x10f8 ; 0x10f8 lcd_data('E'); 6312: 85 e4 ldi r24, 0x45 ; 69 6314: 0e 94 3f 0a call 0x147e ; 0x147e lcd_data('E'); 6318: 85 e4 ldi r24, 0x45 ; 69 631a: 0e 94 3f 0a call 0x147e ; 0x147e #ifdef AUTO_CAL // write the correction value for ADC internal 1.1V reference (void) eeprom_write_byte((uint8_t *)(&RefDiff), (uint8_t)REF_R_KORR); // offset for true reference Voltage 631e: 63 e0 ldi r22, 0x03 ; 3 6320: 8e e0 ldi r24, 0x0E ; 14 6322: 90 e0 ldi r25, 0x00 ; 0 6324: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> // write the correction value for comparator 1.1V reference (void) eeprom_write_word((uint16_t *)(&ref_offset), REF_C_KORR); // hold zero offset + slew rate dependend offset 6328: 6c e0 ldi r22, 0x0C ; 12 632a: 70 e0 ldi r23, 0x00 ; 0 632c: 8c e0 ldi r24, 0x0C ; 12 632e: 90 e0 ldi r25, 0x00 ; 0 6330: 0e 94 f3 39 call 0x73e6 ; 0x73e6 <__eewr_word_m328p> // write all 7 c_zero_tab values (void) eeprom_write_word((uint16_t *)(&c_zero_tab[0]),((C_NULL)*256) + (C_NULL)); 6334: 69 e3 ldi r22, 0x39 ; 57 6336: 79 e3 ldi r23, 0x39 ; 57 6338: 85 e0 ldi r24, 0x05 ; 5 633a: 90 e0 ldi r25, 0x00 ; 0 633c: 0e 94 f3 39 call 0x73e6 ; 0x73e6 <__eewr_word_m328p> (void) eeprom_write_byte((uint8_t *)(&c_zero_tab[2]),(C_NULL+TP2_CAP_OFFSET)); 6340: 6b e3 ldi r22, 0x3B ; 59 6342: 87 e0 ldi r24, 0x07 ; 7 6344: 90 e0 ldi r25, 0x00 ; 0 6346: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> (void) eeprom_write_byte((uint8_t *)(&c_zero_tab[3]),(C_NULL+2)); 634a: 6b e3 ldi r22, 0x3B ; 59 634c: 88 e0 ldi r24, 0x08 ; 8 634e: 90 e0 ldi r25, 0x00 ; 0 6350: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> (void) eeprom_write_byte((uint8_t *)(&c_zero_tab[4]),(C_NULL+TP2_CAP_OFFSET)); 6354: 6b e3 ldi r22, 0x3B ; 59 6356: 89 e0 ldi r24, 0x09 ; 9 6358: 90 e0 ldi r25, 0x00 ; 0 635a: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> (void) eeprom_write_word((uint16_t *)(&c_zero_tab[5]),((C_NULL)*256) + (C_NULL)); 635e: 69 e3 ldi r22, 0x39 ; 57 6360: 79 e3 ldi r23, 0x39 ; 57 6362: 8a e0 ldi r24, 0x0A ; 10 6364: 90 e0 ldi r25, 0x00 ; 0 6366: 0e 94 f3 39 call 0x73e6 ; 0x73e6 <__eewr_word_m328p> #endif // write 4 EE_ESR_ZEROtab values (void) eeprom_write_word((uint16_t *)(&EE_ESR_ZEROtab[0]),(ESR_ZERO*256)+ESR_ZERO); 636a: 64 e1 ldi r22, 0x14 ; 20 636c: 74 e1 ldi r23, 0x14 ; 20 636e: 81 e0 ldi r24, 0x01 ; 1 6370: 90 e0 ldi r25, 0x00 ; 0 6372: 0e 94 f3 39 call 0x73e6 ; 0x73e6 <__eewr_word_m328p> (void) eeprom_write_word((uint16_t *)(&EE_ESR_ZEROtab[2]),(ESR_ZERO*256)+ESR_ZERO); 6376: 64 e1 ldi r22, 0x14 ; 20 6378: 74 e1 ldi r23, 0x14 ; 20 637a: 83 e0 ldi r24, 0x03 ; 3 637c: 90 e0 ldi r25, 0x00 ; 0 637e: 0e 94 f3 39 call 0x73e6 ; 0x73e6 <__eewr_word_m328p> #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306)) (void) eeprom_write_byte((uint8_t *)(&EE_Volume_Value), VOLUME_VALUE); 6382: 68 e2 ldi r22, 0x28 ; 40 6384: 80 e0 ldi r24, 0x00 ; 0 6386: 90 e0 ldi r25, 0x00 ; 0 6388: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> #endif #ifdef WITH_ROTARY_SWITCH // (void) eeprom_write_byte(&EE_RotarySwitch,0); // no switch is detected #endif wait_about1s(); 638c: 88 ec ldi r24, 0xC8 ; 200 638e: 0e 94 4a 0e call 0x1c94 ; 0x1c94 #endif } 6392: df 91 pop r29 6394: cf 91 pop r28 6396: 1f 91 pop r17 6398: 08 95 ret 0000639a
: EMPTY_INTERRUPT(TIMER2_COMPA_vect); EMPTY_INTERRUPT(ADC_vect); #endif //begin of transistortester program int main(void) { 639a: a4 e0 ldi r26, 0x04 ; 4 639c: b0 e0 ldi r27, 0x00 ; 0 639e: e3 ed ldi r30, 0xD3 ; 211 63a0: f1 e3 ldi r31, 0x31 ; 49 63a2: 0c 94 3d 39 jmp 0x727a ; 0x727a <__prologue_saves__> uint16_t pw; uint8_t pb[2]; } rpins; uint8_t x, y, z; //switch on ON_DDR = (1< 0x3fff // probably was a bootloader active, disable the UART UCSR0B = 0; // disable UART, if started with bootloader 63b2: 10 92 c1 00 sts 0x00C1, r1 UBRR0L = (F_CPU / 16 / BAUD_RATE - 1) & 0xff; UCSR0B = (1< // ADC_PORT = TXD_VAL; // ADC_DDR = TXD_MSK; if(tmp) { 63ea: 13 fd sbrc r17, 3 63ec: 3b c6 rjmp .+3190 ; 0x7064 #ifdef PULLUP_DISABLE #ifdef __AVR_ATmega8__ SFIOR = (1< 1 // tester display time selection #ifndef USE_EEPROM EE_check_init(); // init EEprom, if unset 63f2: 0e 94 57 31 call 0x62ae ; 0x62ae #ifdef WITH_ROTARY_SWITCH // rotary_switch_present = eeprom_read_byte(&EE_RotarySwitch); rotary.ind = ROT_MSK+1; //initilize state history with next call of check_rotary() #endif #if 1 for (ii=0; ii<60; ii++) { 63f6: 10 e0 ldi r17, 0x00 ; 0 if (RST_PIN_REG & (1< wait_about10ms(); 63fc: 82 e0 ldi r24, 0x02 ; 2 63fe: 0e 94 4a 0e call 0x1c94 ; 0x1c94 #ifdef WITH_ROTARY_SWITCH // rotary_switch_present = eeprom_read_byte(&EE_RotarySwitch); rotary.ind = ROT_MSK+1; //initilize state history with next call of check_rotary() #endif #if 1 for (ii=0; ii<60; ii++) { 6402: 1f 5f subi r17, 0xFF ; 255 6404: 1c 33 cpi r17, 0x3C ; 60 6406: c1 f7 brne .-16 ; 0x63f8 if (!(RST_PIN_REG & (1< 30) { 6414: 1f 31 cpi r17, 0x1F ; 31 6416: 30 f0 brcs .+12 ; 0x6424 display_time = LONG_WAIT_TIME; // ... set long time display anyway 6418: 80 e6 ldi r24, 0x60 ; 96 641a: 9d e6 ldi r25, 0x6D ; 109 641c: 90 93 19 01 sts 0x0119, r25 6420: 80 93 18 01 sts 0x0118, r24 #if POWER_OFF+0 > 1 empty_count = 0; mess_count = 0; #endif ADCconfig.RefFlag = 0; 6424: 10 92 30 01 sts 0x0130, r1 Calibrate_UR(); // get Ref Voltages and Pin resistance 6428: 0e 94 1e 21 call 0x423c ; 0x423c #ifdef WITH_MENU if (ii >= 60) { 642c: 1c 33 cpi r17, 0x3C ; 60 642e: 10 f0 brcs .+4 ; 0x6434 function_menu(); // selection of function 6430: 0e 94 50 2c call 0x58a0 ; 0x58a0 Battery_check(); #else lcd_MEM2_string(VERSION_str); // if no Battery check, Version .. in row 1 #endif /* BAT_CHECK */ #ifdef WDT_enabled wdt_enable(WDTO_2S); //Watchdog on 6434: 08 e1 ldi r16, 0x18 ; 24 6436: c0 2e mov r12, r16 6438: d1 2c mov r13, r1 lcd_clear_line1(); #else lcd_clear(); // clear total display #endif _trans = &ntrans; // default transistor structure to show 643a: 8b e4 ldi r24, 0x4B ; 75 643c: a8 2e mov r10, r24 643e: 81 e0 ldi r24, 0x01 ; 1 6440: b8 2e mov r11, r24 #ifdef WITH_GRAPHICS lcd_set_cursor(0,TEXT_RIGHT_TO_ICON); // position behind the icon, Line 1 #endif if((PartMode&P_CHANNEL) == P_CHANNEL) { lcd_data('P'); //P-channel _trans = &ptrans; 6442: 95 e6 ldi r25, 0x65 ; 101 6444: e9 2e mov r14, r25 6446: 91 e0 ldi r25, 0x01 ; 1 6448: f9 2e mov r15, r25 //***************************************************************** //Entry: if start key is pressed before shut down start: #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306)) lcd_command(CMD_DISPLAY_ON); 644a: 8f ea ldi r24, 0xAF ; 175 644c: 0e 94 e5 08 call 0x11ca ; 0x11ca lcd_command(CMD_SET_ALLPTS_NORMAL); // 0xa4 6450: 84 ea ldi r24, 0xA4 ; 164 6452: 0e 94 e5 08 call 0x11ca ; 0x11ca #endif lcd_clear(); // clear the LCD 6456: 0e 94 f9 08 call 0x11f2 ; 0x11f2 ADC_DDR = TXD_MSK; // activate Software-UART 645a: 28 e0 ldi r18, 0x08 ; 8 645c: 27 b9 out 0x07, r18 ; 7 init_parts(); // reset parts info to nothing found 645e: 0e 94 bf 0f call 0x1f7e ; 0x1f7e Calibrate_UR(); // get Ref Voltages and Pin resistance 6462: 0e 94 1e 21 call 0x423c ; 0x423c #ifdef WITH_UART uart_newline(); // start of new measurement 6466: 0e 94 de 08 call 0x11bc ; 0x11bc #endif lcd_line1(); // Cursor to 1. row, column 1 646a: 0e 94 7c 08 call 0x10f8 ; 0x10f8 #ifdef BAT_CHECK // Battery check is selected Battery_check(); 646e: 0e 94 c4 14 call 0x2988 ; 0x2988 #else lcd_MEM2_string(VERSION_str); // if no Battery check, Version .. in row 1 #endif /* BAT_CHECK */ #ifdef WDT_enabled wdt_enable(WDTO_2S); //Watchdog on 6472: 3f e0 ldi r19, 0x0F ; 15 6474: 0f b6 in r0, 0x3f ; 63 6476: f8 94 cli 6478: a8 95 wdr 647a: c0 92 60 00 sts 0x0060, r12 647e: 0f be out 0x3f, r0 ; 63 6480: 30 93 60 00 sts 0x0060, r19 #endif // wait_about1s(); // add more time for reading batterie voltage // begin tests #if FLASHEND > 0x1fff if (WithReference) { 6484: 80 91 47 01 lds r24, 0x0147 6488: 88 23 and r24, r24 648a: 81 f0 breq .+32 ; 0x64ac #if POWER_OFF+0 > 1 if ((mess_count == 0) && (empty_count == 0)) #endif { /* display VCC= only first time */ lcd_line2(); 648c: 0e 94 85 08 call 0x110a ; 0x110a lcd_MEM_string(VCC_str); // VCC= 6490: 8b e7 ldi r24, 0x7B ; 123 6492: 93 e0 ldi r25, 0x03 ; 3 6494: 0e 94 bf 0a call 0x157e ; 0x157e Display_mV(ADCconfig.U_AVCC,3); // Display 3 Digits of this mV units 6498: 63 e0 ldi r22, 0x03 ; 3 649a: 80 91 33 01 lds r24, 0x0133 649e: 90 91 34 01 lds r25, 0x0134 64a2: 0e 94 6d 0c call 0x18da ; 0x18da lcd_refresh(); // write the pixels to display, ST7920 only wait_about1s(); 64a6: 88 ec ldi r24, 0xC8 ; 200 64a8: 0e 94 4a 0e call 0x1c94 ; 0x1c94 wait_about300ms(); } #endif /* WITH_VEXT */ #ifndef DebugOut lcd_line2(); //LCD position row 2, column 1 64ac: 0e 94 85 08 call 0x110a ; 0x110a #endif EntladePins(); // discharge all capacitors! 64b0: 0e 94 20 1d call 0x3a40 ; 0x3a40 if(PartFound == PART_CELL) { 64b4: 80 91 20 01 lds r24, 0x0120 64b8: 88 30 cpi r24, 0x08 ; 8 64ba: 41 f5 brne .+80 ; 0x650c lcd_clear(); 64bc: 0e 94 f9 08 call 0x11f2 ; 0x11f2 lcd_MEM_string(Cell_str); // display "Cell!" 64c0: 80 e8 ldi r24, 0x80 ; 128 64c2: 93 e0 ldi r25, 0x03 ; 3 64c4: 0e 94 bf 0a call 0x157e ; 0x157e #if FLASHEND > 0x3fff lcd_line2(); // use LCD line 2 64c8: 0e 94 85 08 call 0x110a ; 0x110a Display_mV(cell_mv[0],3); 64cc: 63 e0 ldi r22, 0x03 ; 3 64ce: 80 91 06 01 lds r24, 0x0106 64d2: 90 91 07 01 lds r25, 0x0107 64d6: 0e 94 6d 0c call 0x18da ; 0x18da lcd_space(); 64da: 0e 94 8b 0a call 0x1516 ; 0x1516 Display_mV(cell_mv[1],3); 64de: 63 e0 ldi r22, 0x03 ; 3 64e0: 80 91 08 01 lds r24, 0x0108 64e4: 90 91 09 01 lds r25, 0x0109 64e8: 0e 94 6d 0c call 0x18da ; 0x18da lcd_space(); 64ec: 0e 94 8b 0a call 0x1516 ; 0x1516 Display_mV(cell_mv[2],3); 64f0: 63 e0 ldi r22, 0x03 ; 3 64f2: 80 91 0a 01 lds r24, 0x010A 64f6: 90 91 0b 01 lds r25, 0x010B 64fa: 0e 94 6d 0c call 0x18da ; 0x18da #endif #ifdef WITH_SELFTEST lcd_refresh(); // write the pixels to display, ST7920 only wait_about2s(); 64fe: 8a ec ldi r24, 0xCA ; 202 6500: 0e 94 4a 0e call 0x1c94 ; 0x1c94 AutoCheck(0x11); // full Selftest with "Short probes" message 6504: 81 e1 ldi r24, 0x11 ; 17 6506: 0e 94 36 10 call 0x206c ; 0x206c #endif goto tt_end; 650a: 2c c5 rjmp .+2648 ; 0x6f64 } #ifdef WITH_SELFTEST #ifdef AUTO_CAL lcd_cursor_off(); UnCalibrated = (eeprom_read_byte(&c_zero_tab[3]) - eeprom_read_byte(&c_zero_tab[0])); 650c: 88 e0 ldi r24, 0x08 ; 8 650e: 90 e0 ldi r25, 0x00 ; 0 6510: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> 6514: 08 2f mov r16, r24 6516: 85 e0 ldi r24, 0x05 ; 5 6518: 90 e0 ldi r25, 0x00 ; 0 651a: 0e 94 d7 39 call 0x73ae ; 0x73ae <__eerd_byte_m328p> 651e: 08 1b sub r16, r24 6520: 00 93 44 01 sts 0x0144, r16 // if calibrated, both c_zero_tab values are identical! c_zero_tab[3] is not used otherwise lcd_cursor_on(); } #endif #ifdef WITH_MENU AutoCheck(0x00); //check, if selftest should be done, only calibration 6524: 80 e0 ldi r24, 0x00 ; 0 6526: 0e 94 36 10 call 0x206c ; 0x206c #else AutoCheck(0x01); //check, if selftest should be done, full selftest without MENU #endif #endif lcd_line2(); //LCD position row2, column 1 652a: 0e 94 85 08 call 0x110a ; 0x110a lcd_MEM_string(TestRunning); //String: testing... 652e: 8d ee ldi r24, 0xED ; 237 6530: 94 e0 ldi r25, 0x04 ; 4 6532: 0e 94 bf 0a call 0x157e ; 0x157e lcd_refresh(); // write the pixels to display, ST7920 only // check all 6 combinations for the 3 pins // High Low Tri CheckPins(TP1, TP2, TP3); 6536: 42 e0 ldi r20, 0x02 ; 2 6538: 61 e0 ldi r22, 0x01 ; 1 653a: 80 e0 ldi r24, 0x00 ; 0 653c: 0e 94 06 15 call 0x2a0c ; 0x2a0c CheckPins(TP2, TP1, TP3); 6540: 42 e0 ldi r20, 0x02 ; 2 6542: 60 e0 ldi r22, 0x00 ; 0 6544: 81 e0 ldi r24, 0x01 ; 1 6546: 0e 94 06 15 call 0x2a0c ; 0x2a0c CheckPins(TP1, TP3, TP2); 654a: 41 e0 ldi r20, 0x01 ; 1 654c: 62 e0 ldi r22, 0x02 ; 2 654e: 80 e0 ldi r24, 0x00 ; 0 6550: 0e 94 06 15 call 0x2a0c ; 0x2a0c CheckPins(TP3, TP1, TP2); 6554: 41 e0 ldi r20, 0x01 ; 1 6556: 60 e0 ldi r22, 0x00 ; 0 6558: 82 e0 ldi r24, 0x02 ; 2 655a: 0e 94 06 15 call 0x2a0c ; 0x2a0c CheckPins(TP2, TP3, TP1); 655e: 40 e0 ldi r20, 0x00 ; 0 6560: 62 e0 ldi r22, 0x02 ; 2 6562: 81 e0 ldi r24, 0x01 ; 1 6564: 0e 94 06 15 call 0x2a0c ; 0x2a0c CheckPins(TP3, TP2, TP1); 6568: 40 e0 ldi r20, 0x00 ; 0 656a: 61 e0 ldi r22, 0x01 ; 1 656c: 82 e0 ldi r24, 0x02 ; 2 656e: 0e 94 06 15 call 0x2a0c ; 0x2a0c #endif // Capacity measurement is only possible correctly with two Pins connected. // A third connected pin will increase the capacity value! // if(((PartFound == PART_NONE) || (PartFound == PART_RESISTOR) || (PartFound == PART_DIODE)) ) { if(PartFound == PART_NONE) { 6572: 80 91 20 01 lds r24, 0x0120 6576: 81 11 cpse r24, r1 6578: 11 c0 rjmp .+34 ; 0x659c // If no part is found yet, check separate if is is a capacitor #if FLASHEND > 0x1fff lcd_data('C'); 657a: 83 e4 ldi r24, 0x43 ; 67 657c: 0e 94 3f 0a call 0x147e ; 0x147e #endif EntladePins(); // discharge capacities 6580: 0e 94 20 1d call 0x3a40 ; 0x3a40 //measurement of capacities in all 3 combinations ReadCapacity(TP3, TP1); 6584: 60 e0 ldi r22, 0x00 ; 0 6586: 82 e0 ldi r24, 0x02 ; 2 6588: 0e 94 ed 1d call 0x3bda ; 0x3bda #if DebugOut != 10 ReadCapacity(TP3, TP2); 658c: 61 e0 ldi r22, 0x01 ; 1 658e: 82 e0 ldi r24, 0x02 ; 2 6590: 0e 94 ed 1d call 0x3bda ; 0x3bda ReadCapacity(TP2, TP1); 6594: 60 e0 ldi r22, 0x00 ; 0 6596: 81 e0 ldi r24, 0x01 ; 1 6598: 0e 94 ed 1d call 0x3bda ; 0x3bda #ifdef DebugOut // only clear two lines of LCD lcd_clear_line2(); lcd_clear_line1(); #else lcd_clear(); // clear total display 659c: 0e 94 f9 08 call 0x11f2 ; 0x11f2 #endif _trans = &ntrans; // default transistor structure to show 65a0: b0 92 49 01 sts 0x0149, r11 65a4: a0 92 48 01 sts 0x0148, r10 if (PartFound == PART_THYRISTOR) { 65a8: 80 91 20 01 lds r24, 0x0120 65ac: 85 30 cpi r24, 0x05 ; 5 65ae: 71 f4 brne .+28 ; 0x65cc #ifdef WITH_GRAPHICS lcd_big_icon(THYRISTOR|LCD_UPPER_LEFT); 65b0: 85 e3 ldi r24, 0x35 ; 53 65b2: 0e 94 f5 09 call 0x13ea ; 0x13ea lcd_draw_trans_pins(-8, 16); 65b6: 60 e1 ldi r22, 0x10 ; 16 65b8: 88 ef ldi r24, 0xF8 ; 248 65ba: 0e 94 8a 0c call 0x1914 ; 0x1914 lcd_set_cursor(0,TEXT_RIGHT_TO_ICON); // position behind the icon, Line 1 65be: 66 e0 ldi r22, 0x06 ; 6 65c0: 80 e0 ldi r24, 0x00 ; 0 65c2: 0e 94 a6 08 call 0x114c ; 0x114c lcd_MEM_string(Thyristor); //"Thyristor" 65c6: 84 ec ldi r24, 0xC4 ; 196 65c8: 94 e0 ldi r25, 0x04 ; 4 65ca: 0f c0 rjmp .+30 ; 0x65ea PinLayout(Cathode_char,'G','A'); // CGA= or 123=... #endif goto TyUfAusgabe; } if (PartFound == PART_TRIAC) { 65cc: 86 30 cpi r24, 0x06 ; 6 65ce: f9 f4 brne .+62 ; 0x660e #ifdef WITH_GRAPHICS lcd_big_icon(TRIAC|LCD_UPPER_LEFT); 65d0: 84 e3 ldi r24, 0x34 ; 52 65d2: 0e 94 f5 09 call 0x13ea ; 0x13ea lcd_draw_trans_pins(-8, 16); 65d6: 60 e1 ldi r22, 0x10 ; 16 65d8: 88 ef ldi r24, 0xF8 ; 248 65da: 0e 94 8a 0c call 0x1914 ; 0x1914 lcd_set_cursor(0,TEXT_RIGHT_TO_ICON); // position behind the icon, Line 1 65de: 66 e0 ldi r22, 0x06 ; 6 65e0: 80 e0 ldi r24, 0x00 ; 0 65e2: 0e 94 a6 08 call 0x114c ; 0x114c lcd_MEM_string(Triac); //"Triac" 65e6: 8d ec ldi r24, 0xCD ; 205 65e8: 94 e0 ldi r25, 0x04 ; 4 65ea: 0e 94 bf 0a call 0x157e ; 0x157e //gakAusgabe: // PinLayout(Cathode_char,'G','A'); // CGA= or 123=... TyUfAusgabe: #ifdef WITH_THYRISTOR_GATE_V #ifdef WITH_GRAPHICS lcd_set_cursor(2,TEXT_RIGHT_TO_ICON); // position behind the icon,line 2 65ee: 66 e0 ldi r22, 0x06 ; 6 65f0: 82 e0 ldi r24, 0x02 ; 2 65f2: 0e 94 a6 08 call 0x114c ; 0x114c #else lcd_line2(); //2. row #endif lcd_MEM_string(Uf_str); // "Uf=" 65f6: 84 e9 ldi r24, 0x94 ; 148 65f8: 93 e0 ldi r25, 0x03 ; 3 65fa: 0e 94 bf 0a call 0x157e ; 0x157e Display_mV(ntrans.uBE,2); 65fe: 62 e0 ldi r22, 0x02 ; 2 6600: 80 91 4f 01 lds r24, 0x014F 6604: 90 91 50 01 lds r25, 0x0150 6608: 0e 94 6d 0c call 0x18da ; 0x18da 660c: ab c4 rjmp .+2390 ; 0x6f64 PinLayout('1','G','2'); // CGA= or 123=... #endif goto TyUfAusgabe; } if (PartFound == PART_CAPACITOR) { 660e: 87 30 cpi r24, 0x07 ; 7 6610: 09 f0 breq .+2 ; 0x6614 6612: 6c c0 rjmp .+216 ; 0x66ec // lcd_MEM_string(Capacitor); lcd_testpin(cap.ca); //Pin number 1 6614: 80 91 8f 01 lds r24, 0x018F 6618: 0e 94 87 0a call 0x150e ; 0x150e lcd_MEM_string(CapZeich); // capacitor sign 661c: 86 e8 ldi r24, 0x86 ; 134 661e: 93 e0 ldi r25, 0x03 ; 3 6620: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(cap.cb); //Pin number 2 6624: 80 91 90 01 lds r24, 0x0190 6628: 0e 94 87 0a call 0x150e ; 0x150e #if FLASHEND > 0x1fff GetVloss(); // get Voltage loss of capacitor 662c: 0e 94 f8 25 call 0x4bf0 ; 0x4bf0 if (cap.v_loss != 0) { 6630: 80 91 8d 01 lds r24, 0x018D 6634: 90 91 8e 01 lds r25, 0x018E 6638: 89 2b or r24, r25 663a: 89 f0 breq .+34 ; 0x665e #if (LCD_LINES > 2) lcd_line3(); 663c: 0e 94 90 08 call 0x1120 ; 0x1120 lcd_MEM_string(&VLOSS_str[1]); // "Vloss=" 6640: 8e e6 ldi r24, 0x6E ; 110 6642: 93 e0 ldi r25, 0x03 ; 3 6644: 0e 94 bf 0a call 0x157e ; 0x157e #else lcd_MEM_string(VLOSS_str); // " Vloss=" #endif DisplayValue(cap.v_loss,-1,'%',2); 6648: 60 91 8d 01 lds r22, 0x018D 664c: 70 91 8e 01 lds r23, 0x018E 6650: 80 e0 ldi r24, 0x00 ; 0 6652: 90 e0 ldi r25, 0x00 ; 0 6654: 02 e0 ldi r16, 0x02 ; 2 6656: 25 e2 ldi r18, 0x25 ; 37 6658: 4f ef ldi r20, 0xFF ; 255 665a: 0e 94 a8 0b call 0x1750 ; 0x1750 } #endif lcd_line2(); //2. row 665e: 0e 94 85 08 call 0x110a ; 0x110a DisplayValue(cap.cval_max,cap.cpre_max,'F',4); 6662: 60 91 83 01 lds r22, 0x0183 6666: 70 91 84 01 lds r23, 0x0184 666a: 80 91 85 01 lds r24, 0x0185 666e: 90 91 86 01 lds r25, 0x0186 6672: 04 e0 ldi r16, 0x04 ; 4 6674: 26 e4 ldi r18, 0x46 ; 70 6676: 40 91 92 01 lds r20, 0x0192 667a: 0e 94 a8 0b call 0x1750 ; 0x1750 #if FLASHEND > 0x1fff cap.esr = GetESR(cap.cb, cap.ca); // get ESR of capacitor 667e: 60 91 8f 01 lds r22, 0x018F 6682: 80 91 90 01 lds r24, 0x0190 6686: 0e 94 1c 24 call 0x4838 ; 0x4838 668a: 90 93 8c 01 sts 0x018C, r25 668e: 80 93 8b 01 sts 0x018B, r24 if ( cap.esr < 65530) { 6692: 8a 3f cpi r24, 0xFA ; 250 6694: 9f 4f sbci r25, 0xFF ; 255 6696: e8 f4 brcc .+58 ; 0x66d2 lcd_MEM_string(ESR_str); // " ESR=" 6698: 85 e7 ldi r24, 0x75 ; 117 669a: 93 e0 ldi r25, 0x03 ; 3 669c: 0e 94 bf 0a call 0x157e ; 0x157e DisplayValue(cap.esr,-2,LCD_CHAR_OMEGA,2); 66a0: 60 91 8b 01 lds r22, 0x018B 66a4: 70 91 8c 01 lds r23, 0x018C 66a8: 80 e0 ldi r24, 0x00 ; 0 66aa: 90 e0 ldi r25, 0x00 ; 0 66ac: 02 e0 ldi r16, 0x02 ; 2 66ae: 24 e0 ldi r18, 0x04 ; 4 66b0: 4e ef ldi r20, 0xFE ; 254 66b2: 0e 94 a8 0b call 0x1750 ; 0x1750 #if (LCD_LINES > 2) lcd_set_cursor(0,4); 66b6: 64 e0 ldi r22, 0x04 ; 4 66b8: 80 e0 ldi r24, 0x00 ; 0 66ba: 0e 94 a6 08 call 0x114c ; 0x114c lcd_MEM_string(Resistor_str); // -[=]- 66be: 83 e4 ldi r24, 0x43 ; 67 66c0: 92 e0 ldi r25, 0x02 ; 2 66c2: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(cap.cb); //Pin number 2 66c6: 80 91 90 01 lds r24, 0x0190 66ca: 0e 94 87 0a call 0x150e ; 0x150e lcd_space(); 66ce: 0e 94 8b 0a call 0x1516 ; 0x1516 #endif } #endif #if FLASHEND > 0x3fff if ((cap.ca + cap.cb) == (TP1 + TP3)) { 66d2: 20 91 8f 01 lds r18, 0x018F 66d6: 80 91 90 01 lds r24, 0x0190 66da: 90 e0 ldi r25, 0x00 ; 0 66dc: 82 0f add r24, r18 66de: 91 1d adc r25, r1 66e0: 02 97 sbiw r24, 0x02 ; 2 66e2: 09 f0 breq .+2 ; 0x66e6 66e4: 3f c4 rjmp .+2174 ; 0x6f64 show_Cap13(); // automatic capacity measurement 66e6: 0e 94 aa 30 call 0x6154 ; 0x6154 goto start; 66ea: af ce rjmp .-674 ; 0x644a #endif goto tt_end; } /* end PartFound == PART_CAPACITOR */ // ======================================== if(PartFound == PART_DIODE) { 66ec: 82 30 cpi r24, 0x02 ; 2 66ee: 09 f0 breq .+2 ; 0x66f2 66f0: e6 c0 rjmp .+460 ; 0x68be // ======================================== if(NumOfDiodes == 1) { //single Diode 66f2: 80 91 1e 01 lds r24, 0x011E 66f6: 81 30 cpi r24, 0x01 ; 1 66f8: 09 f0 breq .+2 ; 0x66fc 66fa: 43 c0 rjmp .+134 ; 0x6782 lcd_MEM_string(KatAn); //"-|<-" lcd_testpin(diodes.Anode[0]); } #else // the higher test pin number is right side if (diodes.Anode[0] < diodes.Cathode[0]) { 66fc: 90 91 95 01 lds r25, 0x0195 6700: 80 91 9b 01 lds r24, 0x019B 6704: 98 17 cp r25, r24 6706: 50 f4 brcc .+20 ; 0x671c lcd_testpin(diodes.Anode[0]); 6708: 89 2f mov r24, r25 670a: 0e 94 87 0a call 0x150e ; 0x150e lcd_MEM_string(AnKat); //"->|-" 670e: 81 e5 ldi r24, 0x51 ; 81 6710: 92 e0 ldi r25, 0x02 ; 2 6712: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(diodes.Cathode[0]); 6716: 80 91 9b 01 lds r24, 0x019B 671a: 08 c0 rjmp .+16 ; 0x672c } else { lcd_testpin(diodes.Cathode[0]); 671c: 0e 94 87 0a call 0x150e ; 0x150e lcd_MEM_string(KatAn); //"-|<-" 6720: 8d e4 ldi r24, 0x4D ; 77 6722: 92 e0 ldi r25, 0x02 ; 2 6724: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(diodes.Anode[0]); 6728: 80 91 95 01 lds r24, 0x0195 672c: 0e 94 87 0a call 0x150e ; 0x150e lcd_testpin(diodes.Anode[0]); lcd_MEM_string(AnKat); //"->|-" lcd_testpin(diodes.Cathode[0]); #endif #if FLASHEND > 0x1fff GetIr(diodes.Cathode[0],diodes.Anode[0]); // measure and output Ir=x.xuA 6730: 60 91 95 01 lds r22, 0x0195 6734: 80 91 9b 01 lds r24, 0x019B 6738: 0e 94 70 14 call 0x28e0 ; 0x28e0 #endif UfAusgabe(0x70); // mark for additional resistor and output Uf= in line 2 673c: 80 e7 ldi r24, 0x70 ; 112 673e: 0e 94 6f 0b call 0x16de ; 0x16de /* load current of capacity is (5V-1.1V)/(470000 Ohm) = 8298nA */ ReadCapacity(diodes.Cathode[0],diodes.Anode[0]); // Capacity opposite flow direction 6742: 60 91 95 01 lds r22, 0x0195 6746: 80 91 9b 01 lds r24, 0x019B 674a: 0e 94 ed 1d call 0x3bda ; 0x3bda if (cap.cpre < -3) { /* capacity is measured */ 674e: 80 91 91 01 lds r24, 0x0191 6752: 8d 3f cpi r24, 0xFD ; 253 6754: 0c f0 brlt .+2 ; 0x6758 6756: 24 c3 rjmp .+1608 ; 0x6da0 #if (LCD_LINES > 3) lcd_line3(); // output Capacity in line 3 6758: 0e 94 90 08 call 0x1120 ; 0x1120 #endif lcd_MEM_string(Cap_str); //"C=" 675c: 83 eb ldi r24, 0xB3 ; 179 675e: 93 e0 ldi r25, 0x03 ; 3 6760: 0e 94 bf 0a call 0x157e ; 0x157e #if LCD_LINE_LENGTH > 16 DisplayValue(cap.cval,cap.cpre,'F',3); #else DisplayValue(cap.cval,cap.cpre,'F',2); 6764: 60 91 7f 01 lds r22, 0x017F 6768: 70 91 80 01 lds r23, 0x0180 676c: 80 91 81 01 lds r24, 0x0181 6770: 90 91 82 01 lds r25, 0x0182 6774: 02 e0 ldi r16, 0x02 ; 2 6776: 26 e4 ldi r18, 0x46 ; 70 6778: 40 91 91 01 lds r20, 0x0191 677c: 0e 94 a8 0b call 0x1750 ; 0x1750 6780: 0f c3 rjmp .+1566 ; 0x6da0 #endif } goto end3; } else if(NumOfDiodes == 2) { // double diode 6782: 82 30 cpi r24, 0x02 ; 2 6784: 09 f0 breq .+2 ; 0x6788 6786: 48 c0 rjmp .+144 ; 0x6818 lcd_data('2'); 6788: 82 e3 ldi r24, 0x32 ; 50 678a: 0e 94 3f 0a call 0x147e ; 0x147e lcd_MEM_string(Dioden); //"diodes " 678e: 88 e4 ldi r24, 0x48 ; 72 6790: 92 e0 ldi r25, 0x02 ; 2 6792: 0e 94 bf 0a call 0x157e ; 0x157e if(diodes.Anode[0] == diodes.Anode[1]) { //Common Anode 6796: 80 91 95 01 lds r24, 0x0195 679a: 20 91 96 01 lds r18, 0x0196 679e: 82 13 cpse r24, r18 67a0: 13 c0 rjmp .+38 ; 0x67c8 lcd_testpin(diodes.Cathode[0]); 67a2: 80 91 9b 01 lds r24, 0x019B 67a6: 0e 94 87 0a call 0x150e ; 0x150e lcd_MEM_string(KatAn); //"-|<-" 67aa: 8d e4 ldi r24, 0x4D ; 77 67ac: 92 e0 ldi r25, 0x02 ; 2 67ae: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(diodes.Anode[0]); 67b2: 80 91 95 01 lds r24, 0x0195 67b6: 0e 94 87 0a call 0x150e ; 0x150e lcd_MEM_string(AnKat); //"->|-" 67ba: 81 e5 ldi r24, 0x51 ; 81 67bc: 92 e0 ldi r25, 0x02 ; 2 67be: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(diodes.Cathode[1]); 67c2: 80 91 9c 01 lds r24, 0x019C 67c6: 16 c0 rjmp .+44 ; 0x67f4 UfAusgabe(0x01); goto end3; } if(diodes.Cathode[0] == diodes.Cathode[1]) { //Common Cathode 67c8: 30 91 9b 01 lds r19, 0x019B 67cc: 90 91 9c 01 lds r25, 0x019C 67d0: 39 13 cpse r19, r25 67d2: 16 c0 rjmp .+44 ; 0x6800 lcd_testpin(diodes.Anode[0]); 67d4: 0e 94 87 0a call 0x150e ; 0x150e lcd_MEM_string(AnKat); //"->|-" 67d8: 81 e5 ldi r24, 0x51 ; 81 67da: 92 e0 ldi r25, 0x02 ; 2 67dc: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(diodes.Cathode[0]); 67e0: 80 91 9b 01 lds r24, 0x019B 67e4: 0e 94 87 0a call 0x150e ; 0x150e lcd_MEM_string(KatAn); //"-|<-" 67e8: 8d e4 ldi r24, 0x4D ; 77 67ea: 92 e0 ldi r25, 0x02 ; 2 67ec: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(diodes.Anode[1]); 67f0: 80 91 96 01 lds r24, 0x0196 67f4: 0e 94 87 0a call 0x150e ; 0x150e UfAusgabe(0x01); 67f8: 81 e0 ldi r24, 0x01 ; 1 67fa: 0e 94 6f 0b call 0x16de ; 0x16de goto end3; 67fe: d0 c2 rjmp .+1440 ; 0x6da0 // else if ((diodes.Cathode[0] == diodes.Anode[1]) && (diodes.Cathode[1] == diodes.Anode[0])) } if (diodes.Cathode[0] == diodes.Anode[1]) { 6800: 32 13 cpse r19, r18 6802: 04 c0 rjmp .+8 ; 0x680c // normaly two serial diodes are detected as three diodes, but if the threshold is high // for both diodes, the third diode is not detected. // can also be Antiparallel diode_sequence = 0x01; // 0 1 6804: 81 e0 ldi r24, 0x01 ; 1 6806: 80 93 13 01 sts 0x0113, r24 680a: 40 c0 rjmp .+128 ; 0x688c SerienDiodenAusgabe(); goto end3; } if (diodes.Cathode[1] == diodes.Anode[0]) { 680c: 98 13 cpse r25, r24 680e: 41 c0 rjmp .+130 ; 0x6892 diode_sequence = 0x10; // 1 0 6810: f0 e1 ldi r31, 0x10 ; 16 6812: f0 93 13 01 sts 0x0113, r31 6816: 3a c0 rjmp .+116 ; 0x688c SerienDiodenAusgabe(); goto end3; } } else if(NumOfDiodes == 3) { 6818: 83 30 cpi r24, 0x03 ; 3 681a: d9 f5 brne .+118 ; 0x6892 //Serial of 2 Diodes; was detected as 3 Diodes diode_sequence = 0x33; // 3 3 681c: 83 e3 ldi r24, 0x33 ; 51 681e: 80 93 13 01 sts 0x0113, r24 /* Check for any constellation of 2 serial diodes: Only once the pin No of anyone Cathode is identical of another anode. two diodes in series is additionally detected as third big diode. */ if(diodes.Cathode[0] == diodes.Anode[1]) 6822: 80 91 9b 01 lds r24, 0x019B 6826: 90 91 96 01 lds r25, 0x0196 682a: 89 13 cpse r24, r25 682c: 03 c0 rjmp .+6 ; 0x6834 { diode_sequence = 0x01; // 0 1 682e: 21 e0 ldi r18, 0x01 ; 1 6830: 20 93 13 01 sts 0x0113, r18 } if(diodes.Anode[0] == diodes.Cathode[1]) 6834: 40 91 95 01 lds r20, 0x0195 6838: 30 91 9c 01 lds r19, 0x019C 683c: 43 13 cpse r20, r19 683e: 03 c0 rjmp .+6 ; 0x6846 { diode_sequence = 0x10; // 1 0 6840: 20 e1 ldi r18, 0x10 ; 16 6842: 20 93 13 01 sts 0x0113, r18 } if(diodes.Cathode[0] == diodes.Anode[2]) 6846: 20 91 97 01 lds r18, 0x0197 684a: 82 13 cpse r24, r18 684c: 03 c0 rjmp .+6 ; 0x6854 { diode_sequence = 0x02; // 0 2 684e: 82 e0 ldi r24, 0x02 ; 2 6850: 80 93 13 01 sts 0x0113, r24 } if(diodes.Anode[0] == diodes.Cathode[2]) 6854: 80 91 9d 01 lds r24, 0x019D 6858: 48 13 cpse r20, r24 685a: 03 c0 rjmp .+6 ; 0x6862 { diode_sequence = 0x20; // 2 0 685c: 40 e2 ldi r20, 0x20 ; 32 685e: 40 93 13 01 sts 0x0113, r20 } if(diodes.Cathode[1] == diodes.Anode[2]) 6862: 32 13 cpse r19, r18 6864: 03 c0 rjmp .+6 ; 0x686c { diode_sequence = 0x12; // 1 2 6866: 22 e1 ldi r18, 0x12 ; 18 6868: 20 93 13 01 sts 0x0113, r18 } if(diodes.Anode[1] == diodes.Cathode[2]) 686c: 98 13 cpse r25, r24 686e: 03 c0 rjmp .+6 ; 0x6876 { diode_sequence = 0x21; // 2 1 6870: 81 e2 ldi r24, 0x21 ; 33 6872: 80 93 13 01 sts 0x0113, r24 } // if((ptrans.b<3) && (ptrans.c<3)) if(diode_sequence < 0x22) { 6876: 80 91 13 01 lds r24, 0x0113 687a: 82 32 cpi r24, 0x22 ; 34 687c: 50 f4 brcc .+20 ; 0x6892 lcd_data('3'); 687e: 83 e3 ldi r24, 0x33 ; 51 6880: 0e 94 3f 0a call 0x147e ; 0x147e lcd_MEM_string(Dioden); //"Diodes " 6884: 88 e4 ldi r24, 0x48 ; 72 6886: 92 e0 ldi r25, 0x02 ; 2 6888: 0e 94 bf 0a call 0x157e ; 0x157e SerienDiodenAusgabe(); 688c: 0e 94 85 0b call 0x170a ; 0x170a goto end3; 6890: 87 c2 rjmp .+1294 ; 0x6da0 } } // end (NumOfDiodes == 3) lcd_MEM_string(Bauteil); //"Bauteil" 6892: 83 ed ldi r24, 0xD3 ; 211 6894: 94 e0 ldi r25, 0x04 ; 4 6896: 0e 94 bf 0a call 0x157e ; 0x157e lcd_MEM_string(Unknown); //" unbek." 689a: 8b eb ldi r24, 0xBB ; 187 689c: 94 e0 ldi r25, 0x04 ; 4 689e: 0e 94 bf 0a call 0x157e ; 0x157e lcd_line2(); //2. row 68a2: 0e 94 85 08 call 0x110a ; 0x110a lcd_MEM_string(OrBroken); //"oder defekt " 68a6: 8f e9 ldi r24, 0x9F ; 159 68a8: 94 e0 ldi r25, 0x04 ; 4 68aa: 0e 94 bf 0a call 0x157e ; 0x157e lcd_data(NumOfDiodes + '0'); 68ae: 80 91 1e 01 lds r24, 0x011E 68b2: 80 5d subi r24, 0xD0 ; 208 68b4: 0e 94 3f 0a call 0x147e ; 0x147e lcd_MEM_string(AnKat); //"->|-" 68b8: 81 e5 ldi r24, 0x51 ; 81 68ba: 92 e0 ldi r25, 0x02 ; 2 68bc: 4b c3 rjmp .+1686 ; 0x6f54 goto not_known; // end (PartFound == PART_DIODE) // ======================================== } else if (PartFound == PART_TRANSISTOR) { 68be: 83 30 cpi r24, 0x03 ; 3 68c0: 09 f0 breq .+2 ; 0x68c4 68c2: 4a c1 rjmp .+660 ; 0x6b58 // ======================================== #ifdef SEARCH_PARASITIC if ((ptrans.count != 0) && (ntrans.count !=0)) { 68c4: 80 91 74 01 lds r24, 0x0174 68c8: 88 23 and r24, r24 68ca: 99 f1 breq .+102 ; 0x6932 68cc: 80 91 5a 01 lds r24, 0x015A 68d0: 88 23 and r24, r24 68d2: 79 f1 breq .+94 ; 0x6932 // Special Handling of NPNp and PNPn Transistor. // If a protection diode is built on the same structur as the NPN-Transistor, // a parasitic PNP-Transistor will be detected. ReadCapacity(ntrans.e, ntrans.b); // read capacity of NPN base-emitter 68d4: 60 91 57 01 lds r22, 0x0157 68d8: 80 91 59 01 lds r24, 0x0159 68dc: 0e 94 ed 1d call 0x3bda ; 0x3bda n_cval = cap.cval; // save the found capacity value 68e0: 40 90 7f 01 lds r4, 0x017F 68e4: 50 90 80 01 lds r5, 0x0180 68e8: 60 90 81 01 lds r6, 0x0181 68ec: 70 90 82 01 lds r7, 0x0182 n_cpre = cap.cpre; // and dimension 68f0: 10 91 91 01 lds r17, 0x0191 ReadCapacity(ptrans.b, ptrans.e); // read capacity of PNP base-emitter 68f4: 60 91 73 01 lds r22, 0x0173 68f8: 80 91 71 01 lds r24, 0x0171 68fc: 0e 94 ed 1d call 0x3bda ; 0x3bda if (((n_cpre == cap.cpre) && (cap.cval > n_cval)) || (cap.cpre > n_cpre)){ 6900: 80 91 91 01 lds r24, 0x0191 6904: 18 13 cpse r17, r24 6906: 0e c0 rjmp .+28 ; 0x6924 6908: 80 91 7f 01 lds r24, 0x017F 690c: 90 91 80 01 lds r25, 0x0180 6910: a0 91 81 01 lds r26, 0x0181 6914: b0 91 82 01 lds r27, 0x0182 6918: 48 16 cp r4, r24 691a: 59 06 cpc r5, r25 691c: 6a 06 cpc r6, r26 691e: 7b 06 cpc r7, r27 6920: 18 f0 brcs .+6 ; 0x6928 6922: 04 c0 rjmp .+8 ; 0x692c 6924: 18 17 cp r17, r24 6926: 14 f4 brge .+4 ; 0x692c // the capacity value or dimension of the PNP B-E is greater than the NPN B-E PartMode = PART_MODE_PNP; 6928: 8d e0 ldi r24, 0x0D ; 13 692a: 01 c0 rjmp .+2 ; 0x692e } else { PartMode = PART_MODE_NPN; 692c: 8c e0 ldi r24, 0x0C ; 12 692e: 80 93 1f 01 sts 0x011F, r24 } } /* end ((ptrans.count != 0) && (ntrans.count !=0)) */ #endif // not possible for mega8, change Pin sequence instead. if ((ptrans.count != 0) && (ntrans.count !=0) && (!(RST_PIN_REG & (1< 693a: 80 91 5a 01 lds r24, 0x015A 693e: 88 23 and r24, r24 6940: 41 f0 breq .+16 ; 0x6952 6942: 4f 99 sbic 0x09, 7 ; 9 6944: 06 c0 rjmp .+12 ; 0x6952 PartMode = PART_MODE_PNP; // switch to parasitic transistor } else { PartMode = PART_MODE_NPN; // switch to parasitic transistor } #else PartMode ^= (PART_MODE_PNP - PART_MODE_NPN); 6946: 80 91 1f 01 lds r24, 0x011F 694a: 91 e0 ldi r25, 0x01 ; 1 694c: 89 27 eor r24, r25 694e: 80 93 1f 01 sts 0x011F, r24 #endif } #ifdef WITH_GRAPHICS lcd_set_cursor(0,TEXT_RIGHT_TO_ICON); // position behind the icon, Line 1 6952: 66 e0 ldi r22, 0x06 ; 6 6954: 80 e0 ldi r24, 0x00 ; 0 6956: 0e 94 a6 08 call 0x114c ; 0x114c lcd_big_icon(BJT_NPN|LCD_UPPER_LEFT); // show the NPN Icon at lower left corner 695a: 80 e3 ldi r24, 0x30 ; 48 695c: 0e 94 f5 09 call 0x13ea ; 0x13ea if(PartMode == PART_MODE_NPN) { 6960: 80 91 1f 01 lds r24, 0x011F 6964: 8c 30 cpi r24, 0x0C ; 12 6966: 51 f4 brne .+20 ; 0x697c // _trans = &ntrans; is allready selected a default lcd_MEM_string(NPN_str); //"NPN " 6968: 8b ea ldi r24, 0xAB ; 171 696a: 93 e0 ldi r25, 0x03 ; 3 696c: 0e 94 bf 0a call 0x157e ; 0x157e if (ptrans.count != 0) { 6970: 80 91 74 01 lds r24, 0x0174 6974: 88 23 and r24, r24 6976: a9 f0 breq .+42 ; 0x69a2 lcd_data('p'); // mark for parasitic PNp 6978: 80 e7 ldi r24, 0x70 ; 112 697a: 11 c0 rjmp .+34 ; 0x699e } } else { _trans = &ptrans; // change transistor structure 697c: f0 92 49 01 sts 0x0149, r15 6980: e0 92 48 01 sts 0x0148, r14 lcd_update_icon(bmp_pnp); // update for PNP 6984: 85 ec ldi r24, 0xC5 ; 197 6986: 90 e0 ldi r25, 0x00 ; 0 6988: 0e 94 3b 0a call 0x1476 ; 0x1476 lcd_MEM_string(PNP_str); //"PNP " 698c: 83 ea ldi r24, 0xA3 ; 163 698e: 93 e0 ldi r25, 0x03 ; 3 6990: 0e 94 bf 0a call 0x157e ; 0x157e if (ntrans.count != 0) { 6994: 80 91 5a 01 lds r24, 0x015A 6998: 88 23 and r24, r24 699a: 19 f0 breq .+6 ; 0x69a2 lcd_data('n'); // mark for parasitic NPn 699c: 8e e6 ldi r24, 0x6E ; 110 699e: 0e 94 3f 0a call 0x147e ; 0x147e // show the protection diode of the BJT #if FLASHEND > 0x3fff vak_diode_nr = 20; #endif an_cat = 0; for (ii=0; iib) || (diodes.Cathode[ii] == _trans->b)) continue; 69a6: 40 91 48 01 lds r20, 0x0148 69aa: 50 91 49 01 lds r21, 0x0149 69ae: ab e9 ldi r26, 0x9B ; 155 69b0: b1 e0 ldi r27, 0x01 ; 1 // show the protection diode of the BJT #if FLASHEND > 0x3fff vak_diode_nr = 20; #endif an_cat = 0; for (ii=0; ii if ((diodes.Anode[ii] == _trans->b) || (diodes.Cathode[ii] == _trans->b)) continue; 69c2: fb 01 movw r30, r22 69c4: 81 91 ld r24, Z+ 69c6: bf 01 movw r22, r30 69c8: fa 01 movw r30, r20 69ca: 94 85 ldd r25, Z+12 ; 0x0c 69cc: 89 17 cp r24, r25 69ce: 19 f0 breq .+6 ; 0x69d6 69d0: 3c 91 ld r19, X 69d2: 39 13 cpse r19, r25 69d4: 02 c0 rjmp .+4 ; 0x69da 69d6: 11 96 adiw r26, 0x01 ; 1 69d8: ee cf rjmp .-36 ; 0x69b6 // no side of the diode is connected to the base, this must be the protection diode #ifdef WITH_GRAPHICS options = 0; if (_trans->c != diodes.Anode[ii]) 69da: fa 01 movw r30, r20 69dc: 95 85 ldd r25, Z+13 ; 0x0d 69de: 98 13 cpse r25, r24 69e0: 02 c0 rjmp .+4 ; 0x69e6 an_cat = 0; for (ii=0; iib) || (diodes.Cathode[ii] == _trans->b)) continue; // no side of the diode is connected to the base, this must be the protection diode #ifdef WITH_GRAPHICS options = 0; 69e2: 60 e0 ldi r22, 0x00 ; 0 69e4: 01 c0 rjmp .+2 ; 0x69e8 if (_trans->c != diodes.Anode[ii]) options |= OPT_VREVERSE; 69e6: 62 e0 ldi r22, 0x02 ; 2 lcd_update_icon_opt(bmp_vakdiode,options); // show the protection diode right to the Icon 69e8: 80 e9 ldi r24, 0x90 ; 144 69ea: 90 e0 ldi r25, 0x00 ; 0 69ec: 0e 94 22 0a call 0x1444 ; 0x1444 } #endif /* !WITH_GRAPHICS */ #if FLASHEND > 0x3fff vak_diode_nr = ii; // save number of protection diode for Uf= #endif break; // there is only one protection diode, is found 69f0: 01 c0 rjmp .+2 ; 0x69f4 lcd_space(); #endif // show the protection diode of the BJT #if FLASHEND > 0x3fff vak_diode_nr = 20; 69f2: 14 e1 ldi r17, 0x14 ; 20 #endif break; // there is only one protection diode, is found } /* end for ii */ #ifdef WITH_GRAPHICS lcd_draw_trans_pins(-7, 16); // show the pin numbers 69f4: 60 e1 ldi r22, 0x10 ; 16 69f6: 89 ef ldi r24, 0xF9 ; 249 69f8: 0e 94 8a 0c call 0x1914 ; 0x1914 lcd_next_line(TEXT_RIGHT_TO_ICON); // position behind the icon, Line 2 69fc: 86 e0 ldi r24, 0x06 ; 6 69fe: 0e 94 b0 08 call 0x1160 ; 0x1160 lcd_MEM_string(hfe_str); //"B=" (hFE) 6a02: 8a eb ldi r24, 0xBA ; 186 6a04: 93 e0 ldi r25, 0x03 ; 3 6a06: 0e 94 bf 0a call 0x157e ; 0x157e DisplayValue(_trans->hfe,0,0,3); 6a0a: e0 91 48 01 lds r30, 0x0148 6a0e: f0 91 49 01 lds r31, 0x0149 6a12: 60 81 ld r22, Z 6a14: 71 81 ldd r23, Z+1 ; 0x01 6a16: 82 81 ldd r24, Z+2 ; 0x02 6a18: 93 81 ldd r25, Z+3 ; 0x03 6a1a: 03 e0 ldi r16, 0x03 ; 3 6a1c: 20 e0 ldi r18, 0x00 ; 0 6a1e: 40 e0 ldi r20, 0x00 ; 0 6a20: 0e 94 a8 0b call 0x1750 ; 0x1750 lcd_next_line(TEXT_RIGHT_TO_ICON+1); // position behind the icon, Line 3 6a24: 87 e0 ldi r24, 0x07 ; 7 6a26: 0e 94 b0 08 call 0x1160 ; 0x1160 lcd_data('I'); 6a2a: 89 e4 ldi r24, 0x49 ; 73 6a2c: 0e 94 3f 0a call 0x147e ; 0x147e if (_trans->current >= 10000) { 6a30: e0 91 48 01 lds r30, 0x0148 6a34: f0 91 49 01 lds r31, 0x0149 6a38: 86 81 ldd r24, Z+6 ; 0x06 6a3a: 97 81 ldd r25, Z+7 ; 0x07 6a3c: 80 31 cpi r24, 0x10 ; 16 6a3e: 97 42 sbci r25, 0x27 ; 39 6a40: 70 f0 brcs .+28 ; 0x6a5e lcd_data('e'); // emitter current has 10mA offset 6a42: 85 e6 ldi r24, 0x65 ; 101 6a44: 0e 94 3f 0a call 0x147e ; 0x147e _trans->current -= 10000; 6a48: e0 91 48 01 lds r30, 0x0148 6a4c: f0 91 49 01 lds r31, 0x0149 6a50: 86 81 ldd r24, Z+6 ; 0x06 6a52: 97 81 ldd r25, Z+7 ; 0x07 6a54: 80 51 subi r24, 0x10 ; 16 6a56: 97 42 sbci r25, 0x27 ; 39 6a58: 97 83 std Z+7, r25 ; 0x07 6a5a: 86 83 std Z+6, r24 ; 0x06 6a5c: 03 c0 rjmp .+6 ; 0x6a64 } else { lcd_data('c'); 6a5e: 83 e6 ldi r24, 0x63 ; 99 6a60: 0e 94 3f 0a call 0x147e ; 0x147e } lcd_data('='); 6a64: 8d e3 ldi r24, 0x3D ; 61 6a66: 0e 94 3f 0a call 0x147e ; 0x147e DisplayValue(_trans->current,-6,'A',2); // display Ic or Ie current 6a6a: e0 91 48 01 lds r30, 0x0148 6a6e: f0 91 49 01 lds r31, 0x0149 6a72: 66 81 ldd r22, Z+6 ; 0x06 6a74: 77 81 ldd r23, Z+7 ; 0x07 6a76: 80 e0 ldi r24, 0x00 ; 0 6a78: 90 e0 ldi r25, 0x00 ; 0 6a7a: 02 e0 ldi r16, 0x02 ; 2 6a7c: 21 e4 ldi r18, 0x41 ; 65 6a7e: 4a ef ldi r20, 0xFA ; 250 6a80: 0e 94 a8 0b call 0x1750 ; 0x1750 lcd_next_line(TEXT_RIGHT_TO_ICON); // position behind the icon, Line 4 6a84: 86 e0 ldi r24, 0x06 ; 6 6a86: 0e 94 b0 08 call 0x1160 ; 0x1160 lcd_MEM_string(Ube_str); //"Ube=" 6a8a: 88 e9 ldi r24, 0x98 ; 152 6a8c: 93 e0 ldi r25, 0x03 ; 3 6a8e: 0e 94 bf 0a call 0x157e ; 0x157e Display_mV(_trans->uBE,3); 6a92: e0 91 48 01 lds r30, 0x0148 6a96: f0 91 49 01 lds r31, 0x0149 6a9a: 63 e0 ldi r22, 0x03 ; 3 6a9c: 84 81 ldd r24, Z+4 ; 0x04 6a9e: 95 81 ldd r25, Z+5 ; 0x05 6aa0: 0e 94 6d 0c call 0x18da ; 0x18da last_line_used = 1; 6aa4: 81 e0 ldi r24, 0x01 ; 1 6aa6: 80 93 4a 01 sts 0x014A, r24 #ifdef SHOW_ICE if (_trans->ice0 > 0) { 6aaa: e0 91 48 01 lds r30, 0x0148 6aae: f0 91 49 01 lds r31, 0x0149 6ab2: 80 85 ldd r24, Z+8 ; 0x08 6ab4: 91 85 ldd r25, Z+9 ; 0x09 6ab6: 89 2b or r24, r25 6ab8: 99 f0 breq .+38 ; 0x6ae0 lcd_next_line_wait(TEXT_RIGHT_TO_ICON-1); // position behind the icon, Line 4 & wait and clear last line 6aba: 85 e0 ldi r24, 0x05 ; 5 6abc: 0e 94 c8 08 call 0x1190 ; 0x1190 lcd_MEM2_string(ICE0_str); // "ICE0=" 6ac0: 8a e2 ldi r24, 0x2A ; 42 6ac2: 92 e0 ldi r25, 0x02 ; 2 6ac4: 0e 94 bf 0a call 0x157e ; 0x157e DisplayValue(_trans->ice0,-6,'A',2); // display ICEO 6ac8: e0 91 48 01 lds r30, 0x0148 6acc: f0 91 49 01 lds r31, 0x0149 6ad0: 60 85 ldd r22, Z+8 ; 0x08 6ad2: 71 85 ldd r23, Z+9 ; 0x09 6ad4: 80 e0 ldi r24, 0x00 ; 0 6ad6: 90 e0 ldi r25, 0x00 ; 0 6ad8: 21 e4 ldi r18, 0x41 ; 65 6ada: 4a ef ldi r20, 0xFA ; 250 6adc: 0e 94 a8 0b call 0x1750 ; 0x1750 } if (_trans->ices > 0) { 6ae0: e0 91 48 01 lds r30, 0x0148 6ae4: f0 91 49 01 lds r31, 0x0149 6ae8: 82 85 ldd r24, Z+10 ; 0x0a 6aea: 93 85 ldd r25, Z+11 ; 0x0b 6aec: 89 2b or r24, r25 6aee: a1 f0 breq .+40 ; 0x6b18 lcd_next_line_wait(TEXT_RIGHT_TO_ICON-1); // position behind the icon, Line 4 & wait and clear last line 6af0: 85 e0 ldi r24, 0x05 ; 5 6af2: 0e 94 c8 08 call 0x1190 ; 0x1190 lcd_MEM2_string(ICEs_str); // "ICEs=" 6af6: 84 e2 ldi r24, 0x24 ; 36 6af8: 92 e0 ldi r25, 0x02 ; 2 6afa: 0e 94 bf 0a call 0x157e ; 0x157e DisplayValue(_trans->ices,-6,'A',2); // display ICEs 6afe: e0 91 48 01 lds r30, 0x0148 6b02: f0 91 49 01 lds r31, 0x0149 6b06: 62 85 ldd r22, Z+10 ; 0x0a 6b08: 73 85 ldd r23, Z+11 ; 0x0b 6b0a: 80 e0 ldi r24, 0x00 ; 0 6b0c: 90 e0 ldi r25, 0x00 ; 0 6b0e: 02 e0 ldi r16, 0x02 ; 2 6b10: 21 e4 ldi r18, 0x41 ; 65 6b12: 4a ef ldi r20, 0xFA ; 250 6b14: 0e 94 a8 0b call 0x1750 ; 0x1750 DisplayValue(_trans->ices,-6,'A',3); } #endif #endif /* WITH_GRAPHICS */ #if FLASHEND > 0x3fff if (vak_diode_nr < 5) { 6b18: 15 30 cpi r17, 0x05 ; 5 6b1a: 08 f0 brcs .+2 ; 0x6b1e 6b1c: 23 c2 rjmp .+1094 ; 0x6f64 lcd_next_line_wait(0); // next line, wait 5s and clear line 2/4 6b1e: 80 e0 ldi r24, 0x00 ; 0 6b20: 0e 94 c8 08 call 0x1190 ; 0x1190 if (an_cat) { lcd_testpin(diodes.Anode[vak_diode_nr]); lcd_MEM_string(AnKat); //"->|-" lcd_testpin(diodes.Cathode[vak_diode_nr]); } else { lcd_testpin(diodes.Cathode[vak_diode_nr]); 6b24: 81 2e mov r8, r17 6b26: 91 2c mov r9, r1 6b28: 94 01 movw r18, r8 6b2a: 2b 56 subi r18, 0x6B ; 107 6b2c: 3e 4f sbci r19, 0xFE ; 254 6b2e: 49 01 movw r8, r18 6b30: f9 01 movw r30, r18 6b32: 86 81 ldd r24, Z+6 ; 0x06 6b34: 0e 94 87 0a call 0x150e ; 0x150e lcd_MEM_string(KatAn); //"-|<-" 6b38: 8d e4 ldi r24, 0x4D ; 77 6b3a: 92 e0 ldi r25, 0x02 ; 2 6b3c: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(diodes.Anode[vak_diode_nr]); 6b40: f4 01 movw r30, r8 6b42: 80 81 ld r24, Z 6b44: 0e 94 87 0a call 0x150e ; 0x150e } lcd_space(); 6b48: 0e 94 8b 0a call 0x1516 ; 0x1516 lcd_MEM_string(Uf_str); //"Uf=" 6b4c: 84 e9 ldi r24, 0x94 ; 148 6b4e: 93 e0 ldi r25, 0x03 ; 3 6b50: 0e 94 bf 0a call 0x157e ; 0x157e mVAusgabe(vak_diode_nr); 6b54: 81 2f mov r24, r17 6b56: 21 c1 rjmp .+578 ; 0x6d9a #endif goto tt_end; // end (PartFound == PART_TRANSISTOR) // ======================================== } else if (PartFound == PART_FET) { /* JFET or MOSFET */ 6b58: 84 30 cpi r24, 0x04 ; 4 6b5a: 09 f0 breq .+2 ; 0x6b5e 6b5c: 2c c1 rjmp .+600 ; 0x6db6 // ======================================== unsigned char fetidx = 0; #ifdef WITH_GRAPHICS lcd_set_cursor(0,TEXT_RIGHT_TO_ICON); // position behind the icon, Line 1 6b5e: 66 e0 ldi r22, 0x06 ; 6 6b60: 80 e0 ldi r24, 0x00 ; 0 6b62: 0e 94 a6 08 call 0x114c ; 0x114c #endif if((PartMode&P_CHANNEL) == P_CHANNEL) { 6b66: 80 91 1f 01 lds r24, 0x011F 6b6a: 84 ff sbrs r24, 4 6b6c: 09 c0 rjmp .+18 ; 0x6b80 lcd_data('P'); //P-channel 6b6e: 80 e5 ldi r24, 0x50 ; 80 6b70: 0e 94 3f 0a call 0x147e ; 0x147e _trans = &ptrans; 6b74: f0 92 49 01 sts 0x0149, r15 6b78: e0 92 48 01 sts 0x0148, r14 fetidx += 1; 6b7c: 11 e0 ldi r17, 0x01 ; 1 6b7e: 04 c0 rjmp .+8 ; 0x6b88 } else { lcd_data('N'); //N-channel 6b80: 8e e4 ldi r24, 0x4E ; 78 6b82: 0e 94 3f 0a call 0x147e ; 0x147e // end (PartFound == PART_TRANSISTOR) // ======================================== } else if (PartFound == PART_FET) { /* JFET or MOSFET */ // ======================================== unsigned char fetidx = 0; 6b86: 10 e0 ldi r17, 0x00 ; 0 fetidx += 1; } else { lcd_data('N'); //N-channel // _trans = &ntrans; is allready selected as default } lcd_data('-'); // minus is used for JFET, D-MOS, E-MOS ... 6b88: 8d e2 ldi r24, 0x2D ; 45 6b8a: 0e 94 3f 0a call 0x147e ; 0x147e tmp = PartMode&0x0f; 6b8e: 80 91 1f 01 lds r24, 0x011F 6b92: 08 2f mov r16, r24 6b94: 0f 70 andi r16, 0x0F ; 15 #ifdef WITH_GRAPHICS if (tmp == PART_MODE_JFET) { 6b96: 04 30 cpi r16, 0x04 ; 4 6b98: 61 f4 brne .+24 ; 0x6bb2 lcd_MEM_string(jfet_str); //"JFET" 6b9a: 85 ec ldi r24, 0xC5 ; 197 6b9c: 93 e0 ldi r25, 0x03 ; 3 6b9e: 0e 94 bf 0a call 0x157e ; 0x157e lcd_big_icon(N_JFET|LCD_UPPER_LEFT); 6ba2: 83 e3 ldi r24, 0x33 ; 51 6ba4: 0e 94 f5 09 call 0x13ea ; 0x13ea if (fetidx != 0) { 6ba8: 11 23 and r17, r17 6baa: e1 f1 breq .+120 ; 0x6c24 lcd_update_icon(bmp_p_jfet); // update the n_jfet bitmap to p_jfet 6bac: 8e ec ldi r24, 0xCE ; 206 6bae: 90 e0 ldi r25, 0x00 ; 0 6bb0: 37 c0 rjmp .+110 ; 0x6c20 } } else { // no JFET if ((PartMode&D_MODE) == D_MODE) { 6bb2: 85 ff sbrs r24, 5 6bb4: 05 c0 rjmp .+10 ; 0x6bc0 lcd_data('D'); // N-D or P-D 6bb6: 84 e4 ldi r24, 0x44 ; 68 6bb8: 0e 94 3f 0a call 0x147e ; 0x147e fetidx += 2; 6bbc: 1e 5f subi r17, 0xFE ; 254 6bbe: 03 c0 rjmp .+6 ; 0x6bc6 } else { lcd_data('E'); // N-E or P-E 6bc0: 85 e4 ldi r24, 0x45 ; 69 6bc2: 0e 94 3f 0a call 0x147e ; 0x147e } if (tmp == (PART_MODE_IGBT)) { 6bc6: 03 30 cpi r16, 0x03 ; 3 6bc8: b1 f4 brne .+44 ; 0x6bf6 lcd_MEM_string(igbt_str); //"-IGBT" 6bca: 8f eb ldi r24, 0xBF ; 191 6bcc: 93 e0 ldi r25, 0x03 ; 3 6bce: 0e 94 bf 0a call 0x157e ; 0x157e lcd_big_icon(N_E_IGBT|LCD_UPPER_LEFT); 6bd2: 81 e3 ldi r24, 0x31 ; 49 6bd4: 0e 94 f5 09 call 0x13ea ; 0x13ea if (fetidx == 1) lcd_update_icon(bmp_p_e_igbt); 6bd8: 11 30 cpi r17, 0x01 ; 1 6bda: 19 f4 brne .+6 ; 0x6be2 6bdc: 87 e2 ldi r24, 0x27 ; 39 6bde: 91 e0 ldi r25, 0x01 ; 1 6be0: 1f c0 rjmp .+62 ; 0x6c20 if (fetidx == 2) lcd_update_icon(bmp_n_d_igbt); 6be2: 12 30 cpi r17, 0x02 ; 2 6be4: 19 f4 brne .+6 ; 0x6bec 6be6: 8b e1 ldi r24, 0x1B ; 27 6be8: 91 e0 ldi r25, 0x01 ; 1 6bea: 1a c0 rjmp .+52 ; 0x6c20 if (fetidx == 3) lcd_update_icon(bmp_p_d_igbt); 6bec: 13 30 cpi r17, 0x03 ; 3 6bee: d1 f4 brne .+52 ; 0x6c24 6bf0: 87 ef ldi r24, 0xF7 ; 247 6bf2: 90 e0 ldi r25, 0x00 ; 0 6bf4: 15 c0 rjmp .+42 ; 0x6c20 } else { lcd_MEM_string(mosfet_str); //"-MOS " 6bf6: 8a ec ldi r24, 0xCA ; 202 6bf8: 93 e0 ldi r25, 0x03 ; 3 6bfa: 0e 94 bf 0a call 0x157e ; 0x157e lcd_big_icon(N_E_MOS|LCD_UPPER_LEFT); 6bfe: 82 e3 ldi r24, 0x32 ; 50 6c00: 0e 94 f5 09 call 0x13ea ; 0x13ea if (fetidx == 1) lcd_update_icon(bmp_p_e_mos); 6c04: 11 30 cpi r17, 0x01 ; 1 6c06: 19 f4 brne .+6 ; 0x6c0e 6c08: 8d ee ldi r24, 0xED ; 237 6c0a: 90 e0 ldi r25, 0x00 ; 0 6c0c: 09 c0 rjmp .+18 ; 0x6c20 if (fetidx == 2) lcd_update_icon(bmp_n_d_mos); 6c0e: 12 30 cpi r17, 0x02 ; 2 6c10: 19 f4 brne .+6 ; 0x6c18 6c12: 87 ee ldi r24, 0xE7 ; 231 6c14: 90 e0 ldi r25, 0x00 ; 0 6c16: 04 c0 rjmp .+8 ; 0x6c20 if (fetidx == 3) lcd_update_icon(bmp_p_d_mos); 6c18: 13 30 cpi r17, 0x03 ; 3 6c1a: 21 f4 brne .+8 ; 0x6c24 6c1c: 85 ed ldi r24, 0xD5 ; 213 6c1e: 90 e0 ldi r25, 0x00 ; 0 6c20: 0e 94 3b 0a call 0x1476 ; 0x1476 PinLayout('S','G','D'); // SGD= or 123=... } #endif /* WITH_GRAPHICS */ an_cat = 0; if(NumOfDiodes == 1) { 6c24: 80 91 1e 01 lds r24, 0x011E 6c28: 81 30 cpi r24, 0x01 ; 1 6c2a: 21 f5 brne .+72 ; 0x6c74 // Layout with SGD= style an_cat = (PartMode&P_CHANNEL); /* N or P MOS */ #endif #else /* EBC_STYLE not defined */ // layout with 123= style an_cat = (((PartMode&P_CHANNEL) && (ptrans.c < ptrans.e)) || ((!(PartMode&P_CHANNEL)) && (ntrans.c > ntrans.e))); 6c2c: 80 91 1f 01 lds r24, 0x011F 6c30: 84 ff sbrs r24, 4 6c32: 08 c0 rjmp .+16 ; 0x6c44 6c34: 90 91 72 01 lds r25, 0x0172 6c38: 80 91 73 01 lds r24, 0x0173 6c3c: 98 17 cp r25, r24 6c3e: 40 f0 brcs .+16 ; 0x6c50 6c40: 10 e0 ldi r17, 0x00 ; 0 6c42: 07 c0 rjmp .+14 ; 0x6c52 6c44: 90 91 58 01 lds r25, 0x0158 6c48: 80 91 59 01 lds r24, 0x0159 6c4c: 89 17 cp r24, r25 6c4e: c0 f7 brcc .-16 ; 0x6c40 6c50: 11 e0 ldi r17, 0x01 ; 1 } #endif #endif /* not WITH_GRAPHICS */ #ifdef WITH_GRAPHICS options = 0; if (_trans->c != diodes.Anode[0]) 6c52: e0 91 48 01 lds r30, 0x0148 6c56: f0 91 49 01 lds r31, 0x0149 6c5a: 95 85 ldd r25, Z+13 ; 0x0d 6c5c: 80 91 95 01 lds r24, 0x0195 6c60: 98 13 cpse r25, r24 6c62: 02 c0 rjmp .+4 ; 0x6c68 lcd_data(LCD_CHAR_DIODE2); //show Diode symbol |< } #endif #endif /* not WITH_GRAPHICS */ #ifdef WITH_GRAPHICS options = 0; 6c64: 60 e0 ldi r22, 0x00 ; 0 6c66: 01 c0 rjmp .+2 ; 0x6c6a if (_trans->c != diodes.Anode[0]) options |= OPT_VREVERSE; 6c68: 62 e0 ldi r22, 0x02 ; 2 lcd_update_icon_opt(bmp_vakdiode,options); // update Icon with protection diode 6c6a: 80 e9 ldi r24, 0x90 ; 144 6c6c: 90 e0 ldi r25, 0x00 ; 0 6c6e: 0e 94 22 0a call 0x1444 ; 0x1444 6c72: 01 c0 rjmp .+2 ; 0x6c76 } else { PinLayout('S','G','D'); // SGD= or 123=... } #endif /* WITH_GRAPHICS */ an_cat = 0; 6c74: 10 e0 ldi r17, 0x00 ; 0 #endif } /* end if NumOfDiodes == 1 */ #ifdef WITH_GRAPHICS lcd_draw_trans_pins(-7, 16); // update of pin numbers must be done after diode update 6c76: 60 e1 ldi r22, 0x10 ; 16 6c78: 89 ef ldi r24, 0xF9 ; 249 6c7a: 0e 94 8a 0c call 0x1914 ; 0x1914 lcd_next_line(TEXT_RIGHT_TO_ICON); // position text behind the icon, Line 2 6c7e: 86 e0 ldi r24, 0x06 ; 6 6c80: 0e 94 b0 08 call 0x1160 ; 0x1160 #if LCD_LINES > 6 lcd_next_line(TEXT_RIGHT_TO_ICON); // double line #endif if((PartMode&D_MODE) != D_MODE) { //enhancement-MOSFET 6c84: 80 91 1f 01 lds r24, 0x011F 6c88: 85 fd sbrc r24, 5 6c8a: 2f c0 rjmp .+94 ; 0x6cea lcd_MEM_string(vt_str+1); // "Vt=" 6c8c: 80 e9 ldi r24, 0x90 ; 144 6c8e: 93 e0 ldi r25, 0x03 ; 3 6c90: 0e 94 bf 0a call 0x157e ; 0x157e Display_mV(_trans->gthvoltage,2); //Gate-threshold voltage 6c94: e0 91 48 01 lds r30, 0x0148 6c98: f0 91 49 01 lds r31, 0x0149 6c9c: 62 e0 ldi r22, 0x02 ; 2 6c9e: 82 85 ldd r24, Z+10 ; 0x0a 6ca0: 93 85 ldd r25, Z+11 ; 0x0b 6ca2: 0e 94 6d 0c call 0x18da ; 0x18da //Gate capacity ReadCapacity(_trans->b,_trans->e); //measure capacity 6ca6: e0 91 48 01 lds r30, 0x0148 6caa: f0 91 49 01 lds r31, 0x0149 6cae: 66 85 ldd r22, Z+14 ; 0x0e 6cb0: 84 85 ldd r24, Z+12 ; 0x0c 6cb2: 0e 94 ed 1d call 0x3bda ; 0x3bda lcd_next_line(TEXT_RIGHT_TO_ICON); // position text behind the icon, Line 3 6cb6: 86 e0 ldi r24, 0x06 ; 6 6cb8: 0e 94 b0 08 call 0x1160 ; 0x1160 lcd_show_Cg(); // show Cg=xxxpF 6cbc: 0e 94 da 0a call 0x15b4 ; 0x15b4 #if FLASHEND > 0x3fff lcd_next_line(TEXT_RIGHT_TO_ICON-1); // position text behind the icon, Line 4 6cc0: 85 e0 ldi r24, 0x05 ; 5 6cc2: 0e 94 b0 08 call 0x1160 ; 0x1160 lcd_MEM_string(RDS_str); // "RDS= 6cc6: 82 ea ldi r24, 0xA2 ; 162 6cc8: 91 e0 ldi r25, 0x01 ; 1 6cca: 0e 94 bf 0a call 0x157e ; 0x157e DisplayValue(_trans->uBE,-1,LCD_CHAR_OMEGA,2); // Drain-Source resistance 6cce: e0 91 48 01 lds r30, 0x0148 6cd2: f0 91 49 01 lds r31, 0x0149 6cd6: 64 81 ldd r22, Z+4 ; 0x04 6cd8: 75 81 ldd r23, Z+5 ; 0x05 6cda: 80 e0 ldi r24, 0x00 ; 0 6cdc: 90 e0 ldi r25, 0x00 ; 0 6cde: 02 e0 ldi r16, 0x02 ; 2 6ce0: 24 e0 ldi r18, 0x04 ; 4 6ce2: 4f ef ldi r20, 0xFF ; 255 6ce4: 0e 94 a8 0b call 0x1750 ; 0x1750 6ce8: 30 c0 rjmp .+96 ; 0x6d4a #endif } else { if ((PartMode&0x0f) != PART_MODE_JFET) { /* kein JFET */ 6cea: 8f 70 andi r24, 0x0F ; 15 6cec: 84 30 cpi r24, 0x04 ; 4 6cee: 51 f0 breq .+20 ; 0x6d04 ReadCapacity(_trans->b,_trans->e); //measure capacity 6cf0: e0 91 48 01 lds r30, 0x0148 6cf4: f0 91 49 01 lds r31, 0x0149 6cf8: 66 85 ldd r22, Z+14 ; 0x0e 6cfa: 84 85 ldd r24, Z+12 ; 0x0c 6cfc: 0e 94 ed 1d call 0x3bda ; 0x3bda lcd_show_Cg(); // show Cg=xxxpF 6d00: 0e 94 da 0a call 0x15b4 ; 0x15b4 } lcd_next_line(0); // double line 6d04: 80 e0 ldi r24, 0x00 ; 0 6d06: 0e 94 b0 08 call 0x1160 ; 0x1160 #if LCD_LINES > 6 lcd_next_line(0); // double line #endif lcd_data('I'); 6d0a: 89 e4 ldi r24, 0x49 ; 73 6d0c: 0e 94 3f 0a call 0x147e ; 0x147e #if (LCD_LINE_LENGTH > 17) lcd_data('d'); #endif lcd_data('='); 6d10: 8d e3 ldi r24, 0x3D ; 61 6d12: 0e 94 3f 0a call 0x147e ; 0x147e DisplayValue(_trans->current,-6,'A',2); 6d16: e0 91 48 01 lds r30, 0x0148 6d1a: f0 91 49 01 lds r31, 0x0149 6d1e: 66 81 ldd r22, Z+6 ; 0x06 6d20: 77 81 ldd r23, Z+7 ; 0x07 6d22: 80 e0 ldi r24, 0x00 ; 0 6d24: 90 e0 ldi r25, 0x00 ; 0 6d26: 02 e0 ldi r16, 0x02 ; 2 6d28: 21 e4 ldi r18, 0x41 ; 65 6d2a: 4a ef ldi r20, 0xFA ; 250 6d2c: 0e 94 a8 0b call 0x1750 ; 0x1750 lcd_MEM_string(Vgs_str); // "@Vg=" 6d30: 8a e8 ldi r24, 0x8A ; 138 6d32: 93 e0 ldi r25, 0x03 ; 3 6d34: 0e 94 bf 0a call 0x157e ; 0x157e Display_mV(_trans->gthvoltage,2); //Gate-threshold voltage 6d38: e0 91 48 01 lds r30, 0x0148 6d3c: f0 91 49 01 lds r31, 0x0149 6d40: 62 e0 ldi r22, 0x02 ; 2 6d42: 82 85 ldd r24, Z+10 ; 0x0a 6d44: 93 85 ldd r25, Z+11 ; 0x0b 6d46: 0e 94 6d 0c call 0x18da ; 0x18da Display_mV(_trans->gthvoltage,2); //Gate-threshold voltage } #endif /* WITH_GRAPHICS or without */ #if FLASHEND > 0x1fff if(NumOfDiodes == 1) { 6d4a: 80 91 1e 01 lds r24, 0x011E 6d4e: 81 30 cpi r24, 0x01 ; 1 6d50: 09 f0 breq .+2 ; 0x6d54 6d52: 08 c1 rjmp .+528 ; 0x6f64 // there is enough space for long form of presenting protection diode #if LCD_LINES > 6 lcd_next_line(0); // line 5 , if possible #endif lcd_next_line_wait(0); // line 4, if possible & wait 5s and clear last line 6d54: 80 e0 ldi r24, 0x00 ; 0 6d56: 0e 94 c8 08 call 0x1190 ; 0x1190 if (an_cat) { 6d5a: 11 23 and r17, r17 6d5c: 59 f0 breq .+22 ; 0x6d74 lcd_testpin(diodes.Anode[0]); 6d5e: 80 91 95 01 lds r24, 0x0195 6d62: 0e 94 87 0a call 0x150e ; 0x150e lcd_MEM_string(AnKat); //"->|-" 6d66: 81 e5 ldi r24, 0x51 ; 81 6d68: 92 e0 ldi r25, 0x02 ; 2 6d6a: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(diodes.Cathode[0]); 6d6e: 80 91 9b 01 lds r24, 0x019B 6d72: 0a c0 rjmp .+20 ; 0x6d88 } else { lcd_testpin(diodes.Cathode[0]); 6d74: 80 91 9b 01 lds r24, 0x019B 6d78: 0e 94 87 0a call 0x150e ; 0x150e lcd_MEM_string(KatAn); //"-|<-" 6d7c: 8d e4 ldi r24, 0x4D ; 77 6d7e: 92 e0 ldi r25, 0x02 ; 2 6d80: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(diodes.Anode[0]); 6d84: 80 91 95 01 lds r24, 0x0195 6d88: 0e 94 87 0a call 0x150e ; 0x150e } lcd_space(); 6d8c: 0e 94 8b 0a call 0x1516 ; 0x1516 lcd_MEM_string(Uf_str); //"Uf=" 6d90: 84 e9 ldi r24, 0x94 ; 148 6d92: 93 e0 ldi r25, 0x03 ; 3 6d94: 0e 94 bf 0a call 0x157e ; 0x157e mVAusgabe(0); 6d98: 80 e0 ldi r24, 0x00 ; 0 6d9a: 0e 94 61 0b call 0x16c2 ; 0x16c2 6d9e: e2 c0 rjmp .+452 ; 0x6f64 goto start; // POWER_OFF not selected, repeat measurement // return 0; end3: // the diode is already shown on the LCD if (ResistorsFound == 0) goto tt_end; 6da0: 80 91 7b 01 lds r24, 0x017B 6da4: 88 23 and r24, r24 6da6: 09 f4 brne .+2 ; 0x6daa 6da8: dd c0 rjmp .+442 ; 0x6f64 ADC_DDR = (1< 3) ADC_DDR = TXD_MSK; // switch pin with reference to input, activate relay 6dae: 88 e0 ldi r24, 0x08 ; 8 6db0: 87 b9 out 0x07, r24 ; 7 lcd_line3(); 6db2: 0e 94 90 08 call 0x1120 ; 0x1120 goto tt_end; } /* end (PartFound == PART_FET) */ // if(PartFound == PART_RESISTOR) resistor_out: if(ResistorsFound != 0) { 6db6: 00 91 7b 01 lds r16, 0x017B 6dba: 00 23 and r16, r16 6dbc: 09 f4 brne .+2 ; 0x6dc0 6dbe: be c0 rjmp .+380 ; 0x6f3c if (ResistorsFound == 1) { // single resistor 6dc0: 01 30 cpi r16, 0x01 ; 1 6dc2: 39 f4 brne .+14 ; 0x6dd2 rpins.pw = Rnum2pins(ResistorList[0]); // get pin numbers for resistor 1 6dc4: 80 91 62 01 lds r24, 0x0162 6dc8: 0e 94 2f 0b call 0x165e ; 0x165e 6dcc: 09 2f mov r16, r25 6dce: 39 2e mov r3, r25 6dd0: 59 c0 rjmp .+178 ; 0x6e84 // if (ResistorList[0] == 2) x = TP2; lcd_testpin(rpins.pb[0]); //Pin-number 1 lcd_MEM_string(Resistor_str); // -[=]- lcd_testpin(rpins.pb[1]); //Pin-number 2 } else { // R-Max suchen ii = ResistorList[0]; // first resistor in the list with number 0,1,2 6dd2: 10 91 62 01 lds r17, 0x0162 if (ResistorVal[ResistorList[1]] > ResistorVal[ii]) 6dd6: 30 91 63 01 lds r19, 0x0163 6dda: f4 e0 ldi r31, 0x04 ; 4 6ddc: 3f 9f mul r19, r31 6dde: d0 01 movw r26, r0 6de0: 11 24 eor r1, r1 6de2: a3 55 subi r26, 0x53 ; 83 6de4: be 4f sbci r27, 0xFE ; 254 6de6: 24 e0 ldi r18, 0x04 ; 4 6de8: 12 9f mul r17, r18 6dea: f0 01 movw r30, r0 6dec: 11 24 eor r1, r1 6dee: e3 55 subi r30, 0x53 ; 83 6df0: fe 4f sbci r31, 0xFE ; 254 6df2: 4d 91 ld r20, X+ 6df4: 5d 91 ld r21, X+ 6df6: 6d 91 ld r22, X+ 6df8: 7c 91 ld r23, X 6dfa: 80 81 ld r24, Z 6dfc: 91 81 ldd r25, Z+1 ; 0x01 6dfe: a2 81 ldd r26, Z+2 ; 0x02 6e00: b3 81 ldd r27, Z+3 ; 0x03 6e02: 84 17 cp r24, r20 6e04: 95 07 cpc r25, r21 6e06: a6 07 cpc r26, r22 6e08: b7 07 cpc r27, r23 6e0a: 10 f0 brcs .+4 ; 0x6e10 // if (ResistorList[0] == 2) x = TP2; lcd_testpin(rpins.pb[0]); //Pin-number 1 lcd_MEM_string(Resistor_str); // -[=]- lcd_testpin(rpins.pb[1]); //Pin-number 2 } else { // R-Max suchen ii = ResistorList[0]; // first resistor in the list with number 0,1,2 6e0c: 21 2f mov r18, r17 6e0e: 01 c0 rjmp .+2 ; 0x6e12 if (ResistorVal[ResistorList[1]] > ResistorVal[ii]) ii = ResistorList[1]; // second resistor in the list with number 0,1,2 6e10: 23 2f mov r18, r19 if (ResistorsFound == 2) { 6e12: 02 30 cpi r16, 0x02 ; 2 6e14: 21 f4 brne .+8 ; 0x6e1e 6e16: 31 0f add r19, r17 ii = (3 - ResistorList[0] - ResistorList[1]); 6e18: 13 e0 ldi r17, 0x03 ; 3 6e1a: 13 1b sub r17, r19 6e1c: 1c c0 rjmp .+56 ; 0x6e56 } else { if (ResistorVal[ResistorList[2]] > ResistorVal[ii]) { 6e1e: 10 91 64 01 lds r17, 0x0164 6e22: 34 e0 ldi r19, 0x04 ; 4 6e24: 13 9f mul r17, r19 6e26: d0 01 movw r26, r0 6e28: 11 24 eor r1, r1 6e2a: a3 55 subi r26, 0x53 ; 83 6e2c: be 4f sbci r27, 0xFE ; 254 6e2e: 84 e0 ldi r24, 0x04 ; 4 6e30: 28 9f mul r18, r24 6e32: f0 01 movw r30, r0 6e34: 11 24 eor r1, r1 6e36: e3 55 subi r30, 0x53 ; 83 6e38: fe 4f sbci r31, 0xFE ; 254 6e3a: 4d 91 ld r20, X+ 6e3c: 5d 91 ld r21, X+ 6e3e: 6d 91 ld r22, X+ 6e40: 7c 91 ld r23, X 6e42: 80 81 ld r24, Z 6e44: 91 81 ldd r25, Z+1 ; 0x01 6e46: a2 81 ldd r26, Z+2 ; 0x02 6e48: b3 81 ldd r27, Z+3 ; 0x03 6e4a: 84 17 cp r24, r20 6e4c: 95 07 cpc r25, r21 6e4e: a6 07 cpc r26, r22 6e50: b7 07 cpc r27, r23 6e52: 08 f0 brcs .+2 ; 0x6e56 6e54: 12 2f mov r17, r18 // ResistorVal[0] TP1:TP2, [1] TP1:TP3, [2] TP2:TP3 x = TP1; y = TP3; z = TP2; if (ii == 1) { /* TP1:TP3 is maximum */ 6e56: 11 30 cpi r17, 0x01 ; 1 6e58: 29 f0 breq .+10 ; 0x6e64 x = TP1; y = TP2; z = TP3; } if (ii == 2) { /* TP2:TP3 is maximum */ 6e5a: 12 30 cpi r17, 0x02 ; 2 6e5c: 39 f0 breq .+14 ; 0x6e6c } } // ResistorVal[0] TP1:TP2, [1] TP1:TP3, [2] TP2:TP3 x = TP1; y = TP3; z = TP2; 6e5e: 01 e0 ldi r16, 0x01 ; 1 ii = ResistorList[2]; } } // ResistorVal[0] TP1:TP2, [1] TP1:TP3, [2] TP2:TP3 x = TP1; y = TP3; 6e60: 22 e0 ldi r18, 0x02 ; 2 6e62: 02 c0 rjmp .+4 ; 0x6e68 z = TP2; if (ii == 1) { /* TP1:TP3 is maximum */ x = TP1; y = TP2; z = TP3; 6e64: 02 e0 ldi r16, 0x02 ; 2 y = TP3; z = TP2; if (ii == 1) { /* TP1:TP3 is maximum */ x = TP1; y = TP2; 6e66: 21 e0 ldi r18, 0x01 ; 1 6e68: 80 e0 ldi r24, 0x00 ; 0 6e6a: 03 c0 rjmp .+6 ; 0x6e72 z = TP3; } if (ii == 2) { /* TP2:TP3 is maximum */ x = TP2; y = TP1; z = TP3; 6e6c: 02 e0 ldi r16, 0x02 ; 2 y = TP2; z = TP3; } if (ii == 2) { /* TP2:TP3 is maximum */ x = TP2; y = TP1; 6e6e: 20 e0 ldi r18, 0x00 ; 0 x = TP1; y = TP2; z = TP3; } if (ii == 2) { /* TP2:TP3 is maximum */ x = TP2; 6e70: 81 e0 ldi r24, 0x01 ; 1 y = TP1; z = TP3; } lcd_testpin(x); //Pin-number 1 6e72: 2c 83 std Y+4, r18 ; 0x04 6e74: 0e 94 87 0a call 0x150e ; 0x150e lcd_MEM_string(Resistor_str); // -[=]- 6e78: 83 e4 ldi r24, 0x43 ; 67 6e7a: 92 e0 ldi r25, 0x02 ; 2 6e7c: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(y); //Pin-number 2 6e80: 2c 81 ldd r18, Y+4 ; 0x04 6e82: 82 2f mov r24, r18 6e84: 0e 94 87 0a call 0x150e ; 0x150e lcd_MEM_string(Resistor_str); // -[=]- 6e88: 83 e4 ldi r24, 0x43 ; 67 6e8a: 92 e0 ldi r25, 0x02 ; 2 6e8c: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(z); //Pin-number 3 6e90: 80 2f mov r24, r16 6e92: 0e 94 87 0a call 0x150e ; 0x150e } /* end RegistersFound == 1 */ #if (LCD_LINES > 3) if(PartFound == PART_DIODE) { 6e96: 80 91 20 01 lds r24, 0x0120 6e9a: 82 30 cpi r24, 0x02 ; 2 6e9c: 19 f4 brne .+6 ; 0x6ea4 lcd_line4(); //4. row 6e9e: 0e 94 9b 08 call 0x1136 ; 0x1136 6ea2: 02 c0 rjmp .+4 ; 0x6ea8 } else { lcd_line2(); //2. row 6ea4: 0e 94 85 08 call 0x110a ; 0x110a } #else lcd_line2(); //2. row #endif if (ResistorsFound == 1) { 6ea8: 80 91 7b 01 lds r24, 0x017B 6eac: 81 30 cpi r24, 0x01 ; 1 6eae: 91 f5 brne .+100 ; 0x6f14 #if FLASHEND > 0x1fff ReadInductance(); // measure inductance, possible only with single R<2.1k 6eb0: 0e 94 e8 21 call 0x43d0 ; 0x43d0 RvalOut(ResistorList[0]); // RvalOut starts GetESR, if resistance is low and no Inductance 6eb4: 80 91 62 01 lds r24, 0x0162 6eb8: 0e 94 39 0b call 0x1672 ; 0x1672 if (inductor_lpre != 0) { 6ebc: 80 91 02 01 lds r24, 0x0102 6ec0: 88 23 and r24, r24 6ec2: e9 f0 breq .+58 ; 0x6efe // resistor have also Inductance lcd_MEM_string(Lis_str); // "L=" 6ec4: 8a e6 ldi r24, 0x6A ; 106 6ec6: 93 e0 ldi r25, 0x03 ; 3 6ec8: 0e 94 bf 0a call 0x157e ; 0x157e DisplayValue(inductor_lx,inductor_lpre,'H',3); // output inductance 6ecc: 60 91 0c 01 lds r22, 0x010C 6ed0: 70 91 0d 01 lds r23, 0x010D 6ed4: 80 91 0e 01 lds r24, 0x010E 6ed8: 90 91 0f 01 lds r25, 0x010F 6edc: 03 e0 ldi r16, 0x03 ; 3 6ede: 28 e4 ldi r18, 0x48 ; 72 6ee0: 40 91 02 01 lds r20, 0x0102 6ee4: 0e 94 a8 0b call 0x1750 ; 0x1750 lcd_set_cursor(0,5); 6ee8: 65 e0 ldi r22, 0x05 ; 5 6eea: 80 e0 ldi r24, 0x00 ; 0 6eec: 0e 94 a6 08 call 0x114c ; 0x114c lcd_MEM_string(Inductor_str); // -ww- 6ef0: 8e e3 ldi r24, 0x3E ; 62 6ef2: 92 e0 ldi r25, 0x02 ; 2 6ef4: 0e 94 bf 0a call 0x157e ; 0x157e lcd_testpin(rpins.pb[1]); //Pin-number 2 6ef8: 83 2d mov r24, r3 6efa: 0e 94 87 0a call 0x150e ; 0x150e } /* end if inductor_lpre != 0 */ { /* start special R-meter function with R or L */ #else } else { /* only resistor starts special R-meter function */ #endif if ((ResistorList[0] == 1) && (NumOfDiodes == 0)) { 6efe: 80 91 62 01 lds r24, 0x0162 6f02: 81 30 cpi r24, 0x01 ; 1 6f04: 79 f5 brne .+94 ; 0x6f64 6f06: 80 91 1e 01 lds r24, 0x011E 6f0a: 81 11 cpse r24, r1 6f0c: 2b c0 rjmp .+86 ; 0x6f64 // is the TP1:TP3 resistor and no additional diode show_Resis13(); // call of the special resistor measurement 6f0e: 0e 94 40 30 call 0x6080 ; 0x6080 goto start; 6f12: 9b ca rjmp .-2762 ; 0x644a } /* end if inductor_lpre != 0 */ #else /* FLASHEND <= 0x1fff */ RvalOut(ResistorList[0]); // RvalOut starts GetESR, if resistance < 10 Ohm #endif } else { // output resistor values in right order if (ii == 0) { /* resistor 0 has maximum */ 6f14: 11 11 cpse r17, r1 6f16: 02 c0 rjmp .+4 ; 0x6f1c RvalOut(1); 6f18: 81 e0 ldi r24, 0x01 ; 1 6f1a: 03 c0 rjmp .+6 ; 0x6f22 RvalOut(2); } if (ii == 1) { /* resistor 1 has maximum */ 6f1c: 11 30 cpi r17, 0x01 ; 1 6f1e: 29 f4 brne .+10 ; 0x6f2a RvalOut(0); 6f20: 80 e0 ldi r24, 0x00 ; 0 6f22: 0e 94 39 0b call 0x1672 ; 0x1672 RvalOut(2); 6f26: 82 e0 ldi r24, 0x02 ; 2 6f28: 06 c0 rjmp .+12 ; 0x6f36 } if (ii == 2) { /* resistor 2 has maximum */ 6f2a: 12 30 cpi r17, 0x02 ; 2 6f2c: d9 f4 brne .+54 ; 0x6f64 RvalOut(0); 6f2e: 80 e0 ldi r24, 0x00 ; 0 6f30: 0e 94 39 0b call 0x1672 ; 0x1672 RvalOut(1); 6f34: 81 e0 ldi r24, 0x01 ; 1 6f36: 0e 94 39 0b call 0x1672 ; 0x1672 6f3a: 14 c0 rjmp .+40 ; 0x6f64 } goto tt_end; } // end (PartFound == PART_RESISTOR) lcd_MEM_string(TestFailed1); //"Kein,unbek. oder" 6f3c: 8b ea ldi r24, 0xAB ; 171 6f3e: 94 e0 ldi r25, 0x04 ; 4 6f40: 0e 94 bf 0a call 0x157e ; 0x157e lcd_line2(); //2. row 6f44: 0e 94 85 08 call 0x110a ; 0x110a #if defined(LANG_ITALIAN) //italiano lcd_MEM_string(Bauteil); //"campione" lcd_space(); lcd_MEM_string(TestFailed2); //"guasto " #else lcd_MEM_string(TestFailed2); //"defektes " 6f48: 88 ed ldi r24, 0xD8 ; 216 6f4a: 94 e0 ldi r25, 0x04 ; 4 6f4c: 0e 94 bf 0a call 0x157e ; 0x157e lcd_MEM_string(Bauteil); //"Bauteil" 6f50: 83 ed ldi r24, 0xD3 ; 211 6f52: 94 e0 ldi r25, 0x04 ; 4 6f54: 0e 94 bf 0a call 0x157e ; 0x157e #endif not_known: #ifdef WITH_GRAPHICS lcd_big_icon(QUESTION); // show big question mark 6f58: 86 e0 ldi r24, 0x06 ; 6 6f5a: 0e 94 f5 09 call 0x13ea ; 0x13ea #endif #if POWER_OFF+0 > 1 empty_count++; mess_count = 0; #endif max_time = SHORT_WAIT_TIME; // use allways the short wait time 6f5e: 80 e4 ldi r24, 0x40 ; 64 6f60: 9f e1 ldi r25, 0x1F ; 31 goto end2; 6f62: 04 c0 rjmp .+8 ; 0x6f6c tt_end: #if POWER_OFF+0 > 1 empty_count = 0; // reset counter, if part is found mess_count++; // count measurements #endif max_time = display_time; // full specified wait time 6f64: 80 91 18 01 lds r24, 0x0118 6f68: 90 91 19 01 lds r25, 0x0119 end2: ADC_DDR = (1< #ifdef WITH_ROTARY_SWITCH wait_again: #endif ii = wait_for_key_ms(max_time); 6f74: 0e 94 de 0e call 0x1dbc ; 0x1dbc 6f78: 18 2f mov r17, r24 #endif #ifdef WITH_MENU #ifdef WITH_ROTARY_SWITCH if ((ii >=50) || (rotary.incre > 2)) #else if (ii >= 50) 6f7a: 82 33 cpi r24, 0x32 ; 50 6f7c: 18 f0 brcs .+6 ; 0x6f84 #endif { // menu selected by long key press or rotary switch function_menu(); // start the function menu 6f7e: 0e 94 50 2c call 0x58a0 ; 0x58a0 goto start; 6f82: 63 ca rjmp .-2874 ; 0x644a } #endif if (ii != 0 ) goto start; // key is pressed again, repeat measurement 6f84: 81 11 cpse r24, r1 6f86: 61 ca rjmp .-2878 ; 0x644a uint8_t space_pos; uint8_t line_nr; uint8_t sub_line; #define TIME_TO_READ 10000 jj = 0; if (UnCalibrated) { 6f88: 80 91 44 01 lds r24, 0x0144 6f8c: 88 23 and r24, r24 6f8e: 09 f4 brne .+2 ; 0x6f92 6f90: 61 c0 rjmp .+194 ; 0x7054 6f92: b4 e0 ldi r27, 0x04 ; 4 6f94: 4b 2e mov r4, r27 6f96: 1b 82 std Y+3, r1 ; 0x03 6f98: 1a 82 std Y+2, r1 ; 0x02 #endif #if POWER_OFF+0 > 1 empty_count++; mess_count = 0; #endif max_time = SHORT_WAIT_TIME; // use allways the short wait time 6f9a: 80 e0 ldi r24, 0x00 ; 0 6f9c: 90 e0 ldi r25, 0x00 ; 0 6f9e: 00 e1 ldi r16, 0x10 ; 16 6fa0: 2a 81 ldd r18, Y+2 ; 0x02 6fa2: 3b 81 ldd r19, Y+3 ; 0x03 6fa4: 2b 5a subi r18, 0xAB ; 171 6fa6: 3d 4f sbci r19, 0xFD ; 253 6fa8: 49 01 movw r8, r18 6faa: f4 01 movw r30, r8 6fac: e8 0f add r30, r24 6fae: f9 1f adc r31, r25 zeich = ' '; // initial value for while loop line_nr = LCD_LINES; // begin with the first LCD line, but don't wait while (zeich != (char)0) { // zero is end of text space_pos = 16; // if no space is found for (ii=0;ii<17;ii++) { // look for the last space character zeich = pgm_read_byte(&HelpCalibration_str[ii+jj]); 6fb0: 24 90 lpm r2, Z if (zeich == ' ') space_pos = ii; // save the position 6fb2: f0 e2 ldi r31, 0x20 ; 32 6fb4: 2f 12 cpse r2, r31 6fb6: 01 c0 rjmp .+2 ; 0x6fba 6fb8: 08 2f mov r16, r24 6fba: 01 96 adiw r24, 0x01 ; 1 // The text is formatted for two 16 character display lines. zeich = ' '; // initial value for while loop line_nr = LCD_LINES; // begin with the first LCD line, but don't wait while (zeich != (char)0) { // zero is end of text space_pos = 16; // if no space is found for (ii=0;ii<17;ii++) { // look for the last space character 6fbc: 81 31 cpi r24, 0x11 ; 17 6fbe: 91 05 cpc r25, r1 6fc0: a1 f7 brne .-24 ; 0x6faa zeich = pgm_read_byte(&HelpCalibration_str[ii+jj]); if (zeich == ' ') space_pos = ii; // save the position } if (line_nr == 0) { 6fc2: 44 20 and r4, r4 6fc4: 31 f0 breq .+12 ; 0x6fd2 // it is the first LCD line, wait for showing the last message if ((wait_for_key_ms(TIME_TO_READ)) != 0) break; // key pressed } sub_line = line_nr % LCD_LINES; 6fc6: 14 2d mov r17, r4 6fc8: 13 70 andi r17, 0x03 ; 3 if (sub_line == 0) lcd_clear(); // clear display, line_nr is 0 or 4 6fca: 59 f4 brne .+22 ; 0x6fe2 6fcc: 0e 94 f9 08 call 0x11f2 ; 0x11f2 6fd0: 08 c0 rjmp .+16 ; 0x6fe2 zeich = pgm_read_byte(&HelpCalibration_str[ii+jj]); if (zeich == ' ') space_pos = ii; // save the position } if (line_nr == 0) { // it is the first LCD line, wait for showing the last message if ((wait_for_key_ms(TIME_TO_READ)) != 0) break; // key pressed 6fd2: 80 e1 ldi r24, 0x10 ; 16 6fd4: 97 e2 ldi r25, 0x27 ; 39 6fd6: 0e 94 de 0e call 0x1dbc ; 0x1dbc 6fda: 88 23 and r24, r24 6fdc: a1 f3 breq .-24 ; 0x6fc6 6fde: 11 e1 ldi r17, 0x11 ; 17 6fe0: 35 c0 rjmp .+106 ; 0x704c } sub_line = line_nr % LCD_LINES; if (sub_line == 0) lcd_clear(); // clear display, line_nr is 0 or 4 lcd_set_cursor(sub_line*PAGES_PER_LINE ,0); 6fe2: 60 e0 ldi r22, 0x00 ; 0 6fe4: 81 2f mov r24, r17 6fe6: 88 0f add r24, r24 6fe8: 0e 94 a6 08 call 0x114c ; 0x114c line_nr = (line_nr + 1) % LCD_LINES; 6fec: 43 94 inc r4 6fee: 24 2d mov r18, r4 6ff0: 23 70 andi r18, 0x03 ; 3 6ff2: 42 2e mov r4, r18 for (ii=0;ii 6ffe: f4 01 movw r30, r8 7000: e6 0d add r30, r6 7002: f7 1d adc r31, r7 zeich = pgm_read_byte(&HelpCalibration_str[ii+jj]); 7004: 24 90 lpm r2, Z if (zeich == (char)0) break; // end of text found 7006: 22 20 and r2, r2 7008: 09 f1 breq .+66 ; 0x704c if (zeich == LCD_CHAR_INSEP) { 700a: 3f ef ldi r19, 0xFF ; 255 700c: 23 12 cpse r2, r19 700e: 03 c0 rjmp .+6 ; 0x7016 lcd_space(); // replace with space 7010: 0e 94 8b 0a call 0x1516 ; 0x1516 7014: 03 c0 rjmp .+6 ; 0x701c } else { lcd_data(zeich); // display the character without offset 7016: 82 2d mov r24, r2 7018: 0e 94 3f 0a call 0x147e ; 0x147e 701c: 8f ef ldi r24, 0xFF ; 255 701e: 68 1a sub r6, r24 7020: 78 0a sbc r7, r24 7022: ea cf rjmp .-44 ; 0x6ff8 } } if (zeich == (char)0) break; // end of text found 7024: 22 20 and r2, r2 7026: 91 f0 breq .+36 ; 0x704c jj += space_pos; // start position of line 2 7028: 2a 81 ldd r18, Y+2 ; 0x02 702a: 3b 81 ldd r19, Y+3 ; 0x03 702c: 20 0f add r18, r16 702e: 31 1d adc r19, r1 7030: 3b 83 std Y+3, r19 ; 0x03 7032: 2a 83 std Y+2, r18 ; 0x02 if((pgm_read_byte(&HelpCalibration_str[jj])) == ' ') jj++; // no space at begin of line 7034: f9 01 movw r30, r18 7036: eb 5a subi r30, 0xAB ; 171 7038: fd 4f sbci r31, 0xFD ; 253 703a: e4 91 lpm r30, Z 703c: e0 32 cpi r30, 0x20 ; 32 703e: 09 f0 breq .+2 ; 0x7042 7040: ac cf rjmp .-168 ; 0x6f9a 7042: 2f 5f subi r18, 0xFF ; 255 7044: 3f 4f sbci r19, 0xFF ; 255 7046: 3b 83 std Y+3, r19 ; 0x03 7048: 2a 83 std Y+2, r18 ; 0x02 704a: a7 cf rjmp .-178 ; 0x6f9a } /* end while */ wait_for_key_ms(TIME_TO_READ); // key pressed 704c: 80 e1 ldi r24, 0x10 ; 16 704e: 97 e2 ldi r25, 0x27 ; 39 7050: 0e 94 de 0e call 0x1dbc ; 0x1dbc lcd_cursor_off(); #include "HelpCalibration.c" #endif // MCUSR = 0; #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306)) lcd_powersave(); // set graphical display to power save mode 7054: 0e 94 f2 08 call 0x11e4 ; 0x11e4 #endif ON_PORT &= ~(1< #else // look, if the tester is uncalibrated (C-source will be included directly) lcd_cursor_off(); #include "HelpCalibration.c" #endif goto start; // POWER_OFF not selected, repeat measurement 7062: f3 c9 rjmp .-3098 ; 0x644a // ADC_DDR = TXD_MSK; if(tmp) { // check if Watchdog-Event // this happens, if the Watchdog is not reset for 2s // can happen, if any loop in the Program doen't finish. lcd_line1(); 7064: 0e 94 7c 08 call 0x10f8 ; 0x10f8 lcd_MEM_string(TestTimedOut); //Output Timeout 7068: 86 e9 ldi r24, 0x96 ; 150 706a: 94 e0 ldi r25, 0x04 ; 4 706c: 0e 94 bf 0a call 0x157e ; 0x157e wait_about3s(); //wait for 3 s 7070: 8b ec ldi r24, 0xCB ; 203 7072: 0e 94 4a 0e call 0x1c94 ; 0x1c94 #if ((LCD_ST_TYPE == 7565) || (LCD_ST_TYPE == 1306)) lcd_powersave(); // set graphical display to power save mode 7076: 0e 94 f2 08 call 0x11e4 ; 0x11e4 #endif ON_PORT &= ~(1< 00007088 <__umulhisi3>: 7088: a2 9f mul r26, r18 708a: b0 01 movw r22, r0 708c: b3 9f mul r27, r19 708e: c0 01 movw r24, r0 7090: a3 9f mul r26, r19 7092: 70 0d add r23, r0 7094: 81 1d adc r24, r1 7096: 11 24 eor r1, r1 7098: 91 1d adc r25, r1 709a: b2 9f mul r27, r18 709c: 70 0d add r23, r0 709e: 81 1d adc r24, r1 70a0: 11 24 eor r1, r1 70a2: 91 1d adc r25, r1 70a4: 08 95 ret 000070a6 <__usmulhisi3>: 70a6: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 000070aa <__usmulhisi3_tail>: 70aa: b7 ff sbrs r27, 7 70ac: 08 95 ret 70ae: 82 1b sub r24, r18 70b0: 93 0b sbc r25, r19 70b2: 08 95 ret 000070b4 <__muluhisi3>: 70b4: 0e 94 44 38 call 0x7088 ; 0x7088 <__umulhisi3> 70b8: a5 9f mul r26, r21 70ba: 90 0d add r25, r0 70bc: b4 9f mul r27, r20 70be: 90 0d add r25, r0 70c0: a4 9f mul r26, r20 70c2: 80 0d add r24, r0 70c4: 91 1d adc r25, r1 70c6: 11 24 eor r1, r1 70c8: 08 95 ret 000070ca <__mulsi3>: 70ca: db 01 movw r26, r22 70cc: 8f 93 push r24 70ce: 9f 93 push r25 70d0: 0e 94 5a 38 call 0x70b4 ; 0x70b4 <__muluhisi3> 70d4: bf 91 pop r27 70d6: af 91 pop r26 70d8: a2 9f mul r26, r18 70da: 80 0d add r24, r0 70dc: 91 1d adc r25, r1 70de: a3 9f mul r26, r19 70e0: 90 0d add r25, r0 70e2: b2 9f mul r27, r18 70e4: 90 0d add r25, r0 70e6: 11 24 eor r1, r1 70e8: 08 95 ret 000070ea <__udivmodhi4>: 70ea: aa 1b sub r26, r26 70ec: bb 1b sub r27, r27 70ee: 51 e1 ldi r21, 0x11 ; 17 70f0: 07 c0 rjmp .+14 ; 0x7100 <__udivmodhi4_ep> 000070f2 <__udivmodhi4_loop>: 70f2: aa 1f adc r26, r26 70f4: bb 1f adc r27, r27 70f6: a6 17 cp r26, r22 70f8: b7 07 cpc r27, r23 70fa: 10 f0 brcs .+4 ; 0x7100 <__udivmodhi4_ep> 70fc: a6 1b sub r26, r22 70fe: b7 0b sbc r27, r23 00007100 <__udivmodhi4_ep>: 7100: 88 1f adc r24, r24 7102: 99 1f adc r25, r25 7104: 5a 95 dec r21 7106: a9 f7 brne .-22 ; 0x70f2 <__udivmodhi4_loop> 7108: 80 95 com r24 710a: 90 95 com r25 710c: bc 01 movw r22, r24 710e: cd 01 movw r24, r26 7110: 08 95 ret 00007112 <__divmodhi4>: 7112: 97 fb bst r25, 7 7114: 07 2e mov r0, r23 7116: 16 f4 brtc .+4 ; 0x711c <__divmodhi4+0xa> 7118: 00 94 com r0 711a: 07 d0 rcall .+14 ; 0x712a <__divmodhi4_neg1> 711c: 77 fd sbrc r23, 7 711e: 09 d0 rcall .+18 ; 0x7132 <__divmodhi4_neg2> 7120: 0e 94 75 38 call 0x70ea ; 0x70ea <__udivmodhi4> 7124: 07 fc sbrc r0, 7 7126: 05 d0 rcall .+10 ; 0x7132 <__divmodhi4_neg2> 7128: 3e f4 brtc .+14 ; 0x7138 <__divmodhi4_exit> 0000712a <__divmodhi4_neg1>: 712a: 90 95 com r25 712c: 81 95 neg r24 712e: 9f 4f sbci r25, 0xFF ; 255 7130: 08 95 ret 00007132 <__divmodhi4_neg2>: 7132: 70 95 com r23 7134: 61 95 neg r22 7136: 7f 4f sbci r23, 0xFF ; 255 00007138 <__divmodhi4_exit>: 7138: 08 95 ret 0000713a <__udivmodsi4>: 713a: a1 e2 ldi r26, 0x21 ; 33 713c: 1a 2e mov r1, r26 713e: aa 1b sub r26, r26 7140: bb 1b sub r27, r27 7142: fd 01 movw r30, r26 7144: 0d c0 rjmp .+26 ; 0x7160 <__udivmodsi4_ep> 00007146 <__udivmodsi4_loop>: 7146: aa 1f adc r26, r26 7148: bb 1f adc r27, r27 714a: ee 1f adc r30, r30 714c: ff 1f adc r31, r31 714e: a2 17 cp r26, r18 7150: b3 07 cpc r27, r19 7152: e4 07 cpc r30, r20 7154: f5 07 cpc r31, r21 7156: 20 f0 brcs .+8 ; 0x7160 <__udivmodsi4_ep> 7158: a2 1b sub r26, r18 715a: b3 0b sbc r27, r19 715c: e4 0b sbc r30, r20 715e: f5 0b sbc r31, r21 00007160 <__udivmodsi4_ep>: 7160: 66 1f adc r22, r22 7162: 77 1f adc r23, r23 7164: 88 1f adc r24, r24 7166: 99 1f adc r25, r25 7168: 1a 94 dec r1 716a: 69 f7 brne .-38 ; 0x7146 <__udivmodsi4_loop> 716c: 60 95 com r22 716e: 70 95 com r23 7170: 80 95 com r24 7172: 90 95 com r25 7174: 9b 01 movw r18, r22 7176: ac 01 movw r20, r24 7178: bd 01 movw r22, r26 717a: cf 01 movw r24, r30 717c: 08 95 ret 0000717e <__divmodsi4>: 717e: 05 2e mov r0, r21 7180: 97 fb bst r25, 7 7182: 1e f4 brtc .+6 ; 0x718a <__divmodsi4+0xc> 7184: 00 94 com r0 7186: 0e 94 35 39 call 0x726a ; 0x726a <__negsi2> 718a: 57 fd sbrc r21, 7 718c: 07 d0 rcall .+14 ; 0x719c <__divmodsi4_neg2> 718e: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 7192: 07 fc sbrc r0, 7 7194: 03 d0 rcall .+6 ; 0x719c <__divmodsi4_neg2> 7196: 4e f4 brtc .+18 ; 0x71aa <__divmodsi4_exit> 7198: 0c 94 35 39 jmp 0x726a ; 0x726a <__negsi2> 0000719c <__divmodsi4_neg2>: 719c: 50 95 com r21 719e: 40 95 com r20 71a0: 30 95 com r19 71a2: 21 95 neg r18 71a4: 3f 4f sbci r19, 0xFF ; 255 71a6: 4f 4f sbci r20, 0xFF ; 255 71a8: 5f 4f sbci r21, 0xFF ; 255 000071aa <__divmodsi4_exit>: 71aa: 08 95 ret 000071ac <__umoddi3>: 71ac: 68 94 set 71ae: 01 c0 rjmp .+2 ; 0x71b2 <__udivdi3_umoddi3> 000071b0 <__udivdi3>: 71b0: e8 94 clt 000071b2 <__udivdi3_umoddi3>: 71b2: 8f 92 push r8 71b4: 9f 92 push r9 71b6: cf 93 push r28 71b8: df 93 push r29 71ba: 0e 94 e4 38 call 0x71c8 ; 0x71c8 <__udivmod64> 71be: df 91 pop r29 71c0: cf 91 pop r28 71c2: 9f 90 pop r9 71c4: 8f 90 pop r8 71c6: 08 95 ret 000071c8 <__udivmod64>: 71c8: 88 24 eor r8, r8 71ca: 99 24 eor r9, r9 71cc: f4 01 movw r30, r8 71ce: e4 01 movw r28, r8 71d0: b0 e4 ldi r27, 0x40 ; 64 71d2: 9f 93 push r25 71d4: aa 27 eor r26, r26 71d6: 9a 15 cp r25, r10 71d8: 8b 04 cpc r8, r11 71da: 9c 04 cpc r9, r12 71dc: ed 05 cpc r30, r13 71de: fe 05 cpc r31, r14 71e0: cf 05 cpc r28, r15 71e2: d0 07 cpc r29, r16 71e4: a1 07 cpc r26, r17 71e6: 98 f4 brcc .+38 ; 0x720e <__udivmod64+0x46> 71e8: ad 2f mov r26, r29 71ea: dc 2f mov r29, r28 71ec: cf 2f mov r28, r31 71ee: fe 2f mov r31, r30 71f0: e9 2d mov r30, r9 71f2: 98 2c mov r9, r8 71f4: 89 2e mov r8, r25 71f6: 98 2f mov r25, r24 71f8: 87 2f mov r24, r23 71fa: 76 2f mov r23, r22 71fc: 65 2f mov r22, r21 71fe: 54 2f mov r21, r20 7200: 43 2f mov r20, r19 7202: 32 2f mov r19, r18 7204: 22 27 eor r18, r18 7206: b8 50 subi r27, 0x08 ; 8 7208: 31 f7 brne .-52 ; 0x71d6 <__udivmod64+0xe> 720a: bf 91 pop r27 720c: 27 c0 rjmp .+78 ; 0x725c <__udivmod64+0x94> 720e: 1b 2e mov r1, r27 7210: bf 91 pop r27 7212: bb 27 eor r27, r27 7214: 22 0f add r18, r18 7216: 33 1f adc r19, r19 7218: 44 1f adc r20, r20 721a: 55 1f adc r21, r21 721c: 66 1f adc r22, r22 721e: 77 1f adc r23, r23 7220: 88 1f adc r24, r24 7222: 99 1f adc r25, r25 7224: 88 1c adc r8, r8 7226: 99 1c adc r9, r9 7228: ee 1f adc r30, r30 722a: ff 1f adc r31, r31 722c: cc 1f adc r28, r28 722e: dd 1f adc r29, r29 7230: aa 1f adc r26, r26 7232: bb 1f adc r27, r27 7234: 8a 14 cp r8, r10 7236: 9b 04 cpc r9, r11 7238: ec 05 cpc r30, r12 723a: fd 05 cpc r31, r13 723c: ce 05 cpc r28, r14 723e: df 05 cpc r29, r15 7240: a0 07 cpc r26, r16 7242: b1 07 cpc r27, r17 7244: 48 f0 brcs .+18 ; 0x7258 <__udivmod64+0x90> 7246: 8a 18 sub r8, r10 7248: 9b 08 sbc r9, r11 724a: ec 09 sbc r30, r12 724c: fd 09 sbc r31, r13 724e: ce 09 sbc r28, r14 7250: df 09 sbc r29, r15 7252: a0 0b sbc r26, r16 7254: b1 0b sbc r27, r17 7256: 21 60 ori r18, 0x01 ; 1 7258: 1a 94 dec r1 725a: e1 f6 brne .-72 ; 0x7214 <__udivmod64+0x4c> 725c: 2e f4 brtc .+10 ; 0x7268 <__udivmod64+0xa0> 725e: 94 01 movw r18, r8 7260: af 01 movw r20, r30 7262: be 01 movw r22, r28 7264: cd 01 movw r24, r26 7266: 00 0c add r0, r0 7268: 08 95 ret 0000726a <__negsi2>: 726a: 90 95 com r25 726c: 80 95 com r24 726e: 70 95 com r23 7270: 61 95 neg r22 7272: 7f 4f sbci r23, 0xFF ; 255 7274: 8f 4f sbci r24, 0xFF ; 255 7276: 9f 4f sbci r25, 0xFF ; 255 7278: 08 95 ret 0000727a <__prologue_saves__>: 727a: 2f 92 push r2 727c: 3f 92 push r3 727e: 4f 92 push r4 7280: 5f 92 push r5 7282: 6f 92 push r6 7284: 7f 92 push r7 7286: 8f 92 push r8 7288: 9f 92 push r9 728a: af 92 push r10 728c: bf 92 push r11 728e: cf 92 push r12 7290: df 92 push r13 7292: ef 92 push r14 7294: ff 92 push r15 7296: 0f 93 push r16 7298: 1f 93 push r17 729a: cf 93 push r28 729c: df 93 push r29 729e: cd b7 in r28, 0x3d ; 61 72a0: de b7 in r29, 0x3e ; 62 72a2: ca 1b sub r28, r26 72a4: db 0b sbc r29, r27 72a6: 0f b6 in r0, 0x3f ; 63 72a8: f8 94 cli 72aa: de bf out 0x3e, r29 ; 62 72ac: 0f be out 0x3f, r0 ; 63 72ae: cd bf out 0x3d, r28 ; 61 72b0: 09 94 ijmp 000072b2 <__epilogue_restores__>: 72b2: 2a 88 ldd r2, Y+18 ; 0x12 72b4: 39 88 ldd r3, Y+17 ; 0x11 72b6: 48 88 ldd r4, Y+16 ; 0x10 72b8: 5f 84 ldd r5, Y+15 ; 0x0f 72ba: 6e 84 ldd r6, Y+14 ; 0x0e 72bc: 7d 84 ldd r7, Y+13 ; 0x0d 72be: 8c 84 ldd r8, Y+12 ; 0x0c 72c0: 9b 84 ldd r9, Y+11 ; 0x0b 72c2: aa 84 ldd r10, Y+10 ; 0x0a 72c4: b9 84 ldd r11, Y+9 ; 0x09 72c6: c8 84 ldd r12, Y+8 ; 0x08 72c8: df 80 ldd r13, Y+7 ; 0x07 72ca: ee 80 ldd r14, Y+6 ; 0x06 72cc: fd 80 ldd r15, Y+5 ; 0x05 72ce: 0c 81 ldd r16, Y+4 ; 0x04 72d0: 1b 81 ldd r17, Y+3 ; 0x03 72d2: aa 81 ldd r26, Y+2 ; 0x02 72d4: b9 81 ldd r27, Y+1 ; 0x01 72d6: ce 0f add r28, r30 72d8: d1 1d adc r29, r1 72da: 0f b6 in r0, 0x3f ; 63 72dc: f8 94 cli 72de: de bf out 0x3e, r29 ; 62 72e0: 0f be out 0x3f, r0 ; 63 72e2: cd bf out 0x3d, r28 ; 61 72e4: ed 01 movw r28, r26 72e6: 08 95 ret 000072e8 <__tablejump2__>: 72e8: ee 0f add r30, r30 72ea: ff 1f adc r31, r31 000072ec <__tablejump__>: 72ec: 05 90 lpm r0, Z+ 72ee: f4 91 lpm r31, Z 72f0: e0 2d mov r30, r0 72f2: 09 94 ijmp 000072f4 <__ashldi3>: 72f4: 0f 93 push r16 72f6: 08 30 cpi r16, 0x08 ; 8 72f8: 90 f0 brcs .+36 ; 0x731e <__ashldi3+0x2a> 72fa: 98 2f mov r25, r24 72fc: 87 2f mov r24, r23 72fe: 76 2f mov r23, r22 7300: 65 2f mov r22, r21 7302: 54 2f mov r21, r20 7304: 43 2f mov r20, r19 7306: 32 2f mov r19, r18 7308: 22 27 eor r18, r18 730a: 08 50 subi r16, 0x08 ; 8 730c: f4 cf rjmp .-24 ; 0x72f6 <__ashldi3+0x2> 730e: 22 0f add r18, r18 7310: 33 1f adc r19, r19 7312: 44 1f adc r20, r20 7314: 55 1f adc r21, r21 7316: 66 1f adc r22, r22 7318: 77 1f adc r23, r23 731a: 88 1f adc r24, r24 731c: 99 1f adc r25, r25 731e: 0a 95 dec r16 7320: b2 f7 brpl .-20 ; 0x730e <__ashldi3+0x1a> 7322: 0f 91 pop r16 7324: 08 95 ret 00007326 <__subdi3>: 7326: 2a 19 sub r18, r10 7328: 3b 09 sbc r19, r11 732a: 4c 09 sbc r20, r12 732c: 5d 09 sbc r21, r13 732e: 6e 09 sbc r22, r14 7330: 7f 09 sbc r23, r15 7332: 80 0b sbc r24, r16 7334: 91 0b sbc r25, r17 7336: 08 95 ret 00007338 : 7338: fa 01 movw r30, r20 733a: cf 93 push r28 733c: ff 93 push r31 733e: ef 93 push r30 7340: 22 30 cpi r18, 0x02 ; 2 7342: cc f0 brlt .+50 ; 0x7376 7344: 25 32 cpi r18, 0x25 ; 37 7346: bc f4 brge .+46 ; 0x7376 7348: c2 2f mov r28, r18 734a: 2c 2f mov r18, r28 734c: 33 27 eor r19, r19 734e: 44 27 eor r20, r20 7350: 55 27 eor r21, r21 7352: ff 93 push r31 7354: ef 93 push r30 7356: 0e 94 9d 38 call 0x713a ; 0x713a <__udivmodsi4> 735a: ef 91 pop r30 735c: ff 91 pop r31 735e: 60 5d subi r22, 0xD0 ; 208 7360: 6a 33 cpi r22, 0x3A ; 58 7362: 0c f0 brlt .+2 ; 0x7366 7364: 69 5d subi r22, 0xD9 ; 217 7366: 61 93 st Z+, r22 7368: b9 01 movw r22, r18 736a: ca 01 movw r24, r20 736c: 60 50 subi r22, 0x00 ; 0 736e: 70 40 sbci r23, 0x00 ; 0 7370: 80 40 sbci r24, 0x00 ; 0 7372: 90 40 sbci r25, 0x00 ; 0 7374: 51 f7 brne .-44 ; 0x734a 7376: 10 82 st Z, r1 7378: 8f 91 pop r24 737a: 9f 91 pop r25 737c: cf 91 pop r28 737e: 0c 94 f8 39 jmp 0x73f0 ; 0x73f0 00007382 : 7382: fb 01 movw r30, r22 7384: 9f 01 movw r18, r30 7386: 42 30 cpi r20, 0x02 ; 2 7388: 74 f0 brlt .+28 ; 0x73a6 738a: 45 32 cpi r20, 0x25 ; 37 738c: 64 f4 brge .+24 ; 0x73a6 738e: 64 2f mov r22, r20 7390: 77 27 eor r23, r23 7392: 0e 94 75 38 call 0x70ea ; 0x70ea <__udivmodhi4> 7396: 80 5d subi r24, 0xD0 ; 208 7398: 8a 33 cpi r24, 0x3A ; 58 739a: 0c f0 brlt .+2 ; 0x739e 739c: 89 5d subi r24, 0xD9 ; 217 739e: 81 93 st Z+, r24 73a0: cb 01 movw r24, r22 73a2: 00 97 sbiw r24, 0x00 ; 0 73a4: a1 f7 brne .-24 ; 0x738e 73a6: 10 82 st Z, r1 73a8: c9 01 movw r24, r18 73aa: 0c 94 f8 39 jmp 0x73f0 ; 0x73f0 000073ae <__eerd_byte_m328p>: 73ae: f9 99 sbic 0x1f, 1 ; 31 73b0: fe cf rjmp .-4 ; 0x73ae <__eerd_byte_m328p> 73b2: 92 bd out 0x22, r25 ; 34 73b4: 81 bd out 0x21, r24 ; 33 73b6: f8 9a sbi 0x1f, 0 ; 31 73b8: 99 27 eor r25, r25 73ba: 80 b5 in r24, 0x20 ; 32 73bc: 08 95 ret 000073be <__eerd_word_m328p>: 73be: a8 e1 ldi r26, 0x18 ; 24 73c0: b0 e0 ldi r27, 0x00 ; 0 73c2: 42 e0 ldi r20, 0x02 ; 2 73c4: 50 e0 ldi r21, 0x00 ; 0 73c6: 0c 94 0a 3a jmp 0x7414 ; 0x7414 <__eerd_blraw_m328p> 000073ca <__eewr_byte_m328p>: 73ca: 26 2f mov r18, r22 000073cc <__eewr_r18_m328p>: 73cc: f9 99 sbic 0x1f, 1 ; 31 73ce: fe cf rjmp .-4 ; 0x73cc <__eewr_r18_m328p> 73d0: 1f ba out 0x1f, r1 ; 31 73d2: 92 bd out 0x22, r25 ; 34 73d4: 81 bd out 0x21, r24 ; 33 73d6: 20 bd out 0x20, r18 ; 32 73d8: 0f b6 in r0, 0x3f ; 63 73da: f8 94 cli 73dc: fa 9a sbi 0x1f, 2 ; 31 73de: f9 9a sbi 0x1f, 1 ; 31 73e0: 0f be out 0x3f, r0 ; 63 73e2: 01 96 adiw r24, 0x01 ; 1 73e4: 08 95 ret 000073e6 <__eewr_word_m328p>: 73e6: 0e 94 e5 39 call 0x73ca ; 0x73ca <__eewr_byte_m328p> 73ea: 27 2f mov r18, r23 73ec: 0c 94 e6 39 jmp 0x73cc ; 0x73cc <__eewr_r18_m328p> 000073f0 : 73f0: dc 01 movw r26, r24 73f2: fc 01 movw r30, r24 73f4: 67 2f mov r22, r23 73f6: 71 91 ld r23, Z+ 73f8: 77 23 and r23, r23 73fa: e1 f7 brne .-8 ; 0x73f4 73fc: 32 97 sbiw r30, 0x02 ; 2 73fe: 04 c0 rjmp .+8 ; 0x7408 7400: 7c 91 ld r23, X 7402: 6d 93 st X+, r22 7404: 70 83 st Z, r23 7406: 62 91 ld r22, -Z 7408: ae 17 cp r26, r30 740a: bf 07 cpc r27, r31 740c: c8 f3 brcs .-14 ; 0x7400 740e: 08 95 ret 00007410 <__eerd_block_m328p>: 7410: dc 01 movw r26, r24 7412: cb 01 movw r24, r22 00007414 <__eerd_blraw_m328p>: 7414: fc 01 movw r30, r24 7416: f9 99 sbic 0x1f, 1 ; 31 7418: fe cf rjmp .-4 ; 0x7416 <__eerd_blraw_m328p+0x2> 741a: 06 c0 rjmp .+12 ; 0x7428 <__eerd_blraw_m328p+0x14> 741c: f2 bd out 0x22, r31 ; 34 741e: e1 bd out 0x21, r30 ; 33 7420: f8 9a sbi 0x1f, 0 ; 31 7422: 31 96 adiw r30, 0x01 ; 1 7424: 00 b4 in r0, 0x20 ; 32 7426: 0d 92 st X+, r0 7428: 41 50 subi r20, 0x01 ; 1 742a: 50 40 sbci r21, 0x00 ; 0 742c: b8 f7 brcc .-18 ; 0x741c <__eerd_blraw_m328p+0x8> 742e: 08 95 ret 00007430 <_exit>: 7430: f8 94 cli 00007432 <__stop_program>: 7432: ff cf rjmp .-2 ; 0x7432 <__stop_program>