GS003
DS93003A-page 2 © 2005 Microchip Technology Inc.
DESIGN PROCEDURE
To make use of these alternate debugging channels, a
few steps need to be taken:
1. Before you lay out your circuit board, decide
whether you will need to use alternate
debugging channels .
For instance, assume that an application run-
ning on a dsPIC30F3012 requires the SDA and
SCL pin functions to communicate via the I2C
protocol with other components on the board.
On the dsPIC30F3012 device, the SCL and
SDA pins (11 and 12) are multiplexed with the
default in-circuit debugging pins, EMUD and
EMUC, respectively. So, this application
requires an alternate in-circuit debugging
channel.
2. Select the alternate debugging channel to use
from EMUC1/EMUD1, EMUC2/EMUD2 or
EMUC3/EMUD3.
For the hypothetical application, assume that
pins 2 and 3 on the dsPIC30F3 012 a re avail able
for use during in-circuit debugging operations.
Thus, you would use EMUC3 and EMUD3 as
the alternate in-circuit debugging channel for
this application.
3. While designing your board, provide a connec-
tion between the PGC and PGD pins on the
MPLAB ICD 2 unit and the selected alternate
debugging channel, EMUC3 and EMUD3, as
shown by the switch in Figure 1.
4. Before downloading code (programming) into
the target device, you’ll need to set the configu-
ration bits dialog in MPLAB IDE to accurately
reflect the selected in-circuit debugging chan-
nel. MPLAB IDE, by default, uses the PGC/
EMUC and PGD/EMUD pins for programming
and debugging. For the hypothetical application
you’ll set the “COMM CHANNEL SELECT”
opti on t o “Us e EMU C3 a nd E MUD3 ”, as show n
in Figure 2. The configuration bits dialog is
invoked by selecting the Configure>Configura-
tion Bits menu in MPLAB IDE.
5. During a programming or connect operation
(with MPLAB ICD 2 selected as a Debugger),
the switch (or jumper) should be positioned so
that the MPLAB ICD 2 unit communicates with
the target dsPIC30F device via PGC and PGD
(pins 12 and 11, respectively).
6. When programming is complete, the switch (or
jumper) should be positioned so that the MPLAB
ICD 2 unit communicates with the target
dsPIC30F d ev ic e v ia EMU C3 an d EM U D3 (p in s
3 and 2, respectiv el y).
7. You are now ready to perform in-circuit debug-
ging operations using such functions as Reset,
Run, Single-step, Halt, Set Breakpoint, etc.
FIGURE 2: EXAMPLE MPLAB® IDE CONFIGURATION BITS DIALOG