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

Obelix2007, moimem, Feliciano and 17 Guests are viewing this topic.

Offline AlcidePiR2

  • Regular Contributor
  • *
  • Posts: 95
  • Country: fr
Re: $20 LCR ESR Transistor checker project
« Reply #6250 on: May 31, 2020, 01:09:34 pm »
Having spent so much time reading in order to understand how to upgrade and flash my AY-AT transistor tester I decided to document as much as possible of what I've learned: https://github.com/blurpy/transistor-tester

Maybe someone else will find it useful :)

I already said that this was helpful, but I must say it again, when I realized that in your repository are the examples of Makefile, config.h and config328.h for the AY-AT boards.

Indeed, after repairing my board, and successfully flashing  the  compiled files provided by Indman, I wanted to change some options. I had then to compile the code by myself.  Starting from  Madires repository. But although the files are well written an documented,   the multiplicity of options makes it difficult, and my first trys were not successful. Then I realized that you posted as well the config files.
Using them was immediate success. So you saved my day. Thanks again.
« Last Edit: May 31, 2020, 01:53:19 pm by AlcidePiR2 »
 

Offline robca

  • Frequent Contributor
  • **
  • Posts: 257
Re: $20 LCR ESR Transistor checker project
« Reply #6251 on: May 31, 2020, 04:48:53 pm »
I'm sure that this information is somewhere in the thread, but I could not find it.

What version of the AVR toolchain generates the most compact code? Ideally the Windows version, but if there is a Linux version that generates even more compact code, I would have no problems using it

I know that different compiler versions generate code with different optimizations, and that results in binaries with different lengths
 

Offline indman

  • Super Contributor
  • ***
  • Posts: 1010
  • Country: by
 
The following users thanked this post: robca

Offline GnatGoSplat

  • Regular Contributor
  • *
  • Posts: 78
  • Country: us
Re: $20 LCR ESR Transistor checker project
« Reply #6253 on: May 31, 2020, 07:02:15 pm »
  However, I still need to fix µ and Ω not showing up with the correct character on the display.
Use the flag CFLAGS + = -DLCD_CYRILLIC in the makefile

I would like to, but unfortunately I can't compile anything.  Spent another evening trying to figure out how to compile and no go.
Would someone who is able to compile 1.13k for mega8 be willing to help me out with this?
Shawn
 

Offline indman

  • Super Contributor
  • ***
  • Posts: 1010
  • Country: by
Re: $20 LCR ESR Transistor checker project
« Reply #6254 on: May 31, 2020, 07:25:37 pm »
GnatGoSplat look zip file  ;)
 
The following users thanked this post: GnatGoSplat

Offline GnatGoSplat

  • Regular Contributor
  • *
  • Posts: 78
  • Country: us
Re: $20 LCR ESR Transistor checker project
« Reply #6255 on: May 31, 2020, 08:17:17 pm »
GnatGoSplat look zip file  ;)

Thanks so much, that did fix the issue with the characters.
Looks like I broke it somehow though.  Now it's very, very slow, doesn't respond much of the time when I press the button, and returns incorrect results for capacitors.  Definitely not your build because I flashed the original one back in and it's still super slow.  I have no idea what I messed up.  Nothing looks broken.  Weird.

Might be the fuses aren't right.  I'll have to look into that.

UPDATE: It was the fuses.  All is well now.
« Last Edit: May 31, 2020, 09:06:23 pm by GnatGoSplat »
Shawn
 

Offline blurpy

  • Regular Contributor
  • *
  • Posts: 232
  • Country: no
Re: $20 LCR ESR Transistor checker project
« Reply #6256 on: June 01, 2020, 07:22:24 am »
Having spent so much time reading in order to understand how to upgrade and flash my AY-AT transistor tester I decided to document as much as possible of what I've learned: https://github.com/blurpy/transistor-tester

Maybe someone else will find it useful :)

I already said that this was helpful, but I must say it again, when I realized that in your repository are the examples of Makefile, config.h and config328.h for the AY-AT boards.

Indeed, after repairing my board, and successfully flashing  the  compiled files provided by Indman, I wanted to change some options. I had then to compile the code by myself.  Starting from  Madires repository. But although the files are well written an documented,   the multiplicity of options makes it difficult, and my first trys were not successful. Then I realized that you posted as well the config files.
Using them was immediate success. So you saved my day. Thanks again.

Nice to hear you found my documentation useful and got your tester working, that makes it worth the effort!
 

Offline robca

  • Frequent Contributor
  • **
  • Posts: 257
Re: $20 LCR ESR Transistor checker project
« Reply #6257 on: June 01, 2020, 06:17:19 pm »
I'm programming my AY-AT tester and before overwriting the original 328p I tried reading the firmware (which I assumed was pointless and expected to fail due to the protection bits). But my chip was not protected, and I have a copy of the firmware and EEPROM.

I'm not sure if mine was an exception, or all AY-AT ship without protection fuses set. I thought I'd mention it in case anyone here wants a copy (just reply here and I'll copy it somewhere)

EDIT: attached as ZIP. firmware, eeprom and fuses configuration
« Last Edit: June 01, 2020, 08:19:49 pm by robca »
 
The following users thanked this post: madires, edavid, indman, elecdonia, pepe10000, horo, blurpy

Offline madires

  • Super Contributor
  • ***
  • Posts: 7756
  • Country: de
  • A qualified hobbyist ;)
Re: $20 LCR ESR Transistor checker project
« Reply #6258 on: June 01, 2020, 06:30:14 pm »
You could also zip and attach them to your post. ;)
« Last Edit: June 01, 2020, 07:34:20 pm by madires »
 
The following users thanked this post: robca

Offline blurpy

  • Regular Contributor
  • *
  • Posts: 232
  • Country: no
Re: $20 LCR ESR Transistor checker project
« Reply #6259 on: June 01, 2020, 07:26:46 pm »
I'm programming my AY-AT tester and before overwriting the original 328p I tried reading the firmware (which I assumed was pointless and expected to fail due to the protection bits). But my chip was not protected, and I have a copy of the firmware and EEPROM.

I'm not sure if mine was an exception, or all AY-AT ship without protection fuses set. I thought I'd mention it in case anyone here wants a copy (just reply here and I'll copy it somewhere)

Nice! My AY-AT had the protection bits set so I was unable to make a copy.

+1 to madires' suggestion.
 
The following users thanked this post: robca

Offline robca

  • Frequent Contributor
  • **
  • Posts: 257
Re: $20 LCR ESR Transistor checker project
« Reply #6260 on: June 01, 2020, 08:20:29 pm »
More than anything, I wanted to be sure it was not something everyone had... just attached to the previous message as ZIP
 

Offline indman

  • Super Contributor
  • ***
  • Posts: 1010
  • Country: by
Re: $20 LCR ESR Transistor checker project
« Reply #6261 on: June 01, 2020, 08:39:53 pm »
More than anything, I wanted to be sure it was not something everyone had... just attached to the previous message as ZIP
Thanks!
This version for AY-AT is based on the rather outdated 1.12k from Karl-Heinz. Its only advantage is the ability to test the sensors DHT11-DS18B20 and IR Encoder-Decoder, which the Chinese added.
 

Offline robca

  • Frequent Contributor
  • **
  • Posts: 257
Re: $20 LCR ESR Transistor checker project
« Reply #6262 on: June 01, 2020, 08:43:41 pm »
I'm compiling 1.39m with SW_ONEWIRE_SCAN but no IR functionality, and I'm getting a compilation error: C:\Work\AvrAYAT\ComponentTester-1.39m/display.c:407: undefined reference to `Display_HexDigit'

I think that the problem is in the following snippet in display.c

Code: [Select]
/* ************************************************************************
 *   display of values and units
 * ************************************************************************ */


#if defined (SW_IR_RECEIVER) || defined (HW_IR_RECEIVER) || defined (SW_IR_TRANSMITTER)

/*
 *  display single hexadecimal digit
 *
 *  requires:
 *  - value to display (0-15)
 */

void Display_HexDigit(uint8_t Digit)
{
  /*
   *  convert value into hex digit:
   *  - 0-9: ascii 48-57
   *  - A-F: ascii 65-70
   */

  if (Digit < 10) Digit += 48;     /* 0-9 */
  else Digit += (65 - 10);         /* A-F */
  Display_Char(Digit); 
}

#endif



#if defined (SW_IR_RECEIVER) || defined (HW_IR_RECEIVER) || defined (SW_ONEWIRE_SCAN) || defined (SW_FONT_TEST)

/*
 *  display byte as hexadecimal number
 *
 *  requires:
 *  - value to display (0-255)
 */

void Display_HexByte(uint8_t Value)
{
  uint8_t           Digit;

  /* first digit */
  Digit = Value / 16;
  Display_HexDigit(Digit);

  /* second digit */
  Digit = Value % 16;
  Display_HexDigit(Digit);
}

#endif

in particular

Code: [Select]
/* ************************************************************************
 *   display of values and units
 * ************************************************************************ */

#if defined (SW_IR_RECEIVER) || defined (HW_IR_RECEIVER) || defined (SW_IR_TRANSMITTER)

should be

Code: [Select]
#if defined (SW_IR_RECEIVER) || defined (HW_IR_RECEIVER) || defined (SW_ONEWIRE_SCAN) || defined (SW_IR_TRANSMITTER)

When I make that change, it compiles without problems, but I don't understand enough of the code to know if there are any negative side effects elsewhere
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7756
  • Country: de
  • A qualified hobbyist ;)
Re: $20 LCR ESR Transistor checker project
« Reply #6263 on: June 01, 2020, 08:54:15 pm »
AlcidePiR2 was one page faster. :) It's a fault in the #ifdef management for two functions and will be fixed in the next version.
 
The following users thanked this post: robca

Offline robca

  • Frequent Contributor
  • **
  • Posts: 257
Re: $20 LCR ESR Transistor checker project
« Reply #6264 on: June 01, 2020, 09:01:17 pm »
AlcidePiR2 was one page faster. :) It's a fault in the #ifdef management for two functions and will be fixed in the next version.
Sorry I missed it, too many posts to read  :-[

Can I assume my fix is safe?
 

Offline robca

  • Frequent Contributor
  • **
  • Posts: 257
Re: $20 LCR ESR Transistor checker project
« Reply #6265 on: June 01, 2020, 10:16:51 pm »
One more question, if I may

My AY-AT seems to have a pretty bad encoder and I have problems getting double clicks to be recognized. I will replace it, but right now I don't have one handy. I'd like to lengthen the time for a double click, so that it's not such a hit or miss affair.

I looked at user.c, the TestKey function. In the following snippet:

Code: [Select]
      /* determine key press type */
      if (Ticks > 26)                   /* long (>= 300ms) */
      {
        Key = KEY_LONG;                 /* signal long key press */
      }
      else                              /* short (< 300ms) */
      {
        Key = KEY_SHORT;                /* signal short key press */

        /* check for second key press if requested */
        if (Mode & CHECK_KEY_TWICE)
        {
          MilliSleep(50);               /* delay for checking key again */
          Ticks = 20;                   /* timeout of 200ms */
 
          while (Ticks > 0)             /* timeout loop */
          {
            Test = BUTTON_PIN & (1 << TEST_BUTTON);    /* get button status */         

            if (Test == 0)                             /* test button pressed */
            {
              MilliSleep(30);                          /* time to debounce */
              Test = BUTTON_PIN & (1 << TEST_BUTTON);  /* get button status */

              if (Test == 0)                           /* test button still pressed */
              {
                Ticks = 1;                             /* end loop */
                Key = KEY_TWICE;                       /* signal two key presses */
                MilliSleep(200);                       /* smooth UI */
              }
            }

            Ticks--;                                   /* decrease timeout */
            MilliSleep(10);                            /* wait 10ms */
          }
        }

I think that if I change
Code: [Select]
if (Ticks > 26)                   /* long (>= 300ms) */ to a value higher than 26, say 35, I should get a longer timeout for a long press to be recognized, and
Code: [Select]
Ticks = 20;                   /* timeout of 200ms */
while (Ticks > 0)             /* timeout loop */
to 25, that should give me more time to have a double click recognized.

@madires can you please let me know if I'm on the right path? It's rather inconvenient for me to remove the Atmega328p to program it and reinstall, so I'd like to minimize the amount of modify/compile/flash, if you have time to chime in. If not, I'll try it out

 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7756
  • Country: de
  • A qualified hobbyist ;)
Re: $20 LCR ESR Transistor checker project
« Reply #6266 on: June 02, 2020, 11:42:23 am »
Can I assume my fix is safe?

Yep!
 
The following users thanked this post: robca

Offline madires

  • Super Contributor
  • ***
  • Posts: 7756
  • Country: de
  • A qualified hobbyist ;)
Re: $20 LCR ESR Transistor checker project
« Reply #6267 on: June 02, 2020, 12:07:16 pm »
I think that if I change
Code: [Select]
if (Ticks > 26)                   /* long (>= 300ms) */ to a value higher than 26, say 35, I should get a longer timeout for a long press to be recognized,

You also need to change:
Code: [Select]
          if (Ticks > 26) Run = 0;      /* end loop if 300ms are reached */

to the same value. With 35 the minimum time for a long button press will be (35 + 1) * 10ms + 30ms = 390ms. This is the time you have to press the button to be detected as a long button press. It doesn't have any impact on the double-press.

and
Code: [Select]
Ticks = 20;                   /* timeout of 200ms */
while (Ticks > 0)             /* timeout loop */
to 25, that should give me more time to have a double click recognized.

Yes, that will increase the timeout for the second button press (25 * 10ms = 250ms), i.e. the time in which the button has to be pressed again to be detected as a double-press.
 
The following users thanked this post: robca

Offline ifishtoo

  • Newbie
  • Posts: 3
  • Country: us
Re: $20 LCR ESR Transistor checker project
« Reply #6268 on: June 03, 2020, 02:15:17 am »
I would very much like a copy of that firmware.  i am still trying to decide which one to buy first. 
 

Offline robca

  • Frequent Contributor
  • **
  • Posts: 257
Re: $20 LCR ESR Transistor checker project
« Reply #6269 on: June 03, 2020, 04:44:22 pm »
I would very much like a copy of that firmware.  i am still trying to decide which one to buy first.
I attached the ZIP file to my original message just after madires and blurpy's suggestion. It's a few messages before this one
« Last Edit: June 04, 2020, 01:01:04 am by robca »
 
The following users thanked this post: pepe10000

Offline AlcidePiR2

  • Regular Contributor
  • *
  • Posts: 95
  • Country: fr
Re: $20 LCR ESR Transistor checker project
« Reply #6270 on: June 04, 2020, 09:16:53 pm »
I started from a standard AY-AT clone.

inspired by blurpy documentation, I made several changes after replacing the SRV05-4 which was fried.

- changed the 7550 to a MCP1702
- changed the 680R resistors to 681R 0.1%
- changed the 470 kR  resistors to 475kR 0.1%
- replaced the TL431  by a MAX6126 ( see attached pict)
- replaced  the 8 Mhz crystal by a 20 Mhz
- flashed the 1.39m  firmware after compiling with appropriate changes in Makefile, config.h, config_328.h, in particular for
/* Rl in Ohms */
#define R_LOW            681

/* Rh in Ohms */
#define R_HIGH           475000


Everything is working, except that the perfs are quite deceptive.
I have measure several high precision resistors ( 0.01%  and 0.05%)
but it seems that the precision that can be  achieved is only 2% for measuring resistors.

Is this normal ?

 
The following users thanked this post: elecdonia

Offline madires

  • Super Contributor
  • ***
  • Posts: 7756
  • Country: de
  • A qualified hobbyist ;)
Re: $20 LCR ESR Transistor checker project
« Reply #6271 on: June 04, 2020, 09:22:16 pm »
Have you run the self-adjustment incl. the film cap procedure?
 

Offline AlcidePiR2

  • Regular Contributor
  • *
  • Posts: 95
  • Country: fr
Re: $20 LCR ESR Transistor checker project
« Reply #6272 on: June 04, 2020, 10:35:01 pm »
Have you run the self-adjustment incl. the film cap procedure?

I have run the  items from the menu
- Test
- Adjustment

 

Offline indman

  • Super Contributor
  • ***
  • Posts: 1010
  • Country: by
Re: $20 LCR ESR Transistor checker project
« Reply #6273 on: June 05, 2020, 06:02:37 am »
AlcidePiR2 You did it?
"Before running the self-adjustment the first time, please measure a film
capacitor with a value between 100nF and 3.3µF three times at least to let the
tester self-adjust the offsets mentioned above."
 

Offline AlcidePiR2

  • Regular Contributor
  • *
  • Posts: 95
  • Country: fr
Re: $20 LCR ESR Transistor checker project
« Reply #6274 on: June 05, 2020, 06:16:10 am »
AlcidePiR2 You did it?
"Before running the self-adjustment the first time, please measure a film
capacitor with a value between 100nF and 3.3µF three times at least to let the
tester self-adjust the offsets mentioned above."

No, I did not see that. Will do it today.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf