GM328 out of order [solved] - Page 1
Forum section: electronics / testgear

author: PBh
author_rank: Contributor
timestamp: July 18, 2021, 08:00:22 pm
content: Hello everybody,As a quick presentation, I bought my Fluke 77 multimeter in the 80's and I am still happy using it every day !But sometimes it's missing some functions ;-)I ordered this GM328https://fr.aliexpress.com/item/32785578867.htmlexactly four years ago.I added a power switch to avoid forgetting it powered on.Recently, it doesnt work anymore. Power on Ok but no menu appearing on the LCD (or on another LCD I've tried on).Supposing a program memory loss, I bought a GM328A (unfortunately without the removable DIP µP) and an arduino R3 I supposed able to copy from a good CPU to the bad one, or check the 'bad' Atmega328P chip.I've installed the Arduino IDE but is not familiar with ATMega, git and other software tools. I am nearer the soldering iron than keyboard :Is a memory corruption in Atmega328P possible ? Because of the power switch ? (memory corruption by powering off when writing ?)Any other idea for causing this failure ? Is it frequent ?Where to find a hex file to compare with the supposed corrupted Atmega328P ?How to make the comparison ? With the R3 board ? Howto link ?Any advice, link to something to read will be appreciated.Probably I will, in a second time, ask for source code, if exists, to adapt my GM328 to my needs...

author: BrokenYugo
author_rank: Super Contributor
timestamp: July 18, 2021, 09:32:08 pm
content: I would sooner expect the 328P to be damaged, these testers don't have much for input protection.There testers are heavily documented with improved firmware available, no need to dump another unless you want to, where exactly to get the firmware and how exactly to ICSP flash them into the tester I've not yet gotten around to figuring out on mine, as it works well enough as is. There's a huge thread about the herehttps://www.eevblog.com/forum/testgear/$20-lcr-esr-transistor-checker-project/One generally compares hex files in a hex editor.

author: modoran
author_rank: Regular Contributor
timestamp: July 19, 2021, 06:49:02 am
content: The microcontroller is most likely locked, so you will not be able to dump the hex content from it.

author: Nusa
author_rank: Super Contributor
timestamp: July 19, 2021, 07:12:02 am
content: I don't know about the exact hex dump for your exact model, but most of the firmware for these testers originated as open source. At the very least, you can replace it with something that will work, assuming the hardware otherwise works and you learn some basic tools.This is THE thread for this subject. Jump in at the end with specific questions:https://www.eevblog.com/forum/testgear/$20-lcr-esr-transistor-checker-project/msg3547011/#msg3547011Or read this site for basics:https://www.mikrocontroller.net/articles/AVR_Transistortester

author: PBh
author_rank: Contributor
timestamp: July 19, 2021, 07:16:47 am
content: Yes, I have seen this thread, but the problem is its 281 pages !!!I will take more time to search in it.Is there any tutorial to program my ATMega chip ?

author: Nusa
author_rank: Super Contributor
timestamp: July 19, 2021, 07:24:06 am
content: The pdf download at my second link contains a great deal of useful information. Start by at least skimming that.

author: RoGeorge
author_rank: Super Contributor
timestamp: July 19, 2021, 07:25:38 am
content: Never seen a microcontroller that lost it's program, but in theory it could happen.- First of all, check if the microcontroller is powered.- I see 2 electrolytic capacitors in the kit pics. Electrolytic capacitors often dries out after some years. Change those and see if it starts.- Check if the clock is runing (Quartz crystals may shutter from mechanical shocks).- After that, if still doesn't work, reflash (reprogram) the existing microcontroller. Find the proper firmware that matches with your existing hardware. The thread to ask this is the link posted beforehttps://www.eevblog.com/forum/testgear/$20-lcr-esr-transistor-checker-project/. You can use your Arduino R3 as a programmer to program the GM328 on its board. You don't need to desolder the GM328's chip to do that.- If that still doesn't work, then desolder the ATmega328 and resolder a new one. If you don't have a spare chip, use an Arduino nano as a donor, they are dirt cheap and easily available.

author: PBh
author_rank: Contributor
timestamp: July 19, 2021, 07:56:28 am
content: [ a lot of answers not seen before writing this:]I like to understand why electronics fails, it helps me create robust schematics.I dont't think it is an input stress problem. I take care of my tester and only measure in a safe manner.Hex comparison: my question was "how to extract it from failed ATmega ? ", supposing firmware is not protected of course.Once reprogrammed, impossible to know the cause if it was a firmware loss ![Ok, I take some time to read links you sent me ! Thanks]

author: RoGeorge
author_rank: Super Contributor
timestamp: July 19, 2021, 08:19:26 am
content: There's no need to read a thread with thousands of replies. Just put some pictures with your kit model and ask what firmware is compatible with the board you have. Then program that firmware into the chip. There's no need to read the old one.Verify what usually fails first, like I advised you in the previous post.You wont get any understanding from a single failure. If it were to analyze 100 failures of the same board, maybe, but from a single board and a single failure you can not learn much. Failure is a statistical process. You need lots and lots of examples to draw any correct conclusions.Chips can be damaged from electrostatic discharges, or from cosmic rays, not kidding. Very rare, but could happen. Then, it might not be a microcontroller failure, after all. Have you checked the other causes, yet?

author: PBh
author_rank: Contributor
timestamp: July 19, 2021, 03:09:15 pm
content: Quote from: RoGeorge on July 19, 2021, 07:25:38 amafter pushing on the button:Red led lighted andµC power is good and cleanQuote from: RoGeorge on July 19, 2021, 07:25:38 amFor the moment I have no appropriate tool to check that. My Fluke77 says <1V AC is present. My DSO138 is too slow.I see nothing alive on serial link lines to the LCD.Quote from: RoGeorge on July 19, 2021, 07:25:38 amI have to learn how to do that- do you mean that I can use R3 board as an ISP programmer connected to GM328 board ?Quote from: RoGeorge on July 19, 2021, 07:25:38 amHopefully, no need to desolder, it is a DIP28 on a socket

author: blurpy
author_rank: Regular Contributor
timestamp: July 19, 2021, 03:54:21 pm
content: It looks like a standard AY-AT, which I have documented quite a bit about here, including the original firmware for download:https://github.com/blurpy/transistor-tester

author: RoGeorge
author_rank: Super Contributor
timestamp: July 19, 2021, 05:19:41 pm
content: Quote from: PBh on July 19, 2021, 03:09:15 pmHow do you know the power is good if you don't have an oscilloscope? If those 10uF electrolytic are too old, they can make the voltage stabilizer to oscillate. Just replace them to be sure.Yes, you can use an Arduino UNO (R3) as a programmer, to program other AVR chips like (the presumably defective) ATmega328 used in GM328. If you do that, while programming other chips you must put a 10uF between the Arduino UNO R3 Reset and GND pins. This is sometimes not mentioned in the documentation or tutorials, but without it it won't work (unless you have a very old original Arduino UNO).In fact, without even trying to program the GM328, you should be able to read the chip ID using "avrdude" from the command line. Avrdude is installed when you installed the Arduino IDE for your Arduino UNO R3.This is a random video showing the wiring to program an external chip. Do that, and don't forget the 10uF between Arduino UNO Reset and GND I wrote you before. The 10uF is not shown in the video.https://www.arduino.cc/en/Tutorial/BuiltInExamples/ArduinoISP/https://forum.arduino.cc/t/arduinoisp-on-uno-requires-10uf-cap-why/102111

author: PBh
author_rank: Contributor
timestamp: July 19, 2021, 06:53:30 pm
content: Quote from: RoGeorge on July 19, 2021, 05:19:41 pmDSO138 is an oscilloscope - with a limited bandwith.I don't read any minimum value of capacitors nor stability problem in the LDO regulator HT7550 datasheet.But I agree, electrolytic capacitors are often a source of problems ;-)

author: RoGeorge
author_rank: Super Contributor
timestamp: July 19, 2021, 10:31:19 pm
content: So, you don't want to check/replace those capacitors.OK, let's hope they are good. I won't try to convince you any more how a high ESR in filtering capacitor can make the microcontroller clock to not start, or how on the power line oscillations of many hundreds of kHz or even MHz can arise and make the microcontroller to not work.You just want to know how to download the firmware. Let's say you downloaded it, and you compare with the other working GM328. Then, they are different. Does this means that the other GM328 has a different firmware, or does it means the old GM328 firmware was damaged? Let's say the former. You see byte 74 is differnt on the 4th bit. Now what? What understanding does this bring?If you are not willing to follow directions, and don't need general advice, then just ask a very specific question, for example "how to download firmware from an ATmega328 using an Arduino nano?". Most probably it won't be possible, because AVR chips, like ATmega328, can be protected against reading the firmware, so one can protect its programs against unauthorized copying.Go to the github pageblurpygave you,https://github.com/blurpy/transistor-tester, click on the "CODE" button, then click "Download ZIP". Save it locally and unzip. Now you have the whole project locally, including the already compiled hex. If you read the readme files you'll find this, as already told:QuoteMeaning it shouldn't be possible to download the firmware.However, it is possible to overwrite another firmware, as advised.Beware that there are 3 things that can be written in an ATmega328- the fuses (or fuse bits)- the program (the executable firmware)- the EEPROM (the data flash)You can find them all already compiled in the "transistor-tester-master/firmware/original" folder. The exact location of the avrdude programmer software depends of your OS and your local install path for Arduino IDE. To find it, search on your local disk "avrdude". Usually is in "hardware/tools/avr/bin/". If you are using windows it might be "avrdude.exe" instead of just "avrdude", IDK.Since the MCU is on a socket, remove it, place it on a separate breadboard, and see if this PDF has enough detail to read the chip.https://app.box.com/s/ol1z8jjnrpy6wly4w61imt7wcbxk3fcgGood luck with it.

author: ebclr
author_rank: Super Contributor
timestamp: July 19, 2021, 11:20:17 pm
content: This device is so cheap that is easier to buy a new one, and put the old one on trash, is not worth the time to save 4 dollars

author: BrokenYugo
author_rank: Super Contributor
timestamp: July 20, 2021, 01:32:18 am
content: Quote from: ebclr on July 19, 2021, 11:20:17 pmWhile technically correct, nobody ever learned anything from being a model consumer like that.

author: PBh
author_rank: Contributor
timestamp: July 21, 2021, 07:26:48 pm
content: May be ebclr have not readQuote from: PBh on July 19, 2021, 07:56:28 amQuote from: RoGeorge on July 19, 2021, 10:31:19 pmNo, I can't for the moment. And I could explain you the cause of electrolytics cap failure - it is clearly not a risky situation on this board used a few hours only at low power and low temperature and powered with a battery through a few cm line !Quote from: RoGeorge on July 19, 2021, 10:31:19 pmThis is useful information. If program memory content is the same, flash could be a more probable (since it is written into) cause to check.Is there any CRC in flash content ?"readback protect fuse": I have enough worked with chinese people to know that this is not a thing they take care of !"""ISP""" programmer. I had red information like that before. But "ISP" means "In situ", so on GM328 Tester board itself. Correct title should be "how to contruct a programmer with a R3 and a breadbord".Does anybody have tried to add an ISP connector to GM328 board ? In other words, will the 680r resistor cause the MISO line (pin 18 of ATMega) to fail in its programming function ?Thanks guys for your time,

author: PBh
author_rank: Contributor
timestamp: July 21, 2021, 07:37:36 pm
content: Quote from: PBh on July 21, 2021, 07:26:48 pm

author: blurpy
author_rank: Regular Contributor
timestamp: July 22, 2021, 07:11:05 am
content: Quote from: PBh on July 21, 2021, 07:37:36 pmWhat is a TRUE ISP connector? Is it different from what I have used in the link I gave you previously?

author: PBh
author_rank: Contributor
timestamp: July 22, 2021, 10:04:13 pm
content: Please read the definition of ISP here:https://en.wikipedia.org/wiki/In-system_programmingIf you have to remove the processor from its board to program it, it is not an ISP.Said differently, you can update processor firmware while it is on target (application) board, so you can make hundreds of tries/compilations very quickly without taking any risk with the processor or the socket.I'm a newbee in arduino software, I'll need so many tries !

author: blurpy
author_rank: Regular Contributor
timestamp: July 23, 2021, 07:25:12 am
content: Quote from: PBh on July 22, 2021, 10:04:13 pmOk, then you should have everything you need

author: PBh
author_rank: Contributor
timestamp: August 02, 2021, 01:01:26 pm
content: Ok, going back to original problem.I bought another kit to have spare parts.I tried to (add) new capacitors, change quartz, change LCD, change ATMega: same problem.Cleaned PCB from glue/foam backwards the PCB (to maintain battery in the box and avoid shorts between GM328 pins), same problem.BUT ! What a strange behavior ! :After 90seconds after power-up, I can see on the display:Bat. 8.4V OKVCC=5.01V2 seconds later:Cell!11mV 12mV 12mVAnother 2 seconds latershort probes! (flashing). EtcIt is the calibration procedure, but VERY slowed, and nothing changes after end of procedure.Same problem appears after power off/On.Same thing with ATmega chip No2.Is anybody here understanding that behaviorI continue my investigations, and cleaning of quartz section...

author: PBh
author_rank: Contributor
timestamp: August 03, 2021, 03:33:46 am
content: Quote from: blurpy on July 22, 2021, 07:11:05 amTrue ISP described here:https://dragaosemchama.com/en/2019/04/gm328a-reverse-engineering-new-firmware-and-tetris/

author: Nusa
author_rank: Super Contributor
timestamp: August 03, 2021, 06:25:15 am
content: Quote from: PBh on August 03, 2021, 03:33:46 amNo idea where you got the word "true" from, since that word doesn't exist on that site, says search. Googling "true isp" doesn't get me anything relevant either. The only thing I can think of is that you looked at a translated version of the site and garbled it going back to English to get a technical term that isn't used.Anyway, what I see in the picture is probably your typical 2x3 6-pin avr isp pinout. The other common one is a 2x5 10-pin avr isp pinout. USBASP programmers usually have one or the other, sometimes both. Adapters between the two are trivial.And to actually answer the question, the ISP pins are connected directly to the CPU pins, so the 680 ohm resistor is not in series with the programming circuit to the MISO pin. And going the other way, so long as the test socket is empty, there's nothing to interfere with its operation.

author: PBh
author_rank: Contributor
timestamp: August 03, 2021, 05:19:14 pm
content: When I am talking of true ISP, it means you can program the chip without removing it from the target board. 9thIt is not the case with the "Arduino as ISP" video you can see here:https://youtu.be/muP1dp73Mdgand in RoGeorge post on July 19th above.I found the original problem of my GM328: it was some diodes in the ESD protection array which was shorted.Since it is a very small and not easily accessible component, I tested it late...There should be a form of autotest procedure inside the ATMega, which causes the initialisation to be VERY long, and made me think about quartz problem...

author: Dumidan
author_rank: Contributor
timestamp: August 04, 2021, 11:29:45 am
content: Quote from: PBh on August 03, 2021, 05:19:14 pmThat is right. If the 3 test terminals are short-circuited at start-up, the self-calibration procedure is started.

author: PBh
author_rank: Contributor
timestamp: August 04, 2021, 06:42:11 pm
content: Quote from: BrokenYugo on July 18, 2021, 09:32:08 pmFor the component socket 3 inputs, GM328 DO have protection diodes TO Vcc and GND and a TVS.