background image

Tip: 

Be sure to check the “use external reset” checkbox in both the programming dialog and debug options
dialog in Atmel Studio in order to allow the Power Debugger to assert the RESET line and re-enable the
JTAG interface on devices which are running code which disables the JTAG interface by setting the JTAG
disable bit.

IDR/OCDR Events

The IDR (In-out Data Register) is also known as the OCDR (On-Chip Debug Register), and is used extensively by the
debugger to read and write information to the MCU when in Stopped mode during a debug session. When the
application program in Run mode writes a byte of data to the OCDR register of the AVR device being debugged, the
Power Debugger reads this value out and displays it in the message window of the software front-end. The OCDR
register is polled every 50ms, so writing to it at a higher frequency will NOT yield reliable results. When the AVR
device loses power while it is being debugged, spurious OCDR events may be reported. This happens because the
Power Debugger may still poll the device as the target voltage drops below the AVR’s minimum operating voltage.

4.4.13 

AVR XMEGA Special Considerations

OCD and Clocking

When the MCU enters Stopped mode, the OCD clock is used as MCU clock. The OCD clock is either the JTAG TCK
if the JTAG interface is being used, or the PDI_CLK if the PDI interface is being used.

I/O Modules in Stopped Mode

In contrast to earlier Microchip megaAVR devices, in XMEGA the I/O modules are stopped in Stop mode. This means
that USART transmissions will be interrupted, timers (and PWM) will be stopped.

Hardware Breakpoints

There are four hardware breakpoint comparators - two address comparators and two value comparators. They have
certain restrictions:

• All breakpoints must be of the same type (program or data)
• All data breakpoints must be in the same memory area (I/O, SRAM, or XRAM)
• There can only be one breakpoint if address range is used

Here are the different combinations that can be set:

• Two single data or program address breakpoints
• One data or program address range breakpoint
• Two single data address breakpoints with single value compare
• One data breakpoint with address range, value range, or both

MPLAB X IDE and Atmel Studio will tell you if the breakpoint cannot be set, and why. Data breakpoints have priority
over program breakpoints, if software breakpoints are available.

External Reset and PDI Physical

The PDI physical interface uses the Reset line as clock. While debugging, the Reset pull-up should be 10k or more or
be removed. Any Reset capacitors should be removed. Other external Reset sources should be disconnected.

JTAGEN Fuse

The JTAG interface is enabled using the JTAGEN fuse, which is programmed by default. This allows access to the
JTAG programming interface.

 Power Debugger

On-chip Debugging

©

 2020 Microchip Technology Inc.

 User Guide

DS40002201A-page 72

Summary of Contents for Power Debugger

Page 1: ...wer Debugger also includes a CDC virtual COM port interface as well as Microchip Data Gateway Interface channels for streaming application data to the host computer from a SPI USART TWI or GPIO source The Power Debugger is a CMSIS DAP compatible debugger which works with MPLAB X IDE Atmel Studio 7 0 or other front end software capable of connecting to a generic CMSIS DAP unit The Power Debugger st...

Page 2: ... Power Debugger unit with plastic back plate Two USB cables 1 5m high speed Micro B One adapter board containing 50 mil AVR 100 mil AVR SAM and 100 mil 20 pin SAM adapters One IDC flat cable with 10 pin 50 mil connector and 6 pin 100 mil connector One 50 mil 10 pin mini squid cable with 10 x 100 mil sockets 20 x 100 mil separable strap cables Figure 1 Power Debugger Kit Contents Power Debugger 202...

Page 3: ...escription 77 5 1 Overview 77 5 2 Programming and Debugging 78 5 3 Analog Hardware 78 5 4 Target Voltage Supply VOUT 79 5 5 Data Gateway Interface 79 5 6 CDC Interface 80 5 7 USB Connectors 80 5 8 LEDs 83 6 Product Compliance 84 6 1 RoHS and WEEE 84 6 2 CE and FCC 84 7 Firmware Release History and Known Issues 85 7 1 Firmware Release History 85 7 2 Known Issues 85 8 Revision History 86 The Microch...

Page 4: ...Quality Management System 88 Worldwide Sales and Service 89 Power Debugger 2020 Microchip Technology Inc User Guide DS40002201A page 4 ...

Page 5: ...th the Power Debugger is simple especially if one is familiar with the Atmel ICE programmer and debugger or any of the Microchip Xplained Pro kits Power Debugger Getting Started with the Power Debugger 2020 Microchip Technology Inc User Guide DS40002201A page 5 ...

Page 6: ...and easy introduction to Power Debugging select the use case which closest matches your current project or available boards The Hardware Description section provides technical details of the capabilities of the Power Debugger for users who prefer to get started with custom boards Related Links 5 Hardware Description Power Debugger Getting Started with the Power Debugger 2020 Microchip Technology I...

Page 7: ...red ground is essential A and B Channel Current Measurement Ports Depicted with ammeter symbols on the silkscreen these two measurement channels are to be connected in a high side configuration This means that the voltage supply is connected to the input of the ammeter and the load target is connected to the output Info The grouping of the A and B channel input and output signals with respect to t...

Page 8: ...e marks pin 1 of the 10 pin 50 mil connector Pin 1 of the 6 pin 100 mil connector is placed to the right of the keying when the connector is seen from the cable Pin 1 of each connector on the adapter is marked with a white dot The figure below shows the pinout of the debug cable The connector marked A plugs into the debugger while the B side plugs into the target board Figure 2 2 Debug Cable Pinou...

Page 9: ...terface Important The Data Visualizer used in this use case should not be confused with the MPLAB Data Visualizer These two applications have a similar feature set and the Power Debugger also works with the MPLAB Data Visualizer but the user interface is totally different The Data Visualizer referred to in this use case was originally named Atmel Data Visualizer The example makes use of the ATmega...

Page 10: ...Mini board We will make use of code instrumentation to send data from the Xplained Mini board to the Power Debugger DGI To do this we need access to PORTD features on the target MCU To do Mount PORTD 0 7 header on the Xplained Mini board Although the ATmega328PB Xplained Mini board already contains a debugger mEDBG it is not going to be used in this example Instead we would rather make use of the ...

Page 11: ... ATmega328PB device s supply rail To do Connect the 5V pin on the power header of the Xplained Mini board to the input pin of the A channel on the Power Debugger Connect the output pin of the A channel to the VCC pin of the power header on the Xplained Mini Connect the USB and programming cables To do Connect the debug cable from the AVR output of the Power Debugger to the ISP header of the Xplain...

Page 12: ...tmel Studio command line programming utility atprogram exe atprogram exe t powerdebugger i debugwire d atmega328pb dwdisable and then using ISP to clear DWEN either in the Atmel Studio programming dialog or using atprogram exe Read the high fuse offset 1 atprogram exe t powerdebugger i isp d atmega328pb read fs s 1 o 1 format hex OR the output value with 0x40 DWEN is bit 6 Write the value back to ...

Page 13: ...arget 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...

Page 14: ... AVR GNU C Compiler Optimization To do Build the project solution F7 To do Program the application into the target by selecting Start Without Debugging Ctrl Alt F5 LED0 on the mEDBG kit should now start to blink Power Debugger Detailed Use Cases 2020 Microchip Technology Inc User Guide DS40002201A page 14 ...

Page 15: ...and can be run either as a Studio extension or in Stand Alone mode To run the Data Visualizer as an extension inside Atmel Studio select it in the Tools menu Kits supporting Data Visualizer functionality include a shortcut to the extension on their start page in Atmel Studio If the stand alone version of the Data Visualizer has been installed look for the shortcut in the Windows start menu The sta...

Page 16: ...to the DGI on the selected tool To do Enable the Power interface and modify its settings to monitor the relevant channels Power Debugger Detailed Use Cases 2020 Microchip Technology Inc User Guide DS40002201A page 16 ...

Page 17: ...ve you a plot similar to this one What can we see from this plot The kit draws about 17 mA with the LED OFF Current draw increases to about 20 mA when the LED is pulsed ON The 1 duty cycle seems approximately correct Power Debugger Detailed Use Cases 2020 Microchip Technology Inc User Guide DS40002201A page 17 ...

Page 18: ...ike this does not need to run at high speed so we can use the clock prescaler to run slower The code below is included in project low_power_102 include avr io h include avr interrupt h Timer 0 ISR ISR TIMER0_OVF_vect if PORTB 0x00 LED is OFF turn it on PORTB 1 5 Shortened timeout for on cycle TCNT0 0x102 else LED is ON turn it off PORTB 0x00 int main void Change the clock prescaler CLKPR 1 CLKPCE ...

Page 19: ...ute Leaving the application to run for a few seconds should give you a plot similar to this one What can we see from this plot The kit now draws about 6 mA with the LED OFF Current draw increases to about 9 mA when the LED is pulsed ON The 1 duty cycle still seems approximately correct Result Power consumption has been significantly improved by clocking the device slower Power Debugger Detailed Us...

Page 20: ...nt main void Disable digital input buffer on ADC pins DIDR0 1 ADC5D 1 ADC4D 1 ADC3D 1 ADC2D 1 ADC1D 1 ADC0D Disable digital input buffer on Analog comparator pins DIDR1 1 AIN1D 1 AIN0D Disable Analog Comparator interrupt ACSR 1 ACIE Disable Analog Comparator ACSR 1 ACD Disable unused peripherals to save power Disable ADC ADC must be disabled before shutdown ADCSRA 1 ADEN Shut down the ADC power_ad...

Page 21: ...an 32 kHz to be below 1 4 of the main clock Important Remember to disable on board power on the Xplained Mini What can we see from this plot The kit now draws less than 1 mA with the LED OFF Current draw increases to about 7 mA when the LED is pulsed ON The 1 duty cycle still seems approximately correct Result Power consumption has again been improved by using Sleep mode and disabling unused perip...

Page 22: ... 1 ADC5D 1 ADC4D 1 ADC3D 1 ADC2D 1 ADC1D 1 ADC0D Disable digital input buffer on Analog comparator pins DIDR1 1 AIN1D 1 AIN0D Disable Analog Comparator interrupt ACSR 1 ACIE Disable Analog Comparator ACSR 1 ACD Disable unused peripherals to save power Disable ADC ADC must be disabled before shutdown ADCSRA 1 ADEN Shut down the ADC power_adc_disable Disable SPI power_spi_disable Disable TWI power_t...

Page 23: ...uild the project solution F7 Program the application into the target device using Start Without Debugging Ctrl Alt F5 Switch to Data Visualizer to see the results Important Because the previous example prescaled the clock to 8 MHz 64 the ISP programming clock must be set to less than 32 kHz to be below 1 4 of the main clock Important Remember to disable on board power on the Xplained Mini Power De...

Page 24: ...ore enabling the cursors or else the graph view will rapidly scroll away from the cursors In the plot above we use two cursors to first check the delta confirming that the Watchdog Timer interrupts approximately every second as expected Zooming further in we can see that the width of the on pulse shown as Cursor Delta is a little over 33 ms This equates to a duty cycle of 3 3 a touch higher than i...

Page 25: ...he Power Debugger has a full Data Gateway Interface DGI port for streaming data from the target to the host computer We will hook this up to the USART for simple console output Some hardware wiring needs to be done to link the USART We use Synchronous mode for convenience in baud rate setting PD1 TXD of the Xplained Mini is connected to USART of the DGI header PD4 XCK of the Xplained Mini is conne...

Page 26: ...ep h volatile uint8_t led_on volatile uint8_t send_message volatile uint8_t ticker 0 const char message_on LED ON const char message_off LED OFF ISR PCINT0_vect Each botton press generates two pin change interrupt press release Ignore half of these if PINB 1 7 return Update LED if led_on PORTB 1 5 else PORTB 1 5 Invert led_on led_on led_on Flag a message send send_message 1 Increment ticker ticker...

Page 27: ...end_message Send a message const char pmessage if led_on pmessage message_on else pmessage message_off while pmessage usart_send pmessage Send the ticker value usart_send ticker 0 usart_send n Sent send_message 0 To do Build the project solution F7 Program the application into the target device using Start Without Debugging Ctrl Alt F5 Switch to Data Visualizer to see the results 3 1 13 1 Enable U...

Page 28: ...ace to Terminal To do Open the configuration panel Add a Terminal view to the Visualizer Drag the source connector from the interface in the DGI Control Panel into the sink for the Terminal to make a connection Power Debugger Detailed Use Cases 2020 Microchip Technology Inc User Guide DS40002201A page 28 ...

Page 29: ...target device on the board The SAM L22 kit could also be used Important The Data Visualizer used in this use case should not be confused with the MPLAB Data Visualizer These two applications have a similar feature set and the Power Debugger also works with the MPLAB Data Visualizer but the user interface is totally different The Data Visualizer referred to in this use case was originally named Atm...

Page 30: ...p cable This enables us to measure the total current drawn by the target Connect the output of the B channel to the POWER input of the USB type A jack This is simply done by using a jumper Connect a USB cable from the type A jack to the TARGET USB micro jack To measure the current drawn by the target MCU the Xplained PRO board has a power 2 pin header next to the TARGET USB connector Usually a jum...

Page 31: ...though the Xplained PRO has debug capability we will use the Power Debugger for this purpose To do Connect the 10 pin debug cable from the SAM header of the Power Debugger to the CORTEX DEBUG header of the Xplained PRO To connect all this to the host computer To do Connect a USB cable from the DEBUG connector of the Power Debugger to the host computer Connect a USB cable from the TARGET connector ...

Page 32: ...ways Important VOUT setting is stored in volatile memory on the Power Debugger Toggling power on the tool will result in VOUT being disconnected This is done to protect the user s hardware 3 2 4 1 Setting VOUT Using the Programming Dialog VOUT can be set and read back using the programming dialog in Atmel Studio This is done using the Tool settings tab which is available when using the Power Debug...

Page 33: ... sampled and read back using atprogram exe t powerdebugger parameters tsout The VOUT set point can be read back using atprogram exe t powerdebugger parameters tssp 3 2 4 3 Setting VOUT Using Data Visualizer VOUT can be set using Data Visualizer by opening the configuration for the Power interface Power Debugger Detailed Use Cases 2020 Microchip Technology Inc User Guide DS40002201A page 33 ...

Page 34: ... Studio create a New Example Project In the New Example dialog select the SAM L21 device family or other relevant device and filter by the keyword MSC Select the USB Device MSC Example Build the project solution F7 To do Open the project properties right click the project in the Solution Explorer and select Properties On the Tool tab select the appropriate tool and interface To do Program the appl...

Page 35: ...he Tools menu Kits supporting Data Visualizer functionality include a shortcut to the extension on their start page in Atmel Studio If the stand alone version of the Data Visualizer has been installed look for the shortcut in the Windows start menu The stand alone version is available for download from gallery microchip com 3 2 7 Two Channel Measurement When using hardware with two measurement cha...

Page 36: ... offset the Y axis Drag the scales on the left and right to move respective channels in the Y axis offset Ctrl scroll on the respective axis scale to zoom that channel Right click and drag to select an area to zoom 3 2 9 Mass Storage Example To do Program the Mass Storage Class example into the target device using Start Without Debugging Ctrl Alt F5 Stop Data Visualizer after capturing a plot With...

Page 37: ...f much higher current consumption on both board and MCU channels as shown here 3 2 10 GPIO Instrumentation Pin toggling is often a simple and useful mechanism for debugging applications We will now add some simple instrumentation to profile the read and write cycles of the Mass Storage device To do Find the implementation of the ui_start_read function in the file ui c This can be easily done by op...

Page 38: ...nit void GPIO0 to output port_pin_set_config EXT1_PIN_GPIO_0 pin_conf GPIO1 to output port_pin_set_config EXT1_PIN_GPIO_1 pin_conf You can also comment out the LED toggle as it is not relevant here void ui_process uint16_t framenumber if 0 framenumber LED_On LED_0_PIN if 1000 framenumber LED_Off LED_0_PIN To do Build the project solution F7 Program the application into the target device using Star...

Page 39: ...Stop condition Since this is a fully compliant disk drive try a few other operations and see how the read and write access events are affected Create a new text file Add content using notepad Save the file Re open the file Delete the file Tip Read caching by the operating system might cause read access not to be executed until the cache is flushed after a write 3 2 11 Code Correlation We will now ...

Page 40: ...erface and Code Profiling interface in DGI Control Panel To do Open the Code Profiling Configuration dialog by clicking the Gear button on the Code Profiling interface Select Enable Code Location 3 2 11 2 Run Important Code correlation is only available when Data Visualizer is run as an extension within Atmel Studio This is because it needs access to symbolic information only available when the de...

Page 41: ...t device The relative grouping of samples shows us execution of different functions Patterns can easily be seen using this technique Notice how the format activity as seen by GPIO activity has a different distribution of Program Counter values compared to the parts with no GPIO activity Hovering over one of the samples shows the location of that sample in the Code Location Details box below the gr...

Page 42: ...pulse waking the CPU briefly The interrupt is executed too quickly to be caught on all executions The larger current spikes are often associated with another USB function csw_send receive Double clicking on one of the Program Counter samples will open the editor and highlight the line corresponding to that sample Power Debugger Detailed Use Cases 2020 Microchip Technology Inc User Guide DS40002201...

Page 43: ...hical form Important Data polling is only available when Data Visualizer is run as an extension within Atmel Studio This is because it needs to access the debug system on the device through the Atmel Studio debugger backend First add a few lines of code containing variables to poll To do Open ui c and add two global variables to the top of the file volatile uint32_t write_count 0 volatile uint32_t...

Page 44: ...ify the two startʼ functions in ui c to increment read and write counters on each access started void ui_start_read void port_pin_set_output_level EXT1_PIN_GPIO_0 true read_count void ui_start_write void port_pin_set_output_level EXT1_PIN_GPIO_1 true write_count To do Build the project solution F7 Open Data Visualizer Connect For data polling functionality enable the Code Profiling interface To do...

Page 45: ... 1 Open Code Profiling Configuration Dialog To do Enable the Code Profiling interface by deselecting the check box for the Code Profiling interface in the DGI Control Panel To do Open the Code Profiling Configuration window by pushing the Gear button 3 2 12 2 Add Data Polling Locations To do Click the Add Memory Location button for each memory location to be added Fill in the address and format of...

Page 46: ...with one y axis configured However there are two unrelated variables to monitor therefore two axes are needed To do Click the Add axis button to add an additional axis There are now sources variables and sinks axes to be connected together To do Drag each of the source plugs on the Code Profiling interface into the New plot sink jack of each axis Power Debugger Detailed Use Cases 2020 Microchip Te...

Page 47: ... too long To remedy this simply reset execution in Atmel Studio Look at the output in the graph in Data Visualizer Format the disk and watch how the write cycles counter increments Both values are plotted on independent axes so they can be scaled accordingly The output should look something like this Power Debugger Detailed Use Cases 2020 Microchip Technology Inc User Guide DS40002201A page 47 ...

Page 48: ...he ui_process handler as shown here volatile uint32_t frame_comparator 100 volatile uint32_t frames_received 0 void ui_process uint16_t framenumber frames_received if frames_received frame_comparator LED_Toggle LED_0_PIN frames_received 0 To do Build the project solution F7 Launch a debug session using Start Debugging and Break Alt F5 Find the location of the variable uint32_t frame_comparator To ...

Page 49: ...ion panel Add a new I O Dashboard component by double clicking the I O Dashboard module 3 2 13 2 Configure Dashboard A slider control can now be added to the dashboard To do Select the Edit checkbox Open the Elements tab Drag a Slider element onto the dashboard Power Debugger Detailed Use Cases 2020 Microchip Technology Inc User Guide DS40002201A page 49 ...

Page 50: ...et its properties Maximum 500 Minimum 100 A segment display control can now be added to the dashboard To do Select the Edit checkbox Open the Elements tab Drag a Segment Display element onto the dashboard Power Debugger Detailed Use Cases 2020 Microchip Technology Inc User Guide DS40002201A page 50 ...

Page 51: ...y can similarly be used as a sink to connect any relevant source to The Code Profiling data polling interface provides both a source of data and a sink of data The slider can now be connected to the sink and the segment display to the source To do Deselect the Edit checkbox Select the Show Endpoints checkbox Connect sources to sinks by dragging each source plug and drop it on a sink Power Debugger...

Page 52: ... The slider is now in control of the frame_comparator variable in the application code Drag the slider and notice that the LED blink frequency changes Any change in the slider position will be sent to the target device through the debug interface and a new value stored in the variable At the same time the value is also read back from the target and displayed on the segment display Power Debugger D...

Page 53: ...rdware breakpoints require dedicated hardware on the OCD module the number of breakpoints available depends upon the size of the OCD module implemented on the target Usually one such hardware comparator is reserved by the debugger for internal use Software Breakpoints A software breakpoint is a BREAK instruction placed in program memory on the target device When this instruction is loaded program ...

Page 54: ... transmitted from the Power Debugger into the target device TDO 6 Test Data Out data transmitted from the target device into the Power Debugger nRESET 10 Reset optional Used to reset the target device Connecting this pin is recommended since it allows the Power Debugger to hold the target device in a Reset state which can be essential to debugging in certain scenarios VTG 1 Target voltage referenc...

Page 55: ...vices that the TDI signal has to pass through in the daisy chain before reaching the target device Similarly devices after is the number of devices that the signal has to pass through after the target device before reaching the Power Debugger TDO pin Instruction bits before and after refers to the total sum of all JTAG devices instruction register lengths which are connected before and after the t...

Page 56: ...rtant The JTAGICE3 100 mil adapter cannot be used with the SAM connector port since pins 2 and 10 AVR GND on the adapter are connected Connection to a Custom 100 mil Header If your target board does not have a compliant 10 pin JTAG header in 50 or 100 mil you can map to a custom pinout using the 10 pin mini squid cable included in some kits which gives access to ten individual 100 mil sockets Conn...

Page 57: ...technically be used The ARM JTAG and AVR JTAG connectors are however not pin compatible so this depends upon the layout of the target board in use When using an STK600 or a board making use of the AVR JTAG pinout the AVR connector port on the Power Debugger must be used When connecting to a board which makes use of the ARM JTAG pinout the SAM connector port on the Power Debugger must be used The r...

Page 58: ...ata sheet for supported interfaces of that device 4 3 1 AVR UC3 On Chip Debug System The Microchip AVR UC3 OCD system is designed in accordance with the Nexus 2 0 standard IEEE ISTO 5001 2003 which is a highly flexible and powerful open on chip debug standard for 32 bit microcontrollers It supports the following features Nexus compliant debug solution OCD supports any CPU speed Six Program Counter...

Page 59: ...bugger into the target device TDO 3 Test Data Out data transmitted from the target device into the Power Debugger nTRST 8 Test Reset optional only on some AVR devices Used to reset the JTAG TAP controller nSRST 6 Reset optional Used to reset the target device Connecting this pin is recommended since it allows the Power Debugger to hold the target device in a Reset state which can be essential to d...

Page 60: ...vices that the TDI signal has to pass through in the daisy chain before reaching the target device Similarly devices after is the number of devices that the signal has to pass through after the target device before reaching the Power Debugger TDO pin Instruction bits before and after refers to the total sum of all JTAG devices instruction register lengths which are connected before and after the t...

Page 61: ...rtant The JTAGICE3 100 mil adapter cannot be used with the SAM connector port since pins 2 and 10 AVR GND on the adapter are connected Connection to a Custom 100 mil Header If your target board does not have a compliant 10 pin JTAG header in 50 or 100 mil you can map to a custom pinout using the 10 pin mini squid cable included in some kits which gives access to ten individual 100 mil sockets Conn...

Page 62: ...ramming and debugging interface All features of the OCD system available through the 10 pin JTAG interface can also be accessed using aWire 4 3 5 Connecting to an aWire Target The aWire interface requires only one data line in addition to VCC and GND On the target this line is the nRESET line although the debugger uses the JTAG TDO line as the data line The recommended pinout for the 6 pin aWire c...

Page 63: ...r powers both the core and most of the I O Only Microchip AVR ONE debugger supports debugging while using sleep modes where this regulator is shut off 4 3 7 EVTI EVTO Usage The EVTI and EVTO pins are not accessible on the Power Debugger However they can still be used in conjunction with other external equipment EVTI can be used for the following purposes The target can be forced to stop execution ...

Page 64: ...ich is used for programming and debugging Table 4 9 Programming and Debugging Interfaces Summary UPDI TPI SPI debugWIRE JTAG PDI aWire SWD tinyAVR New devices Some devices Some devices Some devices megaAVR All devices Some devices Some devices AVR XMEGA Some devices All devices AVR UC All devices Some devices SAM Some devices All devices 4 4 1 JTAG Physical Interface The JTAG interface consists of...

Page 65: ...rd does not have a compliant 10 pin JTAG header in 50 or 100 mil you can map to a custom pinout using the 10 pin mini squid cable included in some kits which gives access to ten individual 100 mil sockets Connection to a 20 pin 100 mil Header Use the adapter board included in some kits to connect to targets with a 20 pin 100 mil header Table 4 10 Power Debugger JTAG Pin Description Name AVR PORT P...

Page 66: ...ections are required as described in the table below Important The SPI interface is effectively disabled when the debugWIRE enable fuse DWEN is programmed even if SPIEN fuse is also programmed To re enable the SPI interface the disable debugWIRE command must be issued while in a debugWIRE debugging session Disabling debugWIRE in this manner requires that the SPIEN fuse is already programmed If MPL...

Page 67: ...se the 6 pin 100 mil tap on the flat cable included in some kits to connect to a standard 100 mil PDI header Connection to a 6 pin 50 mil PDI Header Use the adapter board included in some kits to connect to a standard 50 mil PDI header Connection to a Custom 100 mil Header The 10 pin mini squid cable should be used to connect between the Power Debugger AVR connector port and the target board Four ...

Page 68: ...sage 00 GPIO General purpose I O pin In order to access UPDI a 12V pulse must be applied to this pin No external Reset source is available 01 UPDI Dedicated programming and debugging pin No external Reset source is available 10 Reset Reset signal input In order to access UPDI a 12V pulse must be applied to this pin 11 Reserved NA Note Older AVR devices have a programming interface known as High Vo...

Page 69: ...I 9 Pin 10 GND 0 4 4 9 TPI Physical Interface TPI is a programming only interface for some tinyAVR devices It is not a debugging interface and these devices do not have OCD capability When designing an application PCB which includes an AVR with the TPI interface the pinout shown in the figure below should be used Figure 4 13 TPI Header Pinout TPIDATA TPICLK RESET VCC GND 1 2 TPI NC 4 4 10 Connecti...

Page 70: ...MP PINB When running this code normally the TEMP register would not read back 0xAA because the data would not yet have been latched physically to the pin by the time it is sampled by the IN operation A NOP instruction must be placed between the OUT and the IN instruction to ensure that the correct value is present in the PIN register However when single stepping this function through the OCD this ...

Page 71: ...d not the actual clock frequency being used When using the internal RC oscillator be aware that the frequency may vary from device to device and is affected by temperature and VCC changes Be conservative when specifying the target clock frequency OCDEN Fuse To be able to debug a megaAVR device the OCDEN fuse must be programmed by default OCDEN is unprogrammed This allows access to the OCD in order...

Page 72: ... if the PDI interface is being used I O Modules in Stopped Mode In contrast to earlier Microchip megaAVR devices in XMEGA the I O modules are stopped in Stop mode This means that USART transmissions will be interrupted timers and PWM will be stopped Hardware Breakpoints There are four hardware breakpoint comparators two address comparators and two value comparators They have certain restrictions A...

Page 73: ... are two work arounds to re enable OCD Go into the Power Debugger Options in the Tools menu and enable Always activate external Reset when reprogramming device Perform a chip erase The sleep modes that trigger this bug are Power Down Power Save Standby Extended Standby 4 4 14 debugWIRE Special Considerations The debugWIRE communication pin dW is physically located on the same pin as the external R...

Page 74: ...ect operation of the interface All external Reset sources or other active drivers on the RESET line must be disconnected since they may interfere with the correct operation of the interface Never program the lock bits on the target device The debugWIRE interface requires that lock bits are cleared in order to function correctly 4 4 15 debugWIRE Software Breakpoints The debugWIRE OCD is drastically...

Page 75: ...et DWEN fuse using SPI Intermediate state 1 Fuse DWEN set Fuse SPIEN set NB Module debugWIRE disabled until power toggle You can Toggle power DWEN SPIEN Default state Fuse DWEN cleared Fuse SPIEN set Module debugWIRE disabled You can Access flash and fuses using SPI DWEN SPIEN Debug state Fuse DWEN set Fuse SPIEN set Module debugWIRE enabled You can use debugWIRE You cannot Access fuses or flash u...

Page 76: ...AN fuses when chip erasing a device in this state When designing a target application PCB where UPDI interface will be used the following considerations must be made for correct operation Pull up resistors on the UPDI line must not be smaller stronger than 10kΩ A pull down resistor should not be used or it should be removed when using UPDI The UPDI physical is push pull capable so only a weak pull...

Page 77: ...VR UC3A3 SDRAM 3 3V PSU I O FILTERS PROTECTION DGI HEADERS DEBUG LEVEL SHIFT DEBUG HEADERS AVR XMEGA ANALOG PSU 12V PSU ANALOG CHANNELS CALIBRATION NETWORK TARGET PSU BUF ANALOG HEADERS USB TARGET VOLTAGE REFERENCE Power is supplied to the Power Debugger from the USB bus connected to the DEBUG port regulated to 3 3V by a step down switch mode regulator The VTG pins are used as a reference input on...

Page 78: ... at the user s risk and ESD precautions must be taken 5 3 Analog Hardware The Power Debugger analog front end contains two channels referred to as the A channel and the B channel Although they operate on similar mechanisms the two channels are not symmetrical and should be used for different purposes Both channels are fed into independent ADC channels on the AVR XMEGA128A1U microcontroller This AD...

Page 79: ...e pins next to the ammeter symbols and the pin next to the voltage source symbol on the Power Debugger The calibration is triggered through the software front end used to interface the Power Debugger 5 4 Target Voltage Supply VOUT The Power Debugger has an on board voltage supply capable of providing up to 100 mA in the range 1 6V to 5 5V from the USB DEBUG connector Tip The voltage supply will im...

Page 80: ...d to the target device s RX line for USART usage and MISO for SPI usage Remember that for SPI usage the Power Debugger is the slave Important The DGI uses the same reference voltage as the debugger section This means that the REF pins of the DGI header and the debug headers are electrically connected Important SPI and USART mode cannot be used simultaneously Important An I2C write transaction coul...

Page 81: ...POWER VBUS is routed from the Micro B jack to pin 1 on the B channel header POWER VBUS is routed from pin 4 on both A and B channel headers to the A jack The routing of the POWER line enables the user to easily connect up one of the following configurations Routing USB power from the TARGET USB connector through the B channel for measurement Mount both jumpers on the B channel header as shown here...

Page 82: ...he A channel as shown here Figure 5 7 Jumper Configuration Sourcing USB power from the DEBUG USB connector through the variable voltage source through the B channel Use a single wire to connect POWER to the B channel and a jumper to connect the output as shown here Power Debugger Hardware Description 2020 Microchip Technology Inc User Guide DS40002201A page 82 ...

Page 83: ...d to Indicate the Status of the Analog Sampling Circuitry Table 5 1 LEDs LED Function Description TARGET Target Power GREEN when target power is OK POWER Main Power RED when main board power is OK STATUS Status Flashing GREEN when the target is running stepping OFF when target is stopped VOUT Target Voltage GREEN when target output voltage is ON Flashing when an overcurrent is detected in the A ch...

Page 84: ...art 15 2013 The Technical Construction File is located at Microchip Technology Norway AS Brøsetvegen 164 7069 Trondheim Norway Every effort has been made to minimize electromagnetic emissions from this product However under certain conditions the system this product connected to a target application circuit may emit individual electromagnetic component frequencies which exceed the maximum values a...

Page 85: ... the DEBUG USB connector before plugging anything to the TARGET Micro B USB connector If a voltage is applied to the EVT pin on the 20 pin DGI header while no host is connected to the DEBUG USB connector a current of up to 25 mA might flow into the EVT pin It is always recommended to plug a host to the DEBUG USB connector before applying any voltage to any of the Power Debugger pin header pins Run...

Page 86: ... X IDE information Updated Firmware Release History 42696D 10 2016 Added UPDI interface and updated Firmware Release History 42696C 03 2016 Updated quick start guide Added debug cable pinout Reworked firmware revision history table Several minor updates and corrections 42696B 03 2015 Internal version not published 42696A Initial document release Power Debugger Revision History 2020 Microchip Techn...

Page 87: ...s available through the website at http www microchip com support Microchip Devices Code Protection Feature Note the following details of the code protection feature on Microchip devices Microchip products meet the specification contained in their particular Microchip Data Sheet Microchip believes that its family of products is one of the most secure families of its kind on the market today when u...

Page 88: ...us ProASIC Plus logo Quiet Wire SmartFusion SyncWorld Temux TimeCesium TimeHub TimePictra TimeProvider Vite WinPath and ZL are registered trademarks of Microchip Technology Incorporated in the U S A Adjacent Key Suppression AKS Analog for the Digital Age Any Capacitor AnyIn AnyOut BlueSky BodyCom CodeGuard CryptoAuthentication CryptoAutomotive CryptoCompanion CryptoController dsPICDEM dsPICDEM net...

Page 89: ...3 7252 China Xiamen Tel 86 592 2388138 China Zhuhai Tel 86 756 3210040 India Bangalore Tel 91 80 3090 4444 India New Delhi Tel 91 11 4160 8631 India Pune Tel 91 20 4121 0141 Japan Osaka Tel 81 6 6152 7160 Japan Tokyo Tel 81 3 6880 3770 Korea Daegu Tel 82 53 744 4301 Korea Seoul Tel 82 2 554 7200 Malaysia Kuala Lumpur Tel 60 3 7651 7906 Malaysia Penang Tel 60 4 227 8870 Philippines Manila Tel 63 2 ...

Reviews: