Microchip Technology Power Debugger Manual page 13

Table of Contents

Advertisement

Take extreme care when writing fuses on the target device. Modifying the wrong fuse can result in the
CAUTION
Xplained Mini kit being permanently unusable.
3.1.5
Disabling On-board Power Supply on the Xplained Mini
The mEDBG debugger on the Xplained Mini board has control of the target device's V
power. By opening the switch the user can reroute power to the target device through an external current measuring
probe. By default on power-up the switch is closed (power is ON).
To open the switch, use the Atmel Studio command line utility atprogram.exe.
atprogram.exe -t medbg parameters -psoff
Important:  The clock source from the mEDBG to the target device will remain active, so the target device
may be partially powered through I/O leakage.
To close the switch again, execute:
atprogram.exe -t medbg parameters -pson
Tip:  Older mEDBG firmware does not support power-on requests. In that case, toggle the USB power to
restore the target power.
3.1.6
Starting with Simple Current Measurements
Lets start by writing an application to Flash the LED on the Xplained Mini board. We will use a delay loop with a NOP
instruction inside a large counter and pulse the LED with about a 1% duty cycle. The code for low_power_101 is
shown here.
#include <avr/io.h>
void
delay
(uint16_t
{
// Simple delay loop
for (uint16_t
for (uint8_t
asm volatile("nop");
}
}
}
int
main(void)
{
// PORTB5 to output
DDRB = (1 << 5);
// Do forever:
while
(1) {
// PORTB5 on
PORTB = (1 << 5);
// Short delay
delay(50);
// PORB5 off
PORTB = 0x00;
// Long delay
delay(5000);
©
2020 Microchip Technology Inc.
length)
i=0; i<length; i++) {
j=0; j<255; j++) {
User Guide
Power Debugger
Detailed Use Cases
so that it can toggle its
CC
DS40002201A-page 13

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Power Debugger and is the answer not in the manual?

Table of Contents