DebugWIRE
   HOME

TheInfoList



OR:

debugWIRE is a serial communications protocol, designed by
Atmel Atmel Corporation was a creator and manufacturer of semiconductors before being subsumed by Microchip Technology in 2016. Atmel was founded in 1984. The company focused on embedded systems built around microcontrollers. Its products included micr ...
. It is used for
on-chip debugging In-circuit emulation (ICE) is the use of a hardware device or in-circuit emulator used to debug the software of an embedded system. It operates by using a processor with the additional ability to support debugging operations, as well as to car ...
of
AVR microcontrollers AVR is a family of microcontrollers developed since 1996 by Atmel, acquired by Microchip Technology in 2016. These are modified Harvard architecture 8-bit RISC single-chip microcontrollers. AVR was one of the first microcontroller families to u ...
.


Protocol

debugWIRE is designed as a simpler alternative to
JTAG JTAG (named after the Joint Test Action Group which codified it) is an Technical standard, industry standard for verifying designs and testing printed circuit boards after manufacture. JTAG implements standards for on-chip instrumentation in ele ...
, aimed at
microcontrollers A microcontroller (MCU for ''microcontroller unit'', often also MC, UC, or μC) is a small computer on a single VLSI integrated circuit (IC) chip. A microcontroller contains one or more CPUs ( processor cores) along with memory and programmabl ...
(MCUs) with limited resources. It is supported by the classic
ATtiny ATtiny (also known as TinyAVR) is a subfamily of the popular 8-bit AVR microcontrollers, which typically has fewer features, fewer I/O pins, and less memory than other AVR series chips. The first members of this family were released in 1999 by ...
and some smaller ATmega MCUs, such as the
ATmega328 The ATmega328 is a single-chip microcontroller created by Atmel in the megaAVR family (later Microchip Technology acquired Atmel in 2016). It has a modified Harvard architecture 8-bit RISC processor core. Specifications The Atmel 8-bit AVR R ...
. By using debugWIRE one has full read and write access to all memory and full control over the execution flow. It supports single-step, run-to-cursor, step-out, and software break instructions. A
breakpoint In software development, a breakpoint is an intentional stopping or pausing place in a program, put in place for debugging purposes. It is also sometimes simply referred to as a pause. More generally, a breakpoint is a means of acquiring knowle ...
(run-to-cursor) will be set by reprogramming the ''BREAK''
opcode In computing, an opcode (abbreviated from operation code, also known as instruction machine code, instruction code, instruction syllable, instruction parcel or opstring) is the portion of a machine language instruction that specifies the operat ...
into the
flash memory Flash memory is an electronic non-volatile computer memory storage medium that can be electrically erased and reprogrammed. The two main types of flash memory, NOR flash and NAND flash, are named for the NOR and NAND logic gates. Both us ...
of the MCU. Care must be taken due to the limited number of guaranteed write cycles (10000) of the device.


Programmer models

debugWIRE is supported by all modern hardware debuggers from
Microchip An integrated circuit or monolithic integrated circuit (also referred to as an IC, a chip, or a microchip) is a set of electronic circuits on one small flat piece (or "chip") of semiconductor material, usually silicon. Large numbers of tiny M ...
. This includes Atmel-ICE, JTAGICE3, AVR Dragon, JTAGICE mkII, and SNAP. It is also possible to build a cheap debugWIRE hardware debugger based on an open-source
Arduino Arduino () is an open-source hardware and software company, project, and user community that designs and manufactures single-board microcontrollers and microcontroller kits for building digital devices. Its hardware products are licensed unde ...
sketch.


debugWIRE specifications

debugWIRE is activated by setting (programming to zero) of the fuse DWEN (debugWIRE enable), normally located in the high fuse byte. After this action the /RESET pin function isn't available anymore and the ISP protocol cannot be used. debugWIRE can be disabled with any of the mentioned debuggers by sending a special reset command that disables temporarily the debugWIRE function and reenables /RESET and also ISP until next power down cycle. debugWIRE is not able to program the fuses of a device. If you want to disable debugWIRE permanently you have to disable the function temporarily and program the fuse using the now available ISP function. debugWIRE uses a 1 wire
open drain An open collector is a common type of output found on many integrated circuits (IC), which behaves like a switch that is either connected to ground or disconnected. Instead of outputting a signal of a specific voltage or current, the output sig ...
serial connection. The default baud rate used is MCU clock/128. Sending a
BREAK Break or Breaks or The Break may refer to: Time off from duties * Recess (break), time in which a group of people is temporarily dismissed from its duties * Break (work), time off during a shift/recess ** Coffee break, a short mid-morning rest ...
will return 0x55 which is used to detect the baud rate. The MCU will return a BREAK when a breakpoint is hit or a collision is detected on the debugWIRE connection. 0x06 is used to disable debugWIRE and reenable /RESET and ISP, 0x07 resets the MCU, 0xF0 returns the PC, 0xF3 the debugWIRE ID.


References

{{Microcontrollers Serial buses Debugging