Elektroda.com
Elektroda.com
X

Search our partners

Find the latest content on electronic components. Datasheets.com
Elektroda.com

Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g

TechEkspert 38598 72
This content has been translated flag-pl » flag-en View the original version here.
  • Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g
    In the topic about the component tester LCR M328 Information about the possibility of changing the microcontroller firmware has appeared. I decided to check it in practice, despite the risk of breaking the device. Since the last tests, I have secured the LCD against falling out with a thermal glue and secured with a piece of stiff foil a flexible tape connecting the LCD with the board.

    The software and documentation of the microprocessor tester can be found here:
    https://www.mikrocontroller.net/svnbrowser/transistortester/
    I suspect that all available LCR testers have software based on these sources.


    We click "Download GNU tarball" and extract the content (e.g. using 7zip).

    We will use the source code to work with Atmel Studio 7.

    After installing the Atmel Studio 7 environment, select:
    File -> New -> GCC C Executable Project, select the ATMEGA328P microcontroller and create a project with the selected name in the selected location.
    We copy all files from the directory with unpacked contents \ Software \ trunk \
    to the directory of the created Atmel Studio project (where the .cproj file is),
    then we agree to replace main.c.
    Copy the "fonts" and "mega328_st7565" directories from the \ Software \ trunk \ directory to the project directory.
    Right-click on the project name in the solution explorer window and select:
    Add-> Existing items let's add all * .ci * .h files
    Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g

    Select project-> properties, select use external makefile and select the Makefile file from the "mega328_st7565" directory, in the project directory.
    Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g

    In the Makefile file we change:
    UI_LANGUAGE = LANG_ENGLISH on UI_LANGUAGE = LANG_POLISH (if we want Polish menu)
    CFLAGS + = -DLCD_ST7565_H_OFFSET = 4 per CFLAGS + = -DLCD_ST7565_H_OFFSET = 0 (image shift)
    CFLAGS + = -DLCD_ST7565_V_FLIP = 1 per CFLAGS + = -DLCD_ST7565_V_FLIP = 0 (vertical flip)
    CFLAGS + = -DLCD_ST7565_H_FLIP = 1 per CFLAGS + = -DLCD_ST7565_H_FLIP = 0 (level reversal)
    I also experimentally turned on:
    CFLAGS + = -DWITH_UJT (Option WITH_UJT enables additional tests for UJT (UniJunction Transistor))

    It's worth experimenting with the Makefile by reading the descriptions and documentation in \ Dock \ tags \ english

    To generate files to be placed in the microcontroller's memory, select:
    We choose Build-> Build Solution.
    We should receive a message:
    ========== Build All: 1 succeeded, 0 failed, 0 skipped ==========

    After completing the compilation, go to the "mega328_st7565" directory in the project directory, there is the TransistorTester.hex file (flash memory content) and TransistorTester.eep (eeprom content). Place both files in the memory of the ATMEGA328P microcontroller using the selected ISP programmer. I used AVRISP MKII and software from AtmelStudio environment. To connect to the ISP connector in the tester, I used the connecting cables for the contact plate. The photo below shows the pinout of the connector.
    Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g

    For the time of programming, we lock the button that turns on the device (e.g. with a clothes peg) to ensure continuous power supply of the microcontroller.

    If everything goes well, the tester will greet us with messages in Polish:
    Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g




    We put our own logo.

    Perhaps logo placement is not some super ambitious and necessary task, but it is a good way to start playing with tester code. We have an area of 128x32 black and white pixels at our disposal (during the ongoing test). We'll write each pixel as a bit in a byte, and that takes 512B in a 512-element array. Each byte will be a vertical 8-pixel dash starting at the top of the x-coordinate of the LSB bit of the array element. After reading as many elements as the image width is (in our example 128), we read the next bar at the y-greek coordinate by 8 pixels.

    If we care about the logo and limit the memory consumption, we can think about a simple "compression", for example saving the coefficient of start and end lines horizontally or vertically instead of data for all pixels, for some pictures it will save memory.

    The black and white elektroda.pl logo from the home page is saved to a PNG file with a resolution of 128x32:
    Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g
    With a simple python code, we convert a PNG file into an array, in which each bit corresponds to a lit or unlit pixel on the LCD. We set the height and width of the PNG file so that they are equal to the power of 2. For a 128x32 image we will have 128x (32/8) = 512 element array, a single element of the array will be a byte. To write the codes, we use the knowledge gained about python and png here:
    Will the Sun clear the EPROM?
    Quickly written python 3 code will turn the PNG file into an array of bytes:

    [syntax=python]from PIL import Image
    i = Image.open("logo.png")

    xx=i.width
    yy=i.height

    print("szerokosc: "+str(xx)+" wysokosc: "+str(yy))

    if xx>128:
    print("Szerokosc wieksza od 128, to nie zadziala...");
    exit();

    if yy>32:
    print("Wysokosc wieksza od 32, to nie zadziala...");
    exit();

    if xx%2!=0 or yy%2!=0:
    print("Szerokosc lub wysokosc nie jest potega 2, to moze nie zadzialac...");


    data=i.load()

    print("const unsigned char PROGMEM logo["+str(int(xx*(yy/8)))+"]= {") #rozpoczynamy tablice

    for y in range(0,yy,8): #idziemy po wsp y obrazka
    for x in range(0,xx): #idziemy po wsp x obrazka
    b=0 #zerujemy wartosc bajt (wszystkie pixesle zgaszone)
    for n in range(0,8): #sprawdzamy kolejne pionowe 8 pixeli na danej wsp. x
    if y+n

    Cool? Ranking DIY
    Can you write similar article? Send message to me and you will get SD card 64GB.
    About Author
    TechEkspert
    Editor
    Offline 
    TechEkspert wrote 3792 posts with rating 3210, helped 12 times. Been with us since 2014 year.
  • #2
    @GUTEK@
    Level 30  
    I also got the impression that this software is worse at measuring transistors, thyristors, etc. But I would have to have a second tester with the original software to check it.

    As for the modifications, here's mine:
    Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g

    - Z73 housing used
    - powered by a 18650 battery
    - TP4056 charger with a micro usb socket
    - MT3608 step-up converter set to 8V
  • #3
    piterek-23
    Level 33  
    Thanks for the description. In my free time I will test :)

    The "elektroda.pl" logo looks great and this is what the tester should look like from the very beginning, and the casing with the "elektroda.pl" engraving is already a fairy tale :)
  • #4
    User removed account
    User removed account  
  • #5
    szymon122
    Level 38  
    Is it possible to copy the original program to the computer before changing the software? Something like a backup.
  • #6
    User removed account
    User removed account  
  • #7
    szymon122
    Level 38  
    Christophorus wrote:
    If the microcontroller is protected against reading the program written in it, then there is no such possibility.

    I knew that much before writing the post ...

    I ask the author of the thread how it is in this case.
  • #8
    User removed account
    User removed account  
  • #9
    Karaczan
    Level 41  
    My T4 was not secured. If I manage to find my load.

    As for the "originality" of the firmware ..
    It is from https://www.mikrocontroller.net/svnbrowser/transistortester/ that is original ;)
    This is the author's website of the original project, the Chinese simply copied it and flipped it on a massive scale. So I suspect that the factory fw is largely based on these sources.

    As for the measurements after changing fw, did you calibrate the tester after changing the software?
  • #10
    TechEkspert
    Editor
    @GUTEK@ wrote:
    I also got the impression that this software is worse at measuring transistors, thyristors, etc. But I would have to have a second tester with the original software to check it.


    Maybe you could get one of the gadgets https://www.elektroda.pl/rtvforum/shop.php and compare?

    szymon122 wrote:
    Christophorus wrote:
    If the microcontroller is protected against reading the program written in it, then there is no such possibility.

    I knew that much before writing the post ...
    I ask the author of the thread how it is in this case.


    I also suspect that it is secured, I must admit that I forgot to check and make a copy, and maybe the security issue depends on the copy?

    Karaczan wrote:

    As for the measurements after changing fw, did you calibrate the tester after changing the software?


    Yes, after placing a new fw, you need to perform a calibration, replacing fw is associated with uploading the hex file to flash and epp to eeprom, i.e. we start from scratch.
  • #11
    @GUTEK@
    Level 30  
    One that I have too few points to order - these points counted from 2015, probably two, it's a pity to take someone else since I already have such a tester.

    Someone has downloaded the original soft and is available in the topic about the modifications of these testers: https://www.elektroda.pl/rtvforum/viewtopic.php?p=15820165#15820165
    I used to check it if it works and it seems to be version 2.07, I don't know with any of these current testers.
  • #13
    logos2000
    Level 21  
    And since the topic about changing the firmware is due to the fact that my original display did not survive the assembly, I decided to adapt a 2x16 display to the existing board (popular HD 47780)

    Connection diagram:

    Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g

    Ports D0 to D3 are brought to the front, while D4 and D5 must be pulled straight from the CPU.

    Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g



    Effect of operation (later the LCD will be an element independent of the test plate, the assembly below was for trial)

    Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g

    in the firmware attachment
  • #14
    TechEkspert
    Editor
    An interesting way to deal with a display crash, what's the symbol after the number in the second line of the display?
    I did not expect that there is a description of the ISP connector on the other side.
  • #16
    logos2000
    Level 21  
    TechEkspert wrote:
    An interesting way to deal with a display crash, what's the symbol after the number in the second line of the display?
    I did not expect that there is a description of the ISP connector on the other side.


    Honestly, I have no idea what [RL] means, when connecting 1-2, it does not display this message

    @GUTEK@ wrote:
    As if someone was looking for the original display: https://www.gearbest.com/lcd-led-display-module/pp_530259.html

    Since these displays are such a lame, I preferred to make it more solid :)
  • #17
    TechEkspert
    Editor
    @ logos2000 I mean this symbol after the number 2162.
  • #18
    logos2000
    Level 21  
    TechEkspert wrote:
    @ logos2000 I mean this symbol after the number 2162.


    Looking after a few resistors is a sign of ohms, but the fact that the ladder is strange, the firmware language is English.

    Edit.
    It turns out that this ladder was caused by the display, but at the target it displays beautifully :)

    I searched and searched for why the tester did not want to start after removing the old LCD, it turned out that the backlight is a control component of the transistor 9015 (M6), so the scalped diode is lit under the board.

    The power supply of the display and its backlight is taken directly from the factory LM7805, the current consumption is 40mA, so there is still a spare for the transistor.

    Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g Change of the firmware of the LCR T4 M328 element tester from the elektroda.pl g
  • #20
    logos2000
    Level 21  
    gulson wrote:
    Here they boast with the software version V2.68:
    https://www.aliexpress.com/item/2016-V2-68-ES...apacitance-ESR-Meter-MOS-PNP/32714478296.html
    I do not know if it's true.


    True, apparently it is more accurate (it's hard to confirm it after one test), although the Registered badge on the project copied from the net is funny ...

    http://blog.goo.ne.jp/meg_8086/e/c42795fa1a6bbbd31f8c5102a806b70d

    And here is the firmware for various clones:
    https://yadi.sk/d/yW8xa5NJgUo5z
  • #24
    gulson
    System Administrator
    Thanks, I know, that one is great, but so far my budget doesn't allow me.
  • #25
    nici
    Moderator Chiptuning
    @TechEkspert Thank you very much for the first post. If I feel that I can, I will change Fw.
  • #26
    Norbert_lubin
    Level 17  
    Hey everyone ... colleagues, reading the description, I apparently did not understand everything and I fired the tester, the tester is in its current state such that after pressing the blue button it says "MTester Testing Vbat = 8.08v" and then it goes to "No unkown or damaged part. " and a question mark then nothing happens ....
    I wanted to do the programming with the TLL866A programmer on the ICSP connector but something went wrong because since the last fight, the minipro program cannot read the ID, I have "00 00 00" and nothing else.
    Due to the fact that everyone described the reprogramming method beautifully, there was an opportunity to make a guide for repairing the Tester :-) I know, I am not laughing hiii, but seriously, if colleagues have an idea, please play begging on your knees for help ... And as for the tester charge, I am interested in the one that has the largest amount of data on the study of mosfet transistors

    Hello, after connecting to pin 1,2, 3 jumpers for 3 pins, nothing happens is the same as I described earlier
    I will add that it is a tester with a blue button if it means the version and there is an Atmega 328P processor
  • #27
    TechEkspert
    Editor
    No unkown or damaged part, it appears regardless of whether there is something connected to pins 1,2,3 or not?
    What happens when the test pins 1,2,3 are shorted and the tester is started?

    ID "00 00 00" indicates a problem with communication with the microcontroller, maybe a problem with fusebits?

    Perhaps the microcontroller is damaged, then the solution would be to solder a new microcontroller, program it with the appropriate batch, and set the fusebits to use the quartz resonator.

    What are your ideas about the cause of such damage?
  • #28
    Norbert_lubin
    Level 17  
    The problem is solved, I changed the processor and a colleague jackfinch helped to reprogram for which thanks a lot for your interest.
  • #29
    TechEkspert
    Editor
    Which firmware was successfully uploaded, how do you rate the functionality?
  • #30
    Norbert_lubin
    Level 17  
    Hello, the version I uploaded is 1.13 from the Electrode and I will say that the measurement of mosfet transistors is amazing, I give much more information about the transistor than the original one. Thank you very much to the people who modified the tester feed, it's a great job, colleagues. Thank you