Newbie to Arduino Using Power Debugger

Hi All,

I am using:
Version: 2.0.0-beta.7
Date: 2021-05-17T10:10:22.608Z
CLI Version: 0.18.3 alpha [d710b642]

I usually us Atmel Studio V7 with my Power Debugger and write in ASM. But I have a couple of projects coming up where C/++ Would make more sense (lower response times and more string work)

I have look a fair bit tonight and I can not see a way (or a post online describing) how to get the Power Debugger to work under Ardunio IDE. I am not after using the power debugging features just the UPDI programming.

TIA,

Regards,

Kat. :slight_smile:

Hi @geekgirl74. I'm not familiar with this tool. Would you mind posting a link to some information about it?

Are there specific microcontroller models that you are focusing on using?

Hi Pert,

Here is a link to the Atmel page on the tool :slight_smile:

Power Debugger.

I am using the ATtiny 1614 and the AVR128DA64 :slight_smile:

Regards,

Kat. :slight_smile:

The Power Debugger is a CMSIS-DAP compatible debugger

I think this is a good sign. I don't have a definite answer, but I will recommend you to try this:

  1. Install megaTinyCore by following the "Boards Manager Installation" instructions here: megaTinyCore/Installation.md at master · SpenceKonde/megaTinyCore · GitHub
  2. Select Tools > Board > megaTinyCore > ATtiny3224/1624/1614/1604/824/814/804/424/414/404/214/204 from the Arduino IDE's menus.
  3. Select the other appropriate settings for your microcontroller configuration from the custom menus under the Arduino IDE's Tools menu which are added by megaTinyCore (information here).
  4. Select File > Preferences from the Arduino IDE's menus.
  5. Check the checkbox next to Show verbose output during: upload.
  6. Click the OK button.
  7. Select a promising candidate from the Arduino IDE's Tools > Programmer menu. I think the Atmel-ICE (UPDI) and EDBG options are the most likely to be the ones. I am more doubtful that the SerialUPDI or jtag2updi options would be compatible with the Power Debugger.
  8. Select Sketch > Upload Using Programmer from the Arduino IDE's menus. Or if you want to set the configuration fuses on the ATtiny1614, you can instead do Tools > Burn Bootloader. Either process will provide a good check of whether the programmer is working correctly.
  9. Watch the black console pane at the bottom of the Arduino IDE window to see the output from the upload or burn bootloader process. If it is successful, then I think you have good proof that the currently Tools > Programmer menu selection is the right one. If not, then select another item from that menu and try the upload or burn bootloader process again.

As for the AVR128DA64, you can repeat the same process, but this time using DxCore:

You won't need to play the guessing game with the programmers again though. It has the same list of programmers as megaTinyCore, so if you find the right one for use with megaTinyCore, you can select that same programmer name from the IDE's Tools > Programmer menu and it will work just as well for the AVR128DA64.

Hi Pert,

I have tried them all with com3 which is the com port the debugger is on, it complains about not finding the right pid and vid :frowning:

I bit the bullet today and bought an ATATMEL-ICE It will arrive Tuesday as Monday is a public holiday (It should be in my state tomorrow I may phone the courier company and see if I can shoot out and pick it up as one of the packages has some fets I am waiting on for this project lol)

TIA,

Kat. :slight_smile:

I will look more into it tomorrow as it is 1923 here right now and I did not get much sleep last night.

If anyone knows how to add a programmer to Arduino that already exists in AVR-Dude could they post a link as I found the Power Debugger is in the conf file failing that I might make a temp change to the avrdude conf file and make the PID for the ATATMEL-ICE the PID for the Power Debugger and see if that works, if it does it is just a mater of adding the programmer to the ARDUINO IDE :slight_smile:

TIA,

Regards,

Kat. :slight_smile:

I'm sorry to hear it wasn't recognized. Even though I see the Power Debugger has a CDC virtual COM interface, I expect the programmer/debug probe functionality to be provided as a pure USB device, not via the virtual serial port. So I would not expect the port selection to matter. But I'm not familiar with this tool, so I could be wrong.

The documentation is here:
https://arduino.github.io/arduino-cli/latest/platform-specification/#programmerstxt

This is done on a per-boards platform basis. So it's not a matter of adding the programmer to the IDE directly. It's a matter of adding the programmer definition to the platform of the board you have selected from the Arduino IDE's Tools > Board menu (e.g., megaTinyCore, DxCore). You would need to add it to each of the platforms of the boards you want to use the Power Debugger with as a programmer.

I can see the AVRDUDE configuration here:

This uses the same jtagice3_updiprotocol as those platforms' "Atmel-ICE (UPDI mode)" programmer:

It's not clear to me why it wouldn't work with that programmer, but it does indicate that adding a specific programmer definition for it will be a straightforward project.

Hi Pert,

Between this post and another I now have the problem solved, I will pull a copy of SpenceKonde's projects and add support for the power debugger updi mode to them. :slight_smile:

The solution incase anyone else needs it before I can complete this change and it get approved :slight_smile:

Edit:
C:\Users(YOURUSER)\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.3.2\programmers.txt

Add the following:

powerdebugger_updi.name=Atmel PowerDebugger (UPDI)
powerdebugger_updi.communication=usb
powerdebugger_updi.protocol=powerdebugger_updi
powerdebugger_updi.program.protocol=powerdebugger_updi
powerdebugger_updi.program.tool=avrdude
powerdebugger_updi.program.extra_params=-Pusb

Save the file then do the following:

After the above steps are completed the programmer is now listed and will work :wink:

Regards,

Kat. :slight_smile:

1 Like

I'm very glad to hear that!

Thanks for making the effort to share your advancements back to the community.

Oops, I forgot about that trickiness about Arduino IDE 2.x and programmers. I'm glad you found that. I did report it to the Arduino IDE developers, but they haven't had time to work on it yet.

1 Like

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