You are on page 1of 11

AVR mkII Lite Manual

AVR mkII Lite for the launch of the station I AVR Series simulator.
DebugWIRE debug interface with support for the AVR devices.
The simulator can use the simulation of the mainstream of the current low-
end market m48/88/168, tiny2313, and other devices to facilitate the process
of debugging, Greatly improve the efficiency of the development.
I, DebugWIRE introduced ATMEL is DebugWIRE in AVR devices to use the
new debugging interface to reduce the cost of debugging and the pin
Overhead. JTAG compared with the main difference is that only a signal line,
to complete the interactive debugging information to Control the flow of
procedures, directives, as well as the implementation of digital programming
fuse. It should be noted that, debugWIRE different from JTAG,
It is just a debugging interface, not the programming interface. In use at
least 3 access lines, which are: RESET, VTref,
RESET was the signal for transmission of debugging information (at this time
of the pin could be called dW)
, VTref debugger to the target board power supply information (but not to
take power from the target board, head
Materials will not be able to debug low voltage). DebugWIRE configuration of
the map are as follows:

As the time to debug the use of the RESET pin, the pin on the electrical requirements
are as follows: If there are pull-pin
Resistance, the resistance can not be less than 10K, but in fact debugWIRE do not
need the functionality of the pull-up resistor; the feet can not
A capacitive load; if there is another logic connection, it should be disconnected.

In this proposal: the development stage, the disconnect cited RESET

Feet of the reset circuit, including power-on reset and watchdog external reset chip,
and so on.

DebugWIRE will use the complex features of the RESET pin brought about a
problem is, ISP function and will function debugWIRE
Have mutually exclusive. Even if the debugWIRE also be able to function after the
ISP will not be able to function, so that the feature ISP on debugWIRE
Can not be used. Therefore, there must be a mechanism to determine why the RESET
function, in debugWIRE with the AVR devices,
A fuse programmable digital DWEN, if the fuse was not lockbits programming and
programming, the function was debugWIRE Kai
Use, RESET pin as dW communication with the debugger, ISP function is disabled.
Chip factory in the fuse are not programmed,
ISP is a function that is enabled, debugWIRE disabled. ISP can use the features of the
fuse can be programmed so that, that is,
That the use of ISP function when the bit can be programmed so as to enable
debugWIRE function, and in the state debugWIRE,
Debugger can place the ban on so that the ISP can function from the debugWIRE
model. To do in the paper after the Council
There are described in detail.

Note: If the AVR was lockbits programming, debugWIRE functions will not be able
to use. Security must be
Lockbits card is not set in the state DWEN setting, not in DWEN bit of the program
was set up lockbits.
Once in lockbits is set to make the case to the DWEN, so at this time because of
invalid debugWIRE function, will not be able to return to the ISP model, high-voltage
programming can only way to erase the entire film, making lockbits be removed in
order to enable debugWIRE

debugWIRE Despite the advantages of a simple connection, but this has also brought
a number of restrictions: 1) due to the RESET pin in the occupied
With the external reset will not be able to use and Simulation
2) When the program is running at full speed, debugWIRE system can be accurate
simulation of all I / O functions. But when the program stopped running
Only when the AVR Studio observed in certain registers, it should be noted. Register
to read because they will change some of the symptoms
State-bit (for example, to read the data USART register will clear the state RXC). In
this case JTAG emulation mode
There. A similar situation:
i) timer and watchdog timer
The timer, in the debug option in the option for when the debugger stop for model
Do you want to continue running. The watchdog in stop mode will be stopped in order
to avoid processor
ii) in the debugging process of making the target chip or brown-out reset will interrupt
iii) 16 bit register
As the visit to 16-bit register of the use of two 8-bit instructions to visit, if the single-
step operation, will be
Caused by an error.
iv) to register a number of visits, with special handling:
ATmega48, ATmega88 and ATmega168
Do not visit: SPDR, MONDR, UDR0
Do not visit: DWDR
Do not visit: UDR, SPMCSR
3) When debugWIRE be able to make, some of the system clock in the processor in
sleep mode when it was still able to make it
Will increase the power system. So do not need to debug, should be banned
debugWIRE function.
Second, AVR mkII Lite
AVR mkII Lite for the launch of the station I debugWIRE support system debugging
emulator for the original ATMEL
JTAGICE mkII version of the reduction, only debugWIRE support for the ISP to
download and debug (ISP device with the support of the MK II
The devices support the same: that is, all debugWIRE or JTAG interface devices).
The main features of
Are as follows:
Advance Science and Technology Development Network
1) in support of the two functions are debugWIRE and ISP functions, with all the
support debugWIRE interface
AVR chip; have the support of all JTAG interface debugWIRE and AVR devices ISP
2) and the PC's USB interface to connect to adopt (in-house use of USB to serial
device), directly from the USB the debugger take power
(But not to the target board power supply), no external power supply; goals and 10
boards to connect a standard core Socket ISP to facilitate the
The target board jack reserved for the ISP customers;
3) The firmware can be upgraded inside the AVR Studio, the upgrade process
verification mechanism to ensure that the right to upgrade;
4) built-in device-specific level translators to support the interface voltage of 1.8-
5.5V, can be a reliable V suffix debugging AVR
In order to take care of the devices in the past on the board reserved the ISP user
interface, mkII Lite uses the standard 10 core ISP access
I connect the target board, which is defined as follows: it would facilitate the
completion of the ISP model with the model debugWIRE conversion:
mkII Lite can be ISP-enabled interface devices debugWIRE function, and then you
can start debugging directly, not
Re-connection with a change in the completion debugging after debugWIRE can re-
enable ISP function.
The emulator and the PC serial port to connect using the USB mode (the original
JTAGICE mkII at the same time support the original USB access
And serial port) to facilitate the connection directly connected to the PC's USB
interface can be, not only do not solve a lot of PC serial port
, Also solved the problem of power supply simulator.
AVR mkII Lite support of the device are as follows:

ATtiny13 debugWIRE
ATtiny2313 debugWIRE
ATtiny24 debugWIRE
ATtiny44 debugWIRE
ATtiny84 debugWIRE
ATtiny45 debugWIRE
ATtiny85 debugWIRE
ATtiny261 debugWIRE
ATtiny461 debugWIRE
ATtiny861 debugWIRE
ATmega48 debugWIRE
ATmega48P debugWIRE
ATmega88 debugWIRE
ATmega168 debugWIRE
AT90PWM3 debugWIRE
AT90PWM2 debugWIRE

For more than AVR Studio 4.12 SP4 Build498 provided in support of the device list,
with the AVR Studio and
The firmware upgrade will also increase support for the device.
Third, the use of debugging AVR mkII Lite objective of this chapter to ATmega168
devices as an example on how to use the AVR mkII Lite tune
DebugWIRE test with the device. First of all, should be installed AVR Studio, the
current (20,061,206) for the latest AVR
Studio 4.12 SP4
Build498, users can download from the Web site ATMEL:

Install AVR Studio, and then install the service pack4. AVR mkII Lite due to the use
of USB to serial device, it
USB connection is, therefore, the following will need to install USB
Complete the driver installation, the AVR mkII Lite will be connected to the USB
port, PC will find new hardware and
Require drivers to install, click to install automatically. Upon completion of the
installation drive, you can see in Device Manager AVR mkII
Lite the port number, such as:

Remember the slogan for the lower end of the COM5.

In order to verify whether or not installed properly, can run AVR Studio, click
on the top of the AVR program icons in the shell
Out of the window settings are as follows (in accordance with the actual
choice of port number):
Click connect, if there is a window JTAGICE mkII, it means that everything will be
all right. If there is failure to connect the window
I, check whether the AVR mkII Lite connection, as well as the port number is correct.
The new factory and the mega168
Introduction, debugWIRE function is disabled, so first of all need to use the
simulator's opening of the ISP function debugWIRE:

Click on:
A new AVR GCC project m168_test (to be installed WinAVR)

, A check will be self-Create_initial file

To create a dynamic c initialized and added to the project document, the file name in
the bottom of the initial file in the revision, the Application List
Create folder will be selected for the project to establish an independent folder, and all
the works save the file to the folder
In (the recommendation of the project can be put in a folder, look for better).

Select the bottom of the next

Debug platform choice for the JTAGICE mkII, select the target device ATmega168,
check the proposed open platform
options, choose finish, to complete the establishment of the project, added after the
code is as follows:
Can click Configuration of the project, including the name of the target devices,
clock frequency, the level of optimization and so on:

After the adoption of the compiler, you can click on the toolbar to start the simulation,
there may be errors as follows

This is because the AVR Studio will take the initiative in looking for COM1 ~ COM4
simulator, when the AVR mkII Lite port is not the norm
Wai should click manually select port designated port number:

Click OK, if the check in front of the open platform options, will pop JTAGICE mkII
configuration menu: the first connection tab can be set up
Baud connection, and can be prohibited debugWIRE function to return to the ISP
The second Debug tab can be set up:
Let stop the timer mode, can still run, the breakpoint information to the print output,
as well as download strategy.

The third tab status in the simulator can view and objectives of the chip's information.