Author Topic: $20 LCR ESR Transistor checker project  (Read 4030555 times)

carrascoso and 6 Guests are viewing this topic.

Offline madires

  • Super Contributor
  • ***
  • Posts: 8177
  • Country: de
  • A qualified hobbyist ;)
Re: $20 LCR ESR Transistor checker project
« Reply #8800 on: September 07, 2023, 03:54:15 pm »
Does that happen only for electrolytic caps?
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3248
  • Country: us
Re: $20 LCR ESR Transistor checker project
« Reply #8801 on: September 07, 2023, 03:59:21 pm »
If you want to create your own firmware version, choosing the right compiler version can noticeably reduce the code size.
...

This is rather incredible! Do you have any idea of what's going on?

Could you post the assembly output from the 8.3 and 12.1 compilers? I would be interested in comparing the two.

See this link for generating an assembly listing interleaved with source:

https://stackoverflow.com/a/1289907
« Last Edit: September 07, 2023, 04:03:04 pm by ledtester »
 

Offline indman

  • Super Contributor
  • ***
  • Posts: 1170
  • Country: by
Re: $20 LCR ESR Transistor checker project
« Reply #8802 on: September 07, 2023, 04:14:53 pm »
Does that happen only for electrolytic caps?
Yes, only on electrolytic capacitors, I didn't notice it on other families.

I recently did a comparison of different avr-gcc versions. I took all the versions available for Linux (Debian stable) and compiled a 1.50m (with an identical setup for my AY-AT with 20 MHz xtal).
Can you show your settings file for the config.h clone - I'm interested to compare the size of the firmware that will be with my compiler on Windows?
« Last Edit: September 07, 2023, 04:18:34 pm by indman »
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 8177
  • Country: de
  • A qualified hobbyist ;)
Re: $20 LCR ESR Transistor checker project
« Reply #8803 on: September 07, 2023, 05:54:00 pm »
Could be dielectric absorption as the polarity stays the same for all measurements in the C monitor (and C measurement in the LCR monitor).
 

Offline indman

  • Super Contributor
  • ***
  • Posts: 1170
  • Country: by
Re: $20 LCR ESR Transistor checker project
« Reply #8804 on: September 07, 2023, 06:13:43 pm »
madires,hm... but then we should see exactly the same effect on a k-firmware clone if we measure the same capacitance first on pins 1-2 and then on pins 1-3, on which the monitor mode is automatically turned on? But I do not observe such an effect, or am I wrong? This effect does not bother me much, since I know that electrolytic capacitors can have a large deviation from the nominal capacity. But it was just interesting to understand why. :)
« Last Edit: September 07, 2023, 06:26:34 pm by indman »
 

Offline prashk20

  • Newbie
  • Posts: 7
  • Country: us
Re: $20 LCR ESR Transistor checker project
« Reply #8805 on: September 08, 2023, 04:52:15 am »
Hello!

I pulled in the 1.50m firmware and ran it on my Arduino Uno. Most of the functions work well except a specific range of resistors. Schematics is mostly based on AY-AT clone.

Before I go on about the issue, I want to thank everyone who is building this amazing instrument. Thank you! :)

Now the problem. I know Arduino Uno and Component Tester on a breadboard is not the best accuracy, but I get error of under 1% on most resistors, except a range where it gives 50% error.
Correct Readings of Resistors within 1%: 220, 330, 470, 1k, 2.2k, 220k, 470k, 1M.
1868941-0 1868953-1 1868959-2
Incorrect Readings of Resistors: 10 as 5, 100 as 50, 4.7k as 14k, 10k as 4.2k, 22k as 9.9k, 47k as 21.5k, 100k as 44k.
 1868947-3

I am using 1% resistors as of now and not required 0.1%. I'm not sure if this is the issue because 220 is read correctly but not 100 and 2.2k is correct. 200K is correct but 100K is read as 44K.
This issue is not specific to a set of probe pins. The issue is only with a range of resistors, while another range is read correctly, I wonder what the mistake here might be.

The self adjustment doesn't seem to work. After shorting the probes, it calculates Ri+-, etc., and on next click gives an error. 1868974-4
And the LEDs are not working. (Update: got LEDs working)
Any ideas?



Attached are pictures.
Makefile and config modifications and output is here: https://github.com/pk17r/Transistortester-Warehouse/tree/prash/ComponentTester-1.50m_Arduino_Uno
« Last Edit: September 08, 2023, 06:21:42 am by prashk20 »
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 8177
  • Country: de
  • A qualified hobbyist ;)
Re: $20 LCR ESR Transistor checker project
« Reply #8806 on: September 08, 2023, 09:15:12 am »
madires,hm... but then we should see exactly the same effect on a k-firmware clone if we measure the same capacitance first on pins 1-2 and then on pins 1-3, on which the monitor mode is automatically turned on? But I do not observe such an effect, or am I wrong? This effect does not bother me much, since I know that electrolytic capacitors can have a large deviation from the nominal capacity. But it was just interesting to understand why. :)

That asks for some further investigation.

Update:
The issue can happen when the electrolytic cap creates a negative voltage in respect to the measurement polarity. Karl-Heinz has solved this in the k-firmware by using a voltage divider to shift the reference point to about 140 mV which allows to also measure a small negative voltage. Both firmwares measure the cap's unloaded voltage after discharging the cap to get the zero offset.
« Last Edit: September 08, 2023, 05:57:52 pm by madires »
 
The following users thanked this post: indman

Offline madires

  • Super Contributor
  • ***
  • Posts: 8177
  • Country: de
  • A qualified hobbyist ;)
Re: $20 LCR ESR Transistor checker project
« Reply #8807 on: September 08, 2023, 09:23:36 am »
The self adjustment doesn't seem to work. After shorting the probes, it calculates Ri+-, etc., and on next click gives an error.

Please post the values displayed during the self-adjustment.
 

Offline Yuriy_K

  • Regular Contributor
  • *
  • Posts: 166
  • Country: ru
Re: $20 LCR ESR Transistor checker project
« Reply #8808 on: September 08, 2023, 10:39:39 am »
Any ideas?
Hello!

  For your circuit to work correctly, you need to modify ARDUINO_UNO. Replace the 1000 pF capacitor and cut the trace to input 5 of the op amp, marked with an X.
 
The following users thanked this post: prashk20

Offline horo

  • Regular Contributor
  • *
  • Posts: 108
  • Country: de
    • My GitHub Projects
Re: $20 LCR ESR Transistor checker project
« Reply #8809 on: September 08, 2023, 06:11:55 pm »

Could you post the assembly output from the 8.3 and 12.1 compilers? I would be interested in comparing the two.

See this link for generating an assembly listing interleaved with source:

https://stackoverflow.com/a/1289907

I get different output formats for 8.3.0 and 12.1.0, the newer version contains the source code while the old version lacks it.
I attached the compiler output of both versions as well as the disasm (which looks similar to the already produced listing lss).
I had to tar both tar.gz archives because the forum doesn't like tar.gz or tgz.

7.3.0:
Code: [Select]
0000338a <MeasureESR>:
    338a: a4 e0        ldi r26, 0x04 ; 4
    338c: b0 e0        ldi r27, 0x00 ; 0
    338e: eb ec        ldi r30, 0xCB ; 203
    3390: f9 e1        ldi r31, 0x19 ; 25
    3392: 0c 94 d6 3e jmp 0x7dac ; 0x7dac <__prologue_saves__>
    3396: 9c 83        std Y+4, r25 ; 0x04
    3398: 8b 83        std Y+3, r24 ; 0x03
    339a: 89 2b        or r24, r25
    339c: 51 f4        brne .+20      ; 0x33b2 <MeasureESR+0x28>
    339e: 2f ef        ldi r18, 0xFF ; 255
    33a0: 3f ef        ldi r19, 0xFF ; 255
    33a2: 3c 83        std Y+4, r19 ; 0x04
    33a4: 2b 83        std Y+3, r18 ; 0x03
    33a6: 8b 81        ldd r24, Y+3 ; 0x03
    33a8: 9c 81        ldd r25, Y+4 ; 0x04
    33aa: 24 96        adiw r28, 0x04 ; 4
    33ac: e2 e1        ldi r30, 0x12 ; 18
    33ae: 0c 94 f2 3e jmp 0x7de4 ; 0x7de4 <__epilogue_restores__>
    33b2: eb 81        ldd r30, Y+3 ; 0x03
    33b4: fc 81        ldd r31, Y+4 ; 0x04
    33b6: 63 81        ldd r22, Z+3 ; 0x03
    33b8: 74 81        ldd r23, Z+4 ; 0x04
    33ba: 85 81        ldd r24, Z+5 ; 0x05
    33bc: 96 81        ldd r25, Z+6 ; 0x06
    33be: a7 ef        ldi r26, 0xF7 ; 247
    33c0: ea 2e        mov r14, r26
    33c2: 0a e0        ldi r16, 0x0A ; 10
    33c4: 10 e0        ldi r17, 0x00 ; 0
    33c6: 20 e0        ldi r18, 0x00 ; 0
    33c8: 30 e0        ldi r19, 0x00 ; 0
    33ca: 42 81        ldd r20, Z+2 ; 0x02
    33cc: 0e 94 a5 11 call 0x234a ; 0x234a <CmpValue>
    33d0: 87 fd        sbrc r24, 7
    33d2: e5 cf        rjmp .-54      ; 0x339e <MeasureESR+0x14>
    33d4: 0e 94 f4 13 call 0x27e8 ; 0x27e8 <DischargeProbes>
    33d8: 80 91 91 01 lds r24, 0x0191 ; 0x800191 <Check>
    33dc: 81 30        cpi r24, 0x01 ; 1
    33de: f9 f2        breq .-66      ; 0x339e <MeasureESR+0x14>
    33e0: eb 81        ldd r30, Y+3 ; 0x03
    33e2: fc 81        ldd r31, Y+4 ; 0x04
    33e4: 11 81        ldd r17, Z+1 ; 0x01
    33e6: 00 81        ld r16, Z
    33e8: 17 b8        out 0x07, r1 ; 7
    33ea: 18 b8        out 0x08, r1 ; 8
    33ec: 14 b8        out 0x04, r1 ; 4
    33ee: 15 b8        out 0x05, r1 ; 5
    33f0: 40 e0        ldi r20, 0x00 ; 0
    33f2: 61 2f        mov r22, r17
    33f4: 80 2f        mov r24, r16
    33f6: 0e 94 b4 10 call 0x2168 ; 0x2168 <UpdateProbes>


12.1.0:
Code: [Select]
00004614 <MeasureESR>:
 *  - ESR in 0.01 Ohm
 *  - UINT16_MAX on any problem
 */

uint16_t MeasureESR(Capacitor_Type *Cap)
{
    4614: a7 e0        ldi r26, 0x07 ; 7
    4616: b0 e0        ldi r27, 0x00 ; 0
    4618: e0 e1        ldi r30, 0x10 ; 16
    461a: f3 e2        ldi r31, 0x23 ; 35
    461c: 0c 94 a4 44 jmp 0x8948 ; 0x8948 <__prologue_saves__>

00004620 <.L1^B33>:
    4620: 8e 83        std Y+6, r24 ; 0x06
    4622: 9f 83        std Y+7, r25 ; 0x07

00004624 <.LVL1075>:
  uint32_t          Sum_1;         /* sum #1 */
  uint32_t          Sum_2;         /* sum #2 */
  uint32_t          Value;

  /* check for a capacitor >= 10nF */
  if ((Cap == NULL) ||
    4624: 2e 81        ldd r18, Y+6 ; 0x06
    4626: 3f 81        ldd r19, Y+7 ; 0x07
    4628: 23 2b        or r18, r19
    462a: 51 f4        brne .+20      ; 0x4640 <.L605>

0000462c <.L607>:
      (CmpValue(Cap->Value, Cap->Scale, 10, -9) < 0)) return ESR;
    462c: 6f ef        ldi r22, 0xFF ; 255
    462e: 7f ef        ldi r23, 0xFF ; 255
    4630: 7a 83        std Y+2, r23 ; 0x02
    4632: 69 83        std Y+1, r22 ; 0x01

00004634 <.L604>:
  Cfg.Ref = ADC_REF_BANDGAP;       /* we've used the bandgap reference */

  DischargeProbes();               /* discharge DUT */

  return ESR;
}
    4634: 89 81        ldd r24, Y+1 ; 0x01
    4636: 9a 81        ldd r25, Y+2 ; 0x02
    4638: 27 96        adiw r28, 0x07 ; 7
    463a: e2 e1        ldi r30, 0x12 ; 18
    463c: 0c 94 c0 44 jmp 0x8980 ; 0x8980 <__epilogue_restores__>

P.S.:
This linker option gives even more space, from 32562 bytes down to 32044 bytes (avr-gcc-8.3.0):
Code: [Select]
LDFLAGS += -Wl,--relax
« Last Edit: September 08, 2023, 07:05:40 pm by horo »
 
The following users thanked this post: ledtester, Maniaxx, majortom

Offline majortom

  • Newbie
  • Posts: 3
  • Country: us
Re: $20 LCR ESR Transistor checker project
« Reply #8810 on: September 08, 2023, 10:57:22 pm »
I built the aur package for avr-gcc 8.5, and played around this morning to compare to avr-gcc 13.2.0.
My differences weren't nearly as impressive as horo, but using CFLAGS += -flto definitely helped to
squeeze a couple more features in there that wouldn't have otherwise fit.
GCC 13.2 below was prior to adding some features that normally wouldn't have fit, like IR Detector.

Was earlier this AM, and after a long day of work I might have missed a step here in my description.
edit: and saw similar with the linker --relax switch as well.
 
config.h
https://pastebin.com/Zag8JYRk
config_328.h
https://pastebin.com/jsVF55sL

Code: [Select]

avr-gcc (GCC) 8.5.0
AVR Memory Usage
----------------
Device: atmega328

Program:   32920 bytes (100.5% Full)
(.text + .data + .bootloader)

Data:        265 bytes (12.9% Full)
(.data + .bss + .noinit)

EEPROM:      884 bytes (86.3% Full)
(.eeprom)

avr-gcc (GCC) 8.5.0
CFLAGS += -flto
AVR Memory Usage
----------------
Device: atmega328

Program:   32342 bytes (98.7% Full)
(.text + .data + .bootloader)

Data:        263 bytes (12.8% Full)
(.data + .bss + .noinit)

EEPROM:      884 bytes (86.3% Full)
(.eeprom)


avr-gcc (GCC) 13.2.0
AVR Memory Usage
----------------
Device: atmega328

Program:   28926 bytes (88.3% Full)
(.text + .data + .bootloader)

Data:        261 bytes (12.7% Full)
(.data + .bss + .noinit)

EEPROM:      756 bytes (73.8% Full)
(.eeprom)

avr-gcc (GCC) 13.2.0
CFLAGS += -flto
AVR Memory Usage
----------------
Device: atmega328

Program:   28044 bytes (85.6% Full)
(.text + .data + .bootloader)

Data:        260 bytes (12.7% Full)
(.data + .bss + .noinit)

EEPROM:      756 bytes (73.8% Full)
(.eeprom)
« Last Edit: September 11, 2023, 01:14:38 am by majortom »
 

Offline prashk20

  • Newbie
  • Posts: 7
  • Country: us
Re: $20 LCR ESR Transistor checker project
« Reply #8811 on: September 09, 2023, 12:34:11 am »
The self adjustment doesn't seem to work. After shorting the probes, it calculates Ri+-, etc., and on next click gives an error.

Please post the values displayed during the self-adjustment.

The values are:
Ri- 20.0Ohm
Ri+ 22.0Ohm
C0 43pF
R0 0.20Ohm
Vref 1008mV
Vcc 5001mV
AComp -45mV

Next page on click is Error.

I went through your note on Self-Adjustment (Many many thanks for the superb documentation  :-+, I first used a 2.2uF cap several times before doing this.)

I am using Arduino Uno as of now for prototyping, but will use a Atmega1284 chip or a Teensy 4.0 microcontroller (if suitable) for my finished tester.
 

Offline prashk20

  • Newbie
  • Posts: 7
  • Country: us
Re: $20 LCR ESR Transistor checker project
« Reply #8812 on: September 09, 2023, 01:03:22 am »
Any ideas?
Hello!

  For your circuit to work correctly, you need to modify ARDUINO_UNO. Replace the 1000 pF capacitor and cut the trace to input 5 of the op amp, marked with an X.

Hello Yuri,
I didn't think mods would be needed for Uno. I first implemented the k firmware for Arduino Uno shield using the posted hex files and that seemed to work fine, so I thought it should work here as well. For my finished tester, I will use an Atmega1084 chip or a Teensy 4.0 microcontroller (if permissible). The Atmega chip pcb should not run into this issue. I'll next prototype the tester with Atmega1084 chip on a breadboard and see the output. Thank you for the solution!
Regards
 

Offline Maniaxx

  • Contributor
  • Posts: 30
  • Country: de
  • sys2064
Re: $20 LCR ESR Transistor checker project
« Reply #8813 on: September 09, 2023, 01:56:53 am »
The values are:
Ri- 20.0Ohm
Ri+ 22.0Ohm
C0 43pF
R0 0.20Ohm
Vref 1008mV
Vcc 5001mV
AComp -45mV

Next page on click is Error.
That's only the summary. The test results beforehand are needed. Or check the 'README' yourself for valid ranges. See this and following post.
 
The following users thanked this post: prashk20

Offline prashk20

  • Newbie
  • Posts: 7
  • Country: us
Re: $20 LCR ESR Transistor checker project
« Reply #8814 on: September 09, 2023, 10:11:48 am »
The values are:
Ri- 20.0Ohm
Ri+ 22.0Ohm
C0 43pF
R0 0.20Ohm
Vref 1008mV
Vcc 5001mV
AComp -45mV

Next page on click is Error.
That's only the summary. The test results beforehand are needed. Or check the 'README' yourself for valid ranges. See this and following post.

Hello Maniaxx, thank you for the info! It helped!
I found the problem (an embarrassing one), I was not shorting the pins correctly, used disconnected male headers thinking I am shorting the circuit  :palm:

On actually shorting the circuits, it all works well. Thank you!  :-+
Video: https://drive.google.com/file/d/1Lh0MI19b0TE3IFjUfQ6MI-D5P-kdI-x4/view?usp=sharing
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 8177
  • Country: de
  • A qualified hobbyist ;)
Re: $20 LCR ESR Transistor checker project
« Reply #8815 on: September 09, 2023, 10:16:29 am »
That list is the currently used adjustment profile. When the self-adjustment succeeds the profile will be updated. On error it won't change. In this case the first four values are the default values. Vref and AComp are already updated by measuring a film cap three times. Vcc is also the default value (no external reference available). It's a bit confusing, it's simply the same function as called by the 'show values' menu item to keep the firmware size small. Maybe it would be better to show the list only on success.
 
The following users thanked this post: prashk20

Offline prashk20

  • Newbie
  • Posts: 7
  • Country: us
Re: $20 LCR ESR Transistor checker project
« Reply #8816 on: September 09, 2023, 10:18:17 am »
Any ideas?
Hello!

  For your circuit to work correctly, you need to modify ARDUINO_UNO. Replace the 1000 pF capacitor and cut the trace to input 5 of the op amp, marked with an X.

Hello Yuri,
Thank you for the info. Using this I actually found the difference on Uno (100nF) vs Component Tester (1nF) circuit. I also found Madires has clearly given instructions for Uno, which I somehow overlooked. I now enabled ADC_LARGE_BUFFER_CAP in config and that makes it all work. Now 10Ohm, 100, 10k, 22k, etc are all read correctly!
Thank you!  :-+
 

Offline prashk20

  • Newbie
  • Posts: 7
  • Country: us
Re: $20 LCR ESR Transistor checker project
« Reply #8817 on: September 09, 2023, 10:32:57 am »
That list is the currently used adjustment profile. When the self-adjustment succeeds the profile will be updated. On error it won't change. In this case the first four values are the default values. Vref and AComp are already updated by measuring a film cap three times. Vcc is also the default value (no external reference available). It's a bit confusing, it's simply the same function as called by the 'show values' menu item to keep the firmware size small. Maybe it would be better to show the list only on success.

Thank you for the explanation Madires. I earlier didn't really connect that measuring a film cap three times before was doing something. I'm new to this project, so some of the info on Readme and the manual, I miss even after reading it. It's a superb project, I'm super impressed!

I bumped onto this project while looking for better implementations of resistor measurement using potential divider. I got tired of using the Multimeter for every measurement. I made one basic resistor measurement program on Uno but that doesn't work well for small resistors or big ones. Maybe because I didn't use port and pin controls but I'll look into that sometime. Right now this is like amazing! And thank you for maintaining a superb documentation on this project! :) :-+
 

Offline Maniaxx

  • Contributor
  • Posts: 30
  • Country: de
  • sys2064
Re: $20 LCR ESR Transistor checker project
« Reply #8818 on: September 09, 2023, 10:38:40 pm »
This linker option gives even more space
Nice, indeed. My config on avr-gcc 8.5.0:

32600 bytes (99.5% Full)
32062 bytes (97.8% Full) #CFLAGS += -flto
31522 bytes (96.2% Full) #CFLAGS += -flto / LDFLAGS += -Wl,--relax

I'm wondering though why 'lto' is present but commented out in MAKEFILE. Maybe it doesn't work on Windows compiler?
 

Offline moimem

  • Contributor
  • Posts: 13
  • Country: tn
Re: $20 LCR ESR Transistor checker project
« Reply #8819 on: September 10, 2023, 07:53:56 am »
This linker option gives even more space
Nice, indeed. My config on avr-gcc 8.5.0:

32600 bytes (99.5% Full)
32062 bytes (97.8% Full) #CFLAGS += -flto
31522 bytes (96.2% Full) #CFLAGS += -flto / LDFLAGS += -Wl,--relax

I'm wondering though why 'lto' is present but commented out in MAKEFILE. Maybe it doesn't work on Windows compiler?

(#CFLAGS += -flto) is working for me in windows 11 x64 and reduce the 1.50m firmware size
I have tried some versions of avr-gcc from version  4.3.3 (included with the last winavr of 2010)  to  version 12.1.0 and i had the best results with version 7.3.0 and binutils: 2.26.20160125, newer versions seems to drop some optimizations but its in my todo list to try every gcc version. With the m_firmware evolving, for the atmega328 with only 32kb we need to find the best compiler version and options to fit as many features as possible.
with the same code i get
Code: [Select]
avr-gcc 7.3.0
Program:   32652 bytes (99.6% Full)
(.text + .data + .bootloader)

avr-gcc 12.1.0  (110.5% Full)
« Last Edit: September 10, 2023, 08:01:21 am by moimem »
 

Offline indman

  • Super Contributor
  • ***
  • Posts: 1170
  • Country: by
Re: $20 LCR ESR Transistor checker project
« Reply #8820 on: September 10, 2023, 08:09:47 am »
Maniaxx,moimem and everyone, without attaching the config_h and config_328.h settings files to your messages about compilation with different avr-gcc, the information is of little use, since there is no way for other people to compare results on their computers. majortom did the right thing in his message above and attached these files.
AVR-GCC 13.2 showed surprisingly good compilation results but i can't test it on my Windows machine yet. With avr-gcc 8.3.0(flto enabled) and majortom configuration files I get a firmware size of 31740 bytes (96.9%).
« Last Edit: September 10, 2023, 08:34:38 am by indman »
 

Offline moimem

  • Contributor
  • Posts: 13
  • Country: tn
Re: $20 LCR ESR Transistor checker project
« Reply #8821 on: September 10, 2023, 09:02:31 am »
Maniaxx,moimem and everyone, without attaching the config_h and config_328.h settings files to your messages about compilation with different avr-gcc, the information is of little use, since there is no way for other people to compare results on their computers. majortom did the right thing in his message above and attached these files.
AVR-GCC 13.2 showed surprisingly good compilation results but i can't test it on my Windows machine yet. With avr-gcc 8.3.0(flto enabled) and majortom configuration files I get a firmware size of 31740 bytes (96.9%).

avr-gcc 7.3.0 windows11_x64
Code: [Select]
AVR Memory Usage
----------------
Device: atmega328

Program:   32652 bytes (99.6% Full)
(.text + .data + .bootloader)

Data:        260 bytes (12.7% Full)
(.data + .bss + .noinit)

EEPROM:      903 bytes (88.2% Full)
(.eeprom)

avr-gcc 8.3.0
Code: [Select]
AVR Memory Usage
----------------
Device: atmega328

Program:   32662 bytes (99.7% Full)
(.text + .data + .bootloader)

Data:        260 bytes (12.7% Full)
(.data + .bss + .noinit)

EEPROM:      903 bytes (88.2% Full)
(.eeprom)
« Last Edit: September 10, 2023, 09:13:12 am by moimem »
 

Offline indman

  • Super Contributor
  • ***
  • Posts: 1170
  • Country: by
Re: $20 LCR ESR Transistor checker project
« Reply #8822 on: September 10, 2023, 09:29:45 am »
moimem, with your configuration files i get slightly different results on Windows 10x64.
A more compact size is obtained with avr-gcc 8.3.0.
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 8177
  • Country: de
  • A qualified hobbyist ;)
Re: $20 LCR ESR Transistor checker project
« Reply #8823 on: September 10, 2023, 11:04:20 am »
32600 bytes (99.5% Full)
32062 bytes (97.8% Full) #CFLAGS += -flto
31522 bytes (96.2% Full) #CFLAGS += -flto / LDFLAGS += -Wl,--relax

I'm wondering though why 'lto' is present but commented out in MAKEFILE. Maybe it doesn't work on Windows compiler?

Because that option isn't supported by all compilers. IIRC, very old avr-gcc versions don't. I'll add a hint about compiler/linker optimizations to the README textfile.

Addendum:
When experimenting with other optimization options not already in the CFLAGS be careful with time critical functions/measurements. We have seen some options screwing up delay loops. A few years back I had to change a few inline asm delays for that reason.
« Last Edit: September 10, 2023, 01:48:00 pm by madires »
 
The following users thanked this post: horo

Offline moimem

  • Contributor
  • Posts: 13
  • Country: tn
Re: $20 LCR ESR Transistor checker project
« Reply #8824 on: September 10, 2023, 01:02:47 pm »
moimem, with your configuration files i get slightly different results on Windows 10x64.
A more compact size is obtained with avr-gcc 8.3.0.
interestingly we obtain the exact file size with avr-gcc 8.3.0 (32662 bytes) so its not related to windows version but i have better results with avr-gcc-7.3.0
i have mixed a lot of versions of gcc and binutils and cant tell wich file is responsible of this defference in results, its either we have different gcc7.3.0 files or its related to an other bin called during compilation.
can you try my attached avr-gcc-7.3.0.exe file, and just drop it in place of the 8.3.0 with all other files from gcc 8.3.0 and check the results
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf