EasyManuals Logo

Atmel Atmel-ICE User Manual

Atmel Atmel-ICE
62 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #55 background imageLoading...
Page #55 background image
7. Advanced Debugging Techniques
7.1. Atmel AVR UC3 Targets
7.1.1. EVTI / EVTO Usage
The EVTI and EVTO pins are not accessible on the Atmel-ICE. 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 in response to an external event. If the Event In Control
(EIC) bits in the DC register are written to 0b01, high-to-low transition on the EVTI pin will generate
a breakpoint condition. EVTI must remain low for one CPU clock cycle to guarantee that a
breakpoint is triggered. The External Breakpoint bit (EXB) in DS is set when this occurs.
Generating trace synchronization messages. Not used by the Atmel-ICE.
EVTO can be used for the following purposes:
Indicating that the CPU has entered debug mode. Setting the EOS bits in DC to 0b01 causes the
EVTO pin to be pulled low for one CPU clock cycle when the target device enters debug mode.
This signal can be used as a trigger source for an external oscilloscope.
Indicating that the CPU has reached a breakpoint or watchpoint. By setting the EOC bit in a
corresponding Breakpoint/Watchpoint Control Register, the breakpoint or watchpoint status is
indicated on the EVTO pin. The EOS bits in DC must be set to 0xb10 to enable this feature. The
EVTO pin can then be connected to an external oscilloscope in order to examine watchpoint timing.
Generating trace timing signals. Not used by the Atmel-ICE.
7.2. debugWIRE Targets
7.2.1. debugWIRE Software Breakpoints
The debugWIRE OCD is drastically scaled down when compared to the Atmel megaAVR (JTAG) OCD.
This means that it does not have any program counter breakpoint comparators available to the user for
debugging purposes. One such comparator does exist for purposes of run-to-cursor and single-stepping
operations, but additional user breakpoints are not supported in hardware.
Instead, the debugger must make use of the AVR BREAK instruction. This instruction can be placed in
FLASH, and when it is loaded for execution it will cause the AVR CPU to enter stopped mode. To support
breakpoints during debugging, the debugger must insert a BREAK instruction into FLASH at the point at
which the users requests a breakpoint. The original instruction must be cached for later replacement.
When single stepping over a BREAK instruction, the debugger has to execute the original cached
instruction in order to preserve program behavior. In extreme cases, the BREAK has to be removed from
FLASH and replaced later. All these scenarios can cause apparent delays when single stepping from
breakpoints, which will be exacerbated when the target clock frequency is very low.
It is thus recommended to observe the following guidelines, where possible:
Always run the target at as high a frequency as possible during debugging. The debugWIRE
physical interface is clocked from the target clock.
Try to minimize on the number of breakpoint additions and removals, as each one require a FLASH
page to be replaced on the target
Atmel Atmel-ICE [USER GUIDE]
Atmel-42330C-Atmel-ICE_User Guide-10/2016
55

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Atmel Atmel-ICE and is the answer not in the manual?

Atmel Atmel-ICE Specifications

General IconGeneral
BrandAtmel
ModelAtmel-ICE
CategoryMicrocontrollers
LanguageEnglish

Related product manuals