DebugWIRE

Last updated

debugWIRE is a serial communications protocol, designed by Atmel. It is used for on-chip debugging of AVR microcontrollers.

Contents

Protocol

debugWIRE is designed as a simpler alternative to JTAG, aimed at microcontrollers (MCUs) with limited resources. It is supported by the classic ATtiny and some smaller ATmega MCUs, such as the ATmega328. 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 (run-to-cursor) will be set by reprogramming the BREAK [1] opcode into the flash memory of the MCU. Care must be taken due to the limited number of guaranteed write cycles (10000) of the device. [2]

Programmer models

debugWIRE is supported by all modern hardware debuggers from Microchip. This includes Atmel-ICE, [3] JTAGICE3, AVR Dragon, JTAGICE mkII, and SNAP. [4] It is also possible to build a cheap debugWIRE hardware debugger [5] based on an open-source Arduino sketch. [6]

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. [7] debugWIRE uses a 1 wire open drain serial connection. The default baud rate used is MCU clock/128. Sending a BREAK 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. [8] [9] [10]

Related Research Articles

AVR microcontrollers Family of 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 use on-chip flash memory for program storage, as opposed to one-time programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time.

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 microcontrollers radio-frequency (RF) devices including Wi-Fi, EEPROM, and flash memory devices, symmetric and asymmetric security chips, touch sensors and controllers, and application-specific products. Atmel supplies its devices as standard products, application-specific integrated circuits (ASICs), or application-specific standard product (ASSPs) depending on the requirements of its customers.

JTAG is an industry standard for verifying designs and testing printed circuit boards after manufacture.

The Atmel AVR instruction set is the machine language for the Atmel AVR, a modified Harvard architecture 8-bit RISC single chip microcontroller which was developed by Atmel in 1996. The AVR was one of the first microcontroller families to use on-chip flash memory for program storage.

AVR Butterfly

The AVR Butterfly is a battery-powered single-board microcontroller developed by Atmel. It consists of an Atmel ATmega169PV Microcontroller, a liquid crystal display, joystick, speaker, serial port, real-time clock (RTC), internal flash memory, and sensors for temperature and voltage. The board is the size of a name tag and has a clothing pin on back so it can be worn as such after the user enters their name onto the LCD.

Atmel ARM-based processors are microcontrollers and microprocessors integrated circuits, by Microchip Technology, that are based on various 32-bit ARM processor cores, with in-house designed peripherals and tool support.

AVR32

The AVR32 is a 32-bit RISC microcontroller architecture produced by Atmel. The microcontroller architecture was designed by a handful of people educated at the Norwegian University of Science and Technology, including lead designer Øyvind Strøm and CPU architect Erik Renno in Atmel's Norwegian design center.

Arduino Open source hardware and software platform

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 under a CC BY-SA license, while software is licensed under the GNU Lesser General Public License (LGPL) or the GNU General Public License (GPL), permitting the manufacture of Arduino boards and software distribution by anyone. Arduino boards are available commercially from the official website or through authorized distributors.

Segger Microcontroller, founded in 1992, is a private company involved in the embedded systems industry. It provides products used to develop and manufacture four categories of embedded systems: real-time operating systems (RTOS) and software libraries (middleware), debugging and trace probes, programming tools, and in-system programmers. The company is headquartered in Monheim am Rhein, Germany, with remote offices in Gardner, Massachusetts; Milpitas, California; and Shanghai, China.

PICkit

PICkit is a family of programmers for PIC microcontrollers made by Microchip Technology. They are used to program and debug microcontrollers, as well as program EEPROM. Some models also feature logic analyzer and serial communications (UART) tool.

MPLAB is a proprietary freeware integrated development environment for the development of embedded applications on PIC and dsPIC microcontrollers, and is developed by Microchip Technology.

OBDuino is an open source trip computer design based on the Arduino platform. An OBDuino may be assembled and customised by an electronics hobbyist; it displays information such as instantaneous fuel economy, engine tuning parameters etc. on an LCD.

Bus Pirate

The Bus Pirate is a universal bus interface device designed for programming, debugging, and analyzing microcontrollers and other ICs. It was developed as an open-source hardware and software project.

ATtiny microcontroller comparison chart

ATtiny 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 Atmel.

ATmega328

The ATmega328 is a single-chip microcontroller created by Atmel in the megaAVR family. It has a modified Harvard architecture 8-bit RISC processor core.

Arduino Uno Microcontroller board

The Arduino Uno is an open-source microcontroller board based on the Microchip ATmega328P microcontroller and developed by Arduino.cc. The board is equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to various expansion boards (shields) and other circuits. The board has 14 digital I/O pins, 6 analog I/O pins, and is programmable with the Arduino IDE, via a type B USB cable. It can be powered by the USB cable or by an external 9-volt battery, though it accepts voltages between 7 and 20 volts. It is similar to the Arduino Nano and Leonardo. The hardware reference design is distributed under a Creative Commons Attribution Share-Alike 2.5 license and is available on the Arduino website. Layout and production files for some versions of the hardware are also available.

The MPLAB series of devices are programmers and debuggers for Microchip PIC and dsPIC microcontrollers, developed by Microchip Technology.

Arduino Nano

The Arduino Nano is a small, complete, and breadboard-friendly board based on the ATmega328P released in 2008. It offers the same connectivity and specs of the Arduino Uno board in a smaller form factor.

In computing, autonomous peripheral operation is a hardware feature found in some microcontroller architectures to off-load certain tasks into embedded autonomous peripherals in order to minimize latencies and improve throughput in hard real-time applications as well as to save energy in ultra-low-power designs.

References

  1. AVR Instruction Set Manual
  2. ATtiny25-ATtiny45-ATtiny85_Datasheet-Summary.pdf
  3. Atmel-ICE
  4. MPLAB SNAP In-Circuit Debugger
  5. A debugWIRE Hardware Debugger for Less Than 10 €
  6. dw-link---An Arduino-based debugWIRE debugger
  7. debugWIRE article (in German)
  8. The debugWIRE protocol
  9. Simple stand-alone debugWIRE debugger (open source)
  10. Microchip Makes (25 November 2015). "Advanced Debugging with Arduino Boards" via YouTube.