Problems with programming an IC with Arduino (MiniCore's Atmega8)

Hi,

I'm trying to make a project that involves using only IC instead of a whole Arduino, and I'm using Atmega8A-PU for that. I got the coding complete for the project, but I'm having problems when trying to program the chip. I'm using MiniCore to get the Atmega8 board in the Arduino IDE.

The options used:

  • BOD: 2.7V
  • Bootloader: Yes (UART0)
  • Clock: External 16 Mhz
  • EEPROM: EEPROM retained
  • Compiler LTO: LTO enabled
  • Programmer: Arduino as ISP

The wiring used:

After I burned the chip's bootloader, when using the Upload Using Programmer option, it results in an error where the 'cmd' is not found in %PATH% (verbose programming during compile):

FQBN: MiniCore:avr:8:LTO=Os_flto
Using board '8' from platform in folder: C:\Users\Asus\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.2.2
Using core 'MCUdude_corefiles' from platform in folder: C:\Users\Asus\AppData\Local\Arduino15\packages\MiniCore\hardware\avr\2.2.2

loading library from d:\Documents\Arduino\libraries\DFPlayer-Mini-mp3-master: invalid library: no header files found
Detecting libraries used...
"C:\\Users\\Asus\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++17 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_ATmega8 -DARDUINO_ARCH_AVR -Wextra -flto -g "-IC:\\Users\\Asus\\AppData\\Local\\Arduino15\\packages\\MiniCore\\hardware\\avr\\2.2.2\\cores\\MCUdude_corefiles" "-IC:\\Users\\Asus\\AppData\\Local\\Arduino15\\packages\\MiniCore\\hardware\\avr\\2.2.2\\variants\\standard" "C:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD\\sketch\\projectdip.ino.cpp" -o nul
Generating function prototypes...
"C:\\Users\\Asus\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++17 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -w -x c++ -E -CC -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_ATmega8 -DARDUINO_ARCH_AVR -Wextra -flto -g "-IC:\\Users\\Asus\\AppData\\Local\\Arduino15\\packages\\MiniCore\\hardware\\avr\\2.2.2\\cores\\MCUdude_corefiles" "-IC:\\Users\\Asus\\AppData\\Local\\Arduino15\\packages\\MiniCore\\hardware\\avr\\2.2.2\\variants\\standard" "C:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD\\sketch\\projectdip.ino.cpp" -o "C:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"C:\\Users\\Asus\\AppData\\Local\\Arduino15\\packages\\builtin\\tools\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\\Users\\Asus\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++17 -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega8 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_ATmega8 -DARDUINO_ARCH_AVR -Wextra -flto -g "-IC:\\Users\\Asus\\AppData\\Local\\Arduino15\\packages\\MiniCore\\hardware\\avr\\2.2.2\\cores\\MCUdude_corefiles" "-IC:\\Users\\Asus\\AppData\\Local\\Arduino15\\packages\\MiniCore\\hardware\\avr\\2.2.2\\variants\\standard" "C:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD\\sketch\\projectdip.ino.cpp" -o "C:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD\\sketch\\projectdip.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core: C:\Users\Asus\AppData\Local\Temp\arduino\cores\69dc4db7a654a6f240744cddeff3e0ce\core.a
Linking everything together...
"C:\\Users\\Asus\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -Wl,--gc-sections -mmcu=atmega8 -w -flto -g -o "C:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD/projectdip.ino.elf" "C:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD\\sketch\\projectdip.ino.cpp.o" "C:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD/..\\..\\cores\\69dc4db7a654a6f240744cddeff3e0ce\\core.a" "-LC:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD" -lm
"C:\\Users\\Asus\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD/projectdip.ino.elf" "C:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD/projectdip.ino.eep"
"C:\\Users\\Asus\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD/projectdip.ino.elf" "C:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD/projectdip.ino.hex"

cmd /C echo. && "C:\\Users\\Asus\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objdump" --disassemble --source --line-numbers --demangle --section=.text "C:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD/projectdip.ino.elf" > "C:\\Users\\Asus\\AppData\\Local\\Temp\\arduino\\sketches\\004AB754ECF677000B9EF18734867ACD/projectdip.ino_atmega8_16000000L.lst"
exec: "cmd": executable file not found in %PATH%

Compilation error: exec: "cmd": executable file not found in %PATH%

What should be done regarding this?

arduino as isp uses D9 as reset for target.
quarz need 2 capacitors.
if you burn bootloader - diconnect arduino and connect UART converter

Compilation error has nothing with the upload. Anyway, are you sure you've burned the chip's bootloader? Your HW setup is wrong. Read this for the setup first of all:

Also, if you try to upload the program via ISP then the bootloader will be removed.

Don't I already connect the pin 10, 11, 12, and 13 to RESET, SCK, MISO, and MOSI respectively though in my circuit? I followed this one. Or would those 2 18-22 pF r̶e̶s̶i̶s̶t̶o̶r̶s̶ capacitors change things?

And for the minimal circuit, which hardware configuration archive can work for IDE 2.1.0?

These 18-22pF capacitors are really needed for correct oscillator circuit. The value is not so important, 22pF is good enough for 16MHz crystal in most breadboard circuits.

Yeah, capacitors, sorry for the mistake. So it'd mean that the one in that video is wrong or there's something that made the one in that video work?

I didn't watch the video. It's too long for me. Just follow the instructions on the link I've already posted. The first schematics is feasible even UNO is used there and ATmega168 on the breadboard.
It will work for Nano and ATmega8 as well. All you need is oscillator circuit with crystal an two 22pF capacitors, RESET circuit with pull-up resistor cca 10kOhm on the target MCU, 6 wires between programmer and target. Big capacitor on programmer Nano (RESET-GND) can be used.

Looks like a problem with the operating system, or the installation of the Arduino IDE. Possibly a file removed incorrectly by an antivirus program?
Do you have the directory C:\Windows\System32 in %PATH%? The error is caused by the operating system not being able to find the executable file for cmd.

Would the " Invalid device signature" problem caused by this and adding those 2 capacitors can solve that? Because I thought it can be caused by the IC I bought being malfunctioning low quality or such (but need to save budget).

if you decide to follow only this video, why are you asking us for help?
and if you asked, then it is quite logical that you do what we say. we should not and will not beg you to try.

Yes, there is a possibility. Post the log. What is the signature. What signature is expected?
If the HW setup is incorrect, you cannot expect it will work correctly even the chip is functioning.
Remember that 3 things must be present for the ATmega to work:

  1. power,
  2. clock,
  3. reset circuit.
    Then you can bootload it, to program it or run the program.

That part is only informing about what I did before asking here, not that I'd ignore anything else, but I also asked to clarify which tutorial I searched in internet is right/credible or wrong. Also sometimes I don't have all components when I got the answers here and there's limited time to buy it directly, or wait for online purchases (now I already bought those capacitors for what's required), sorry.

I guess now it works after I re-arranged the breadboard circuit from the beginning, and thanks for the upload tips that it can't be done via the ISP.

1 Like

Great!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.