Programming a standalone ATmega808-XUR using a Nano and UDPI

I'm attempting to upload a bare minimum sketch using Arduino's IDE to an ATmega808. I downloaded jtag2updi and uploaded it to a genuine Arduino nano board to convert it into a UPDI programmer. I then disabled the reset with a 10uF capacitor, connected D6 to the 808's UDPI pin via a 4.7kOhm resistor. The 808 is powered using the nano's 5V output.

Initially I figured the problem was my newly acquired SMD soldering "skills" but after purchasing an SSOP28 socket for troubleshooting, the problem hasn't gone away. Since this was my first time surface mounting chips, I had another 18 Atmel branded 808s on standby, but all of them returned the same error. In terms of software, I have already wiped and reinstalled Arduino IDE to my laptop, and did the same for all board hardware and libraries.

The issue I am running into is #402 and occurs with avrdude immediately after it establishes a system-wide configuration file. I've run the command just prior in the windows CMD, but nothing popped up with respect to missing .dll files. I've performed the exact same setup as countless others, with the only difference being the microcontroller I am using. The documentation for the 808 provided by microchip (assuming they're exactly the same as the Atmel ones) mentions High Voltage "HV" programming which I've never heard of before, but it doesn't seem to be required? I made sure that no bootloader was selected, and programming was done with JTAG2UDPI via the "Upload using Programmer" option.

Output:

FQBN: MegaCoreX-master:megaavr:808:pinout=28pin_standard
Using board '808' from platform in folder: C:\Users\ian.lisk\AppData\Local\Arduino15\packages\MegaCoreX-master\megaavr
Using core 'coreX-corefiles' from platform in folder: C:\Users\ian.lisk\AppData\Local\Arduino15\packages\MegaCoreX-master\megaavr

Detecting libraries used...
C:\Users\ian.lisk\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 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -mrelax -w -x c++ -E -CC -mmcu=atmega808 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_ATmega808 -DARDUINO_ARCH_MEGAAVR -IC:\Users\ian.lisk\AppData\Local\Arduino15\packages\MegaCoreX-master\megaavr\cores\coreX-corefiles/api/deprecated -IC:\Users\ian.lisk\AppData\Local\Arduino15\packages\MegaCoreX-master\megaavr\cores\coreX-corefiles -IC:\Users\ian.lisk\AppData\Local\Arduino15\packages\MegaCoreX-master\megaavr\variants\28pin-standard C:\Users\ian.lisk\AppData\Local\Temp\arduino\sketches\9B55C372C9F1F6B05B5C73A03EDD60EF\sketch\Blink.ino.cpp -o nul
Generating function prototypes...
C:\Users\ian.lisk\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 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -mrelax -w -x c++ -E -CC -mmcu=atmega808 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_ATmega808 -DARDUINO_ARCH_MEGAAVR -IC:\Users\ian.lisk\AppData\Local\Arduino15\packages\MegaCoreX-master\megaavr\cores\coreX-corefiles/api/deprecated -IC:\Users\ian.lisk\AppData\Local\Arduino15\packages\MegaCoreX-master\megaavr\cores\coreX-corefiles -IC:\Users\ian.lisk\AppData\Local\Arduino15\packages\MegaCoreX-master\megaavr\variants\28pin-standard C:\Users\ian.lisk\AppData\Local\Temp\arduino\sketches\9B55C372C9F1F6B05B5C73A03EDD60EF\sketch\Blink.ino.cpp -o C:\Users\ian.lisk\AppData\Local\Temp\3021378699\sketch_merged.cpp
C:\Users\ian.lisk\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\ian.lisk\AppData\Local\Temp\3021378699\sketch_merged.cpp
Compiling sketch...
"C:\\Users\\ian.lisk\\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 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mrelax -mmcu=atmega808 -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_ATmega808 -DARDUINO_ARCH_MEGAAVR "-IC:\\Users\\ian.lisk\\AppData\\Local\\Arduino15\\packages\\MegaCoreX-master\\megaavr\\cores\\coreX-corefiles/api/deprecated" "-IC:\\Users\\ian.lisk\\AppData\\Local\\Arduino15\\packages\\MegaCoreX-master\\megaavr\\cores\\coreX-corefiles" "-IC:\\Users\\ian.lisk\\AppData\\Local\\Arduino15\\packages\\MegaCoreX-master\\megaavr\\variants\\28pin-standard" "C:\\Users\\ian.lisk\\AppData\\Local\\Temp\\arduino\\sketches\\9B55C372C9F1F6B05B5C73A03EDD60EF\\sketch\\Blink.ino.cpp" -o "C:\\Users\\ian.lisk\\AppData\\Local\\Temp\\arduino\\sketches\\9B55C372C9F1F6B05B5C73A03EDD60EF\\sketch\\Blink.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core: C:\Users\ian.lisk\AppData\Local\Temp\arduino\cores\376c52e62d470a89ea55b8b417a5cfc9\core.a
Linking everything together...
"C:\\Users\\ian.lisk\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -mrelax -Wl,--gc-sections -Wl,--section-start=.text=0x0 -mmcu=atmega808 -o "C:\\Users\\ian.lisk\\AppData\\Local\\Temp\\arduino\\sketches\\9B55C372C9F1F6B05B5C73A03EDD60EF/Blink.ino.elf" "C:\\Users\\ian.lisk\\AppData\\Local\\Temp\\arduino\\sketches\\9B55C372C9F1F6B05B5C73A03EDD60EF\\sketch\\Blink.ino.cpp.o" "C:\\Users\\ian.lisk\\AppData\\Local\\Temp\\arduino\\sketches\\9B55C372C9F1F6B05B5C73A03EDD60EF/..\\..\\cores\\376c52e62d470a89ea55b8b417a5cfc9\\core.a" "-LC:\\Users\\ian.lisk\\AppData\\Local\\Temp\\arduino\\sketches\\9B55C372C9F1F6B05B5C73A03EDD60EF" -lm
"C:\\Users\\ian.lisk\\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\\ian.lisk\\AppData\\Local\\Temp\\arduino\\sketches\\9B55C372C9F1F6B05B5C73A03EDD60EF/Blink.ino.elf" "C:\\Users\\ian.lisk\\AppData\\Local\\Temp\\arduino\\sketches\\9B55C372C9F1F6B05B5C73A03EDD60EF/Blink.ino.eep"
"C:\\Users\\ian.lisk\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\ian.lisk\\AppData\\Local\\Temp\\arduino\\sketches\\9B55C372C9F1F6B05B5C73A03EDD60EF/Blink.ino.elf" "C:\\Users\\ian.lisk\\AppData\\Local\\Temp\\arduino\\sketches\\9B55C372C9F1F6B05B5C73A03EDD60EF/Blink.ino.hex"
cmd /C echo. && "C:\\Users\\ian.lisk\\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\\ian.lisk\\AppData\\Local\\Temp\\arduino\\sketches\\9B55C372C9F1F6B05B5C73A03EDD60EF/Blink.ino.elf" > "C:\\Users\\ian.lisk\\AppData\\Local\\Temp\\arduino\\sketches\\9B55C372C9F1F6B05B5C73A03EDD60EF/Blink.ino_atmega808_16000000L.lst"
 

"C:\\Users\\ian.lisk\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-size" -A "C:\\Users\\ian.lisk\\AppData\\Local\\Temp\\arduino\\sketches\\9B55C372C9F1F6B05B5C73A03EDD60EF/Blink.ino.elf"
Sketch uses 748 bytes (9%) of program storage space. Maximum is 8192 bytes.
Global variables use 4 bytes (0%) of dynamic memory, leaving 1020 bytes for local variables. Maximum is 1024 bytes.
"C:\Users\ian.lisk\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\ian.lisk\AppData\Local\Arduino15\packages\MegaCoreX-master\megaavr/avrdude.conf" -v -V -patmega808 -cjtag2updi -PCOM5 -Ufuses:w:0x00,0x54,0x01,0xff,0x00,0b11001001,0x06,0x00,0x00:m -Ulock:w:0xC5:m "-Uflash:w:C:\Users\ian.lisk\AppData\Local\Temp\arduino\sketches\9B55C372C9F1F6B05B5C73A03EDD60EF/Blink.ino.with_bootloader.hex:i"

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\ian.lisk\AppData\Local\Arduino15\packages\MegaCoreX-master\megaavr/avrdude.conf"
avrdude: error at C:\Users\ian.lisk\AppData\Local\Arduino15\packages\MegaCoreX-master\megaavr/avrdude.conf:402: syntax error
avrdude: error reading system wide configuration file "C:\Users\ian.lisk\AppData\Local\Arduino15\packages\MegaCoreX-master\megaavr/avrdude.conf"
Failed programming: uploading error: exit status 1

I'm completely stumped as to why this isn't working. In the meantime, I have ordered a USB-to-TTL converter, and am learning PlatformIO since it has the 808 built in. Maybe that will fix my problem, maybe not? Perhaps trying another chipset might work?

Remove the manually installed MegaCoreX, restart the Arduino IDE and install MegaCoreX using the Boards manager installer. Instructions here:
https://github.com/MCUdude/MegaCoreX#boards-manager-installation

The latest version of MegaCoreX requires Avrdude 7.1 or newer, and the absolute easiest way to fix this is through a boards manager install.

That means you're not even getting to the point where avrdude tries to connect to the AVR, and all of your hardware-level debugging is ... pointless.

Thanks for the help! Pasting the github links in the additional boards manager and selecting "install now" is all it took. Not sure how I've come this far without realizing avrdude is a live project you have to occasionally update. Case closed!

Looks like I spoke too soon. I finally got avrdude to initialize the ATmega808, but I think the chip is locking me out? jtagmkII_program_enable() is returning a warning: RSP_ILLEGAL_MCU_STATE. I know one of the 808s locked states requires an AVR-HV programmer which I don't have so I really hope it isn't that. Maybe the serial number of 00:00:00:00:00:00 has something to do with it? This is happening with all the bare chips I have. Very strange, I could've sworn I was able to upload a bare minimum sketch a few days ago but now its giving me this. Any ideas?

avrdude: Version 7.1-arduino.1
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is C:\Users\ian.lisk\AppData\Local\Arduino15\packages\MegaCoreX\hardware\megaavr\1.1.2\avrdude.conf

         Using Port                    : COM5
         Using Programmer              : jtag2updi
JTAG ICE mkII sign-on message:
Communications protocol version: 1
M_MCU:
  boot-loader FW version:        1
  firmware version:              6.00
  hardware version:              1
S_MCU:
  boot-loader FW version:        1
  firmware version:              6.00
  hardware version:              1
Serial number:                   00:00:00:00:00:00
Device ID:                       JTAGICE mkII
         AVR Part                      : ATmega808
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         Serial program mode           : yes
         Parallel program mode         : yes
         Memory Detail                 :

                                           Block Poll               Page                       Polled
           Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           fuse0       wdtcfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse1       bodcfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse2       osccfg      0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse4       tcd0cfg     0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse5       syscfg0     0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse6       syscfg1     0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse7       append      0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuse8       bootend     0     0     0    0 no          1    1      0     0     0 0x00 0x00
           fuses                   0     0     0    0 no          9   10      0     0     0 0x00 0x00
           lock                    0     0     0    0 no          1    1      0     0     0 0x00 0x00
           tempsense               0     0     0    0 no          2    1      0     0     0 0x00 0x00
           signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00
           prodsig                 0     0     0    0 no         61   61      0     0     0 0x00 0x00
           sernum                  0     0     0    0 no         10    1      0     0     0 0x00 0x00
           osccal16                0     0     0    0 no          2    1      0     0     0 0x00 0x00
           osccal20                0     0     0    0 no          2    1      0     0     0 0x00 0x00
           osc16err                0     0     0    0 no          2    1      0     0     0 0x00 0x00
           osc20err                0     0     0    0 no          2    1      0     0     0 0x00 0x00
           data                    0     0     0    0 no          0    1      0     0     0 0x00 0x00
           userrow     usersig     0     0     0    0 no         32   32      0     0     0 0x00 0x00
           eeprom                  0     0     0    0 no        256   32      0     0     0 0x00 0x00
           flash                   0     0     0    0 no       8192   64      0     0     0 0x00 0x00

         Programmer Type : JTAGMKII_UPDI
         Description     : JTAGv2 to UPDI bridge
         M_MCU HW version: 1
         M_MCU FW version: 6.00
         S_MCU HW version: 1
         S_MCU FW version: 6.00
         Serial number   : 00:00:00:00:00:00
         Vtarget         : 5.0 V

avrdude: AVR device initialized and ready to accept instructions
avrdude jtagmkII_program_enable() warning: bad response to enter progmode command: RSP_ILLEGAL_MCU_STATE
avrdude jtagmkII_program_enable() warning: bad response to enter progmode command: RSP_ILLEGAL_MCU_STATE
avrdude jtagmkII_read_byte() error: bad response to read memory command: RSP_ILLEGAL_MCU_STATE
avrdude avr_read_mem() error: unable to read byte at address 0x0000
avrdude avr_read_mem() error: read operation not supported for memory signature
avrdude avr_signature() error: unable to read signature data for part ATmega808, rc=-2
avrdude main() error: unable to read signature data, rc=-2
avrdude jtagmkII_program_disable() error: bad response to leave progmode command: RSP_ILLEGAL_MCU_STATE

avrdude done.  Thank you.

Failed programming: uploading error: exit status 1

The jtag2updi programmer may be unreliable at times. Build or buy yourself a SerialUPDI programmer instead. Less/simpler programmer hardware, faster, and better Avrdude integration.

Good idea. I've got the one you suggested on the way and in the meantime, I'll try building my own. Worst case I just have to wait for the dedicated one to arrive.

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