Hello, I’m working with @miros.407 on the project. I tried to use the ini file @maxgerhardt posted. My Serial Port is COM5 and I replaced the SERIAL_PORT_HERE with COM5.
Now I’m getting the Error Code:
avrdude: can’t open config file “C:\Users\HP”: Permission denied
avrdude: error reading system wide configuration file “C:\Users\HP”
*** [upload] Error 1
Any ideas on how to give the permission?
I have found the path: -C
C:\Program Files (x86)\Arduino\hardware\tools\avr\etc
is read-only.
In the platformio.ini, can you replace $PROJECT_PACKAGES_DIR/tool-avrdude/avrdude.conf with "$PROJECT_PACKAGES_DIR/tool-avrdude/avrdude.conf" please (quoting should escape the path properly)
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
*** [upload] Error 1
================================================================================================== [FAILED] Took 2.09 seconds ==================================================================================================
The terminal process “C:\Users\HP Gaming Rechner.platformio\penv\Scripts\pio.exe ‘run’, ‘–target’, ‘upload’” terminated with exit code: 1.
The picture is cutoff at the left so I can’t see if you have a capacitor installed between RST and VCC, further the breadboard at the bottom is cut off.
A thing I find weird in the target board is the RESET line. Am I blind or does the bottom right pin of the ISP header, which is supposed to be RESET, go nowhere, just between the two headers themselves, but not to the actual RESET pin of the chip, which is just connected to one pin of the button? Hardware error? The SPI SlaveSelect (SS) line must definitely go the RESET of the target.
You can check whether it makes a difference if you connect the the SS pin of the Mega to the bottem left pin of the reset button (in regards to the above posted picture) (or touch it while programming with a male-male cable). The RESET button is an input connected to nothing else (if you don’t press the button) so nothing bad should happen.
Edit: Also, the page https://www.arduino.cc/en/Tutorial/BuiltInExamples/ArduinoISP should be the main source of information for the wireup. There are different wireups in there, e.g. RESET <-> RESET or SS <–>RESET with caps and not. Just glossed over it, maybe you can extract some more information from this and try a few different things.
This is the suggested wiring for using a Mega as a ISP programmer… although it’s for a Uno, same principle applies, and you can read between the lines as to which pins on the target match the 644
The Arduino MEGA above is programming an Arduino UNO connecting D51-D11, D50-D12, D52-D13, GND-GND, 5V-5V and D10 to RESET. This type of board needs a 10µF electrolytic capacitor connected to RESET and GND with the positive (long leg) connected to RESET. The capacitor has to be placed after the programmer board has been loaded with the ISP sketch.
The 10µF electrolytic capacitor connected to RESET and GND of the programming board is needed only for the boards that have an interface between the microcontroller and the computer’s USB, like Mega, Uno, Mini, Nano. Boards like Leonardo, Esplora and Micro, with the USB directly managed by the microcontroller, don’t need the capacitor.
Basically, if you don’t put it on the Mega after loading the ArduinoISP sketch, your Mega will reset instead of the target board, which isn’t very helpful! Or at least, that’s what I think it prevents!
Looks like the 644 RST should be connected to D10 on the Mega, not SS…
Longer answer: Yes absolutely because the capacitor suppresses a voltage drop of the RESET line from high to low when programmer tool initializes the device and does an eventual auto-reset, like @pfeerick said.
Some thoughts of mine:
double check with a multimeter that the reset pin of the ISP header goes through to the actual reset pin of the ATMega644. If it’s not, then the programmer can impossibly reset the chip, and then you need to make direct connection to that pins, somehow, either by soldering it or tapping that pin with the needed wire
double check that you’re NOT feeding 5V from the Arduino Mega into the target board when the target board is connected to its power supply at the same time! You’ll have two power supplies fighting each other and there’ll be a current between them. Either disconnect VCC between the two boards or disconnect the power supply from the target board (5V from the Mega should be plenty to power your target board which only has like the MCU and 3 other chips…)
double check voltages on the board to see if between GND and VCC of the board there really is a good 5V supply
note that I’ve seen that the ISP sketches / resources talk about “old school wiring” and new wiring. So there might be conflicting information around. Look into the source code of the exact (and hopefully recent) version of the Arduino as ISP sketch that you’re putting on your Arduino Mega, it should already tell you exactly how the wireup is supposed to be
you can sanity check that the “Arduino as ISP” Mega board is generally working by e.g. flashing a known-good Arduino Uno with the exact wireup as shown above. This would instantly eliminate the programmer from being the problem
if you’ve tried all wiring methods, all the voltages seem good and the programmer works in general on another chip then you can
Add -F on a new line in the list of upload_flags of the platformio.ini, to try a “force”
If this very likely makes no difference replace the ATMega644 of your target board, as it might by truely dead by “something”. From your pictures I do see that the chip is socketed so you can just pull it out and put a new one in, if you have a replacement part (that can also still be ordered today)
as another caveat: your microcontroller has no crystall oscillator attached to its XTAL1 and XTAL2 pins, it’s just an empty hole. The microcontroller should recognize that and start up on its internal RC oscillator (8MHz) though, I hope. Otherwise the chip will just do nothing without a clock. Possible clock settings are listed in the core
Now we added a capaciator 10µf and flash again now it gets flashed but we got a verifaction error.
avrdude: verifying …
avrdude: verification error, first mismatch at byte 0x0000
0x00 != 0x0c
avrdude: verification error; content mismatch
Thats the complet error. But don’t know why. I checked the wireing. Flashed the arduino with the isp new. Connect the Capaciator. I swaped between the platform ini’s.
avrdude: AVR device initialized and ready to accept instructions
So i checked now everything. I wrote an small blinky where it loops through and blink. When i connect my wire to the Output pin 5 at the 644 the led Flashes perfectly until the reading error is comming. So
avrdude: AVR device initialized and ready to accept instructions
avrdude: verifying …
avrdude: verification error, first mismatch at byte 0x0000
0x00 != 0x0c
avrdude: verification error; content mismatch
avrdude: safemode: Fuses OK (E:00, H:00, L:00)
avrdude done. Thank you.
here Stops but i don’t have any idea why. So the Programmer runs perfectly, the arduino as programmer too. I connected the Leds for heartbeat, error and programming. So it is another Reason why it fails. The double power isn’t it because i power the ship by the arduino. The Capiciator could be but i change it so booth couldn’t be broken. The Ship 644 is also working because i’ve got the LED output only at my output pin. Any other ideas? i change the wirering between SS for reset and D10 booth dosen’t work.