Well, as the title says, context: my father has a CNC router for wood that is controlled by the Arduino UNO, and from one day to the next, it stopped being detected by the computer he uses to send the coordinates to the CNC.
He sent it to me to take a look at, so I tried connecting it with other cables to see if that was the problem, but it still didn't work. I tried two different computers (which do recognize other Arduinos I have) and nothing worked, so I attributed the failure to the AtMega16U2 chip it has. Looking through the manuals on the website, I tried updating the firmware, but it doesn't even accept it in update mode; it simply doesn't detect it in any way. In short, the problem is definitely with that chip (since I noticed that it was heating up abnormally and its temperature exceeded 80 degrees).
The thing is, the board itself is cheap, so I wouldn't mind sacrificing it. The problem lies in the code inside it. Without that code, the CNC is nothing more than a paperweight. I honestly have no idea how to write code to load it onto another new Arduino so I can continue using the CNC.
Any ideas on how I can recover the device or how to extract the code (I've read in many places that it's practically impossible to extract the code) I don't know what to do, and the company that sold him the CNC wants to charge him the price of a new CNC to give him another board.
Thank you for your help.
Connect an ISP programmer to the ICSP header on the UNO
Run in terminal:
avrdude -c arduino -P /dev/ttyUSB0 -b 19200 -p m328p -U flash:r:dump.hex:i
Post the output here in code tags
Also, if you’re good with soldering SMD, you can desolder the 16U2 and reflash a fresh one (or use a donor from another UNO clone). You’d need to flash the USB firmware
If your Arduino has a socketed DIP for the 328P rather than a soldered on SMD, buy another Uno with a socketed DIP, remove both the 328Ps and put the one from the dead board into the new board.
That is of course assuming that the 328P is not cause of the dead board.
Which it is likely to be if the function is completely gone, otherwise the code would still run.
Shrug. The OP attributed the problem to the 16U2 and in the absence of any other information I took them at their word. And there's lots of other reasons why the code would not run. The polyfuse could have gone. The crystal could be bad. A component could have been knocked off. Jumping to the conclusion that the 328P is the problem and all is lost is not helpful at this point. Doing a processor transplant would rule it in or out.
Would be helpful to have a diagram of how the Arduino is connected
let me add some more info, the board when you plug it via USB will start (or at least it seems that way) because it does the same startup cicle (leds and all), the thing is, well things are that the PC doesn't recognize it and the chip (atmega) is REALLY REALLY hot (for 5v of course).
Ah, more info.
Which ATmega is hot, the 16U2 or the 328P?
the same i stated at the beginning, 16U2.
Hot is a very bad sign, but the ATmega328P chip may have survived. As already suggested, remove it from the board and test it elsewhere.
Without that code, the CNC is nothing more than a paperweight
True, but that code almost certainly exists in a downloadable forum on line, and can be uploaded into a shiny new Arduino Uno R3.
no it’s soldered (i don’t know how to respond to specific messages)
Bypass the dead USB chip with a USB-TTL adapter
yes but the chip is soldered and can’t be removed without equipment (that i don’t have), is there a way to plug in a module maybe to use another usb interface so it can be connected to the computer?
Bypass the dead USB chip with a USB-TTL adapter
which one? (you must understand albeit i understand basic electronics i’m very quite new to the arduino environment, i’m currently studying a career that uses it as a controller but like i said i’m very new to this) sorry in advance if i have to ask several times hehe
do you have a diagram on how to connect it? this will let me send data to the arduino? it will “replace” the USB connection that was previously made by the atmega interface?
- Adapter GND → GND
- Adapter TX → Arduino RX (D0)
- Adapter RX → Arduino TX (D1)
- Adapter 5 V → 5 V (only if you’re not powering the board another way)
- Adapter DTR → RESET through a 0.1 µF cap for auto-reset
Then you can run avrdude -c arduino -P /dev/ttyUSB0 -b 19200 -p m328p -U flash:r:dump.hex:i
I wouldn’t suggest using this permanently - try pulling the hex dump first.
and that will let me use the module as a usb replacement ? another question i think the CNC has his very own power supply and i don’t know if that same PSU also powers the arduino or just the machine, that i don’t know, so if i want to use the module with 3v it will let me send data but i have to power the board with another power source? and if i want to power the board i have to switch to 5v right?
and a final question, if i use this module as a replacement that means the atmega chip won’t be energized? because if it is that will probably be a problem (a heating problem)