Microchip Technology Microstick for the 5V PIC24F K-series DM240013-2 DM240013-2 Data Sheet

Product codes
DM240013-2
Page of 4
Developing Applications
Microstick for 5V PIC24 K Series Devices only implements circuitry for low-voltage
ICSP™ programming. To enable low-voltage ICSP programming, it is important to
always configure the microcontroller to enable MCLR pin function, rather than RA5
general purpose, input pin function. 
The following assembly language directive enables the MCLR pin function in the
device Configuration bits:
; MCLR Pin Enable bit (RA5 input disabled; MCLR enabled)
  config __FPOR, MCLRE_ON
In XC16, the same thing is accomplished with this code:
// MCLR Pin Enable bit (RA5 input disabled; MCLR enabled)
FPOR(MCLRE_ON)
The slide switch, labeled S3 on the PCB, is used to select which pair of PGECx/
PGEDx pins to use for In-Circuit Serial Programming™ (ICSP™). When moved
towards the PDIP socket, the Microstick is set for using PGEC3/PGED3. When
moved towards the USB connector, the Microstick is configured for PGEC1/
PGED1.
To allow for debugging to work in MPLAB, the device’s Configuration bits must be
set up to indicate which PGECx/PGEDx pins are actually being used in the circuit.
For example, in assembly language, you may need directives such as this:
.include "p24Fxxxx.inc"
; ICD Pin Placement Select (EMUC/EMUD share PGC3/PGD3)
  config __FICD, ICS_PGx3
In XC16, the same thing can be accomplished with this code:
#include <p24Fxxxx.h>
// ICD Pin Placement Select (EMUC/EMUD share PGC3/PGD3)
_FICD(ICS_PGx3) 
An XC16 firmware source code example for blinking the Microstick’s LED is
provided on the Microchip web site (see 
http://www.microchip.com/microstick
).
Warning: Always program the microcontroller with MCLR pin functionality
enabled so that the Microstick for 5V PIC24 K Series Devices can
be used to program/debug the chip in the future. 
If the microcontroller is programmed with MCLR pin function
disabled (RA5 input is enabled), the Microstick will no longer pro-
gram or debug firmware on the microcontroller because Microstick
does not have circuitry to use high-voltage ICSP entry. REAL
ICE™, MPLAB ICD 3 and PICkit™ 3 are examples of high-voltage
ICSP tools that can be used to recover the part.
Hardware Design
The Microstick for 5V PIC24 K Series Devices is USB bus powered. The device is
powered directly from the 5V USB bus. Turning power on/off to the target applica-
tion is controlled by the MPLAB IDE via the FPF2102 load switch. The FPF2102
load switch automatically shuts down power to the target if the current exceeds a
trip point of 200 mA to 400 mA. This may help protect the host PC USB port from
accidental shorting of power supply pins in the target application circuit.
The Microstick may be plugged into a prototyping board to develop external appli-
cation circuitry with the PIC
®
 MCU. On the bottom side of the board, three rows of
pins are provided, labeled P1, P2 and P3. Normally, the Skinny PDIP (SPDIP) lay-
out (300 mils) should be used by populating rows, P1 and P2. Optionally, rows, P1
and P3, may be populated instead to provide a wide PDIP layout (600 mils). The
unpopulated, single in-line pin header for soldering into P3 is available separately
as Digi-Key Part Number ED7464-ND.