Microstick for 3V PIC24 K Series Devices Overview The Microstick for 3V PIC24 K Series Devices is designed to provide an easy-to- use, economical development environment for 16-bit microcontrollers. The board includes an integrated debugger/programmer, a socket for the target micro- controller chip and pins that facilitate insertion into a prototyping board for extremely flexible development. Installing MPLAB IDE and C Compilers Americas Asia/Pacific Europe The MPLAB Integrated Development Environment (IDE) should be installed prior Atlanta - 678-957-9614 Australia - Sydney - 61-2-9868-6733 Austria - Weis - 43-7242-2244-39 to using the Microstick for 3V PIC24 K Series Devices. This board is designed to run Boston - 774-760-0087 China - Beijing - 86-10-8569-7000 Denmark - Copenhagen - 45-4450-2828 with MPLAB IDE Version 8.80 or later. While the MPLAB IDE provides assembler Chicago - 630-285-0071 China - Chengdu - 86-28-8665-5511 France - Paris - 33-1-69-53-63-20 tools for development, most code examples provided for Microchip devices are writ- Cleveland - 216-447-0464 China - Chongqing - 86-23-8980-9500 Germany - Munich - 49-89-627-144-0 ten in C language and require a C compiler to be installed. Microchips MPLAB C Dallas - 972-818-7423 China - Hangzhou - 86-571-2819-3187 Italy - Milan - 39-0331-742611 Detroit - 248-538-2250 China - Hong Kong SAR - 852-2401-1200 Netherlands - Drunen - 31-416-690399 Compiler seamlessly integrates into the MPLAB IDE. Both the MPLAB IDE and C Indianapolis - 317-773-8323 China - Nanjing- 86-25-8473-2460 Spain - Madrid - 34-91-708-08-90 Compiler are free and available for download at: Developing Applications Hardware Design Microstick for 3V PIC24 K Series Devices only implements circuitry for low-voltage The Microstick for 3V PIC24 K Series Devices is USB bus-powered. An on-board ICSP programming. To enable low-voltage ICSP programming, it is important to MCP1727 LDO regulator provides +3.3 VDC output from the USB bus power. always configure the microcontroller to enable MCLR pin function, rather than RA5 Turning power on/off to the target application is controlled by the MPLAB IDE via general purpose input pin function. 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 The following assembly language directive enables the MCLR pin function in the may help protect the host PC USB port from accidental shorting of power supply device Configuration bits: pins in the target application circuit. MCLR Pin Enable bit (RA5 input disabled MCLR enabled) The Microstick may be plugged into a prototyping board to develop external appli- config FPOR, MCLRE ON cation circuitry with the PIC MCU. On the bottom side of the board, three rows of In C30, the same thing is accomplished with this code: pins are provided, labeled P1, P2 and P3. Normally, the skinny DIP layout (300 mils) should be used by populating rows, P1 and P2. Optionally, rows, P1 // MCLR Pin Enable bit (RA5 input disabled MCLR enabled) and P3, may be populated instead to provide a wide DIP layout (600 mils). The FPOR(MCLRE ON) unpopulated, single in-line pin header for soldering into P3 is available separately Warning: Always program the microcontroller with MCLR pin functionality as Digi-Key Part Number ED7464-ND. enabled so that the Microstick for 3V PIC24 K Series Devices can be used to program/debug the chip in the future. Using the 16-Bit XLP Development Board If the microcontroller is programmed with MCLR pin function dis- In the skinny DIP layout configuration (rows, P1 and P2, are populated), the Micro- abled (RA5 input enabled), the Microstick will no longer program or stick may be plugged into Microchips 16-Bit XLP Development Board. The 16-Bit debug firmware on the microcontroller, because Microstick does XLP Development Board provides several external buttons, LEDs, peripherals and not have circuitry to use high-voltage ICSP entry. REAL ICE, sensors that can be used to quickly evaluate the device without spending time MPLAB ICD 3 and PICkit 3 are an example of high-voltage ICSP wiring a breadboard. tools that can be used to recover the part. Warning: Always remove batteries and/or the POWER SOURCE SELECT The slide switch, labeled S3 on the PCB, is used to select which pair of PGECx/ jumper from the 16-Bit XLP Development Board, prior to inserting PGEDx pins to use for In-Circuit Serial Programming (ICSP). When moved the Microstick board. The Microstick for 3V PIC24 K Series Devices towards the DIP socket, the Microstick is set for using PGEC3/PGED3. When is intended to supply power to the target application, which could moved towards the USB connector, the Microstick is configured for PGEC1/ cause an unintended charging of batteries connected to the 16-Bit PGED1. XLP Development Board. To allow for debugging to work in MPLAB, the devices Configuration bits must be The 16-Bit XLP Development Board may come with a USB-to-Serial or RS-232 set up to indicate which PGECx/PGEDx pins are actually being used in the circuit. serial port wired to the PIC microcontrollers U2TX/U2RX pins. To avoid conflict For example, in assembly language, you may need directives such as this: with the on-board serial port circuitry, slide S3 of the Microstick to the PGEC3/ .includep24Fxxxx.in PGED3 setting (move the switch lever towards the DIP socket). ICD Pin Placement Select (EMUC/EMUD share PGC3/PGD3) config FICD, ICS PGx3 In C30, the same thing can be accomplished with this code: include <p24Fxxxx.h> // ICD Pin Placement Select (EMUC/EMUD share PGC3/PGD3) FICD(ICS PGx3) A C30 firmware source code example for blinking the Microsticks LED is provided on the Microchip web site (see