Author Topic: Debugger Power Control application  (Read 795 times)

0 Members and 2 Guests are viewing this topic.

Offline visenriTopic starter

  • Contributor
  • Posts: 30
  • Country: es
Debugger Power Control application
« on: June 03, 2026, 02:08:26 am »
I've just finished a little application for controlling the power supply voltage of Atmel / Microchip debugging tools.

It is very simple, but I find it very convenient, I just missed the power control I had with Pickit2 & Pickit3 in the newer debuggers.

Please post here if it works or not with your debugger (Indicate OS, python version and in case of errors, paste here the contents of the output log).

Let me also know any problems, or possible improvements.

It should work with:

  • PKOB nano (nEDBG) - on-board debugger on Curiosity Nano
  • MPLAB PICkit 4 In-Circuit Debugger (when in 'AVR mode')
  • MPLAB Snap In-Circuit Debugger (when in 'AVR mode')
  • Atmel-ICE
  • Power Debugger
  • EDBG - on-board debugger on Xplained Pro/Ultra
  • mEDBG - on-board debugger on Xplained Mini/Nano
  • JTAGICE3 (firmware version 3.0 or newer)



See more details and download it at github:
https://github.com/visenri/DebugPwrControl
« Last Edit: June 03, 2026, 02:13:18 am by visenri »
 

Offline visenriTopic starter

  • Contributor
  • Posts: 30
  • Country: es
Re: Debugger Power Control
« Reply #1 on: June 03, 2026, 02:11:39 am »
@Dave Jones
Feel free to test it and comment / rant about it in a video!!.
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1605
  • Country: de
    • Renate's Android Page
Re: Debugger Power Control application
« Reply #2 on: June 03, 2026, 03:32:39 am »
That's very interesting and it's helpful to be able to cycle the power sometimes.
I have an Atmel ICE programmer and that doesn't supply power at all, only senses it.

I learned some new AVR "housekeeping" commands from the file https://github.com/microchip-pic-avr-tools/pyedbglib/blob/main/pyedbglib/protocols/housekeepingprotocol.py
Do you know what the difference between HOUSEKEEPING_ANALOG_VTREF and HOUSEKEEPING_ANALOG_VTG_BUF is?
I've always just relied on the CMSIS DAP_Info command to get info strings.

I have a separate tiny USB power supply that plots.
It's helpful to watch devices boot up.
With control from a generic USB foot pedal I can cycle things quickly.

 

Offline visenriTopic starter

  • Contributor
  • Posts: 30
  • Country: es
Re: Debugger Power Control application
« Reply #3 on: June 03, 2026, 11:49:23 pm »
Do you know what the difference between HOUSEKEEPING_ANALOG_VTREF and HOUSEKEEPING_ANALOG_VTG_BUF is?
If you have a look at:
https://github.com/microchip-pic-avr-tools/pymcuprog/blob/main/pymcuprog/utils.py

You can notice that from the available analog voltages:
Code: [Select]
    HOUSEKEEPING_ANALOG_VTREF = 0x00  # Target voltage reference value
    HOUSEKEEPING_ANALOG_VTG_BUF = 0x01  # Bufferred target voltage reference
    HOUSEKEEPING_ANALOG_VUSB = 0x02  # USB voltage

It only uses:
Code: [Select]
HOUSEKEEPING_ANALOG_VTREF
HOUSEKEEPING_ANALOG_VUSB
In:
Code: [Select]
read_target_voltage(housekeeper)
read_usb_voltage(housekeeper)

Whose meaning is obvious, but no mention to the mysterious "Bufferred target voltage".

I digged a little bit in the source code of avr-dude, and the same problem there:
https://github.com/avrdudes/avrdude/blob/main/src/jtag3_private.h

Code: [Select]
#define PARM3_VTARGET           0x00 // Section 1, generic scope, 2 bytes, in millivolts
#define PARM3_VBUF              0x01 // Section 1, generic scope, 2 bytes, bufferred target voltage reference
#define PARM3_VUSB              0x02 // Section 1, generic scope, 2 bytes, USB voltage

Similar descriptions, but PARM3_VBUF is not used in any file in the whole source code.
 

Offline visenriTopic starter

  • Contributor
  • Posts: 30
  • Country: es
Re: Debugger Power Control application
« Reply #4 on: June 03, 2026, 11:52:45 pm »
I have an Atmel ICE programmer and that doesn't supply power at all, only senses it.
Please, let me know if my program detects your programmer and can at least read the voltages.
To trigger a read, just press the OFF button, even if it fails, it should read the available voltages and show the programmer tool info.
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1605
  • Country: de
    • Renate's Android Page
Re: Debugger Power Control application
« Reply #5 on: June 04, 2026, 03:14:07 am »
Fun with Python. |O
Code: [Select]
Traceback (most recent call last):
  File "E:\PyPwr\debuggerpwrcontrol.pyw", line 11, in <module>
    import tkinter as tk
ModuleNotFoundError: No module named 'tkinter'
Code: [Select]
C:\>pip install tkinter
ERROR: Could not find a version that satisfies the requirement tkinter (from versions: none)
ERROR: No matching distribution found for tkinter
Sorry, fighting with Python installs is my least favorite hobby.

This is my own (non-Python) utility:
Code: [Select]
C:\>atmelice stm32f411
524288 flash, 131072 ram
Atmel-ICE CMSIS-DAP J42700012345 V1.0 3.324V
DPIDR: 2ba01477
CPUID: 10006431
I've also found that the Atmel ICE sometimes (5%?) reads zero on the first poll of voltage.
I always do two queries.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf