Microstick for the PIC24 Microchip Microstick • Easy to use, economical development environment for 16-bit PIC Microcontrollers. – Socketed connection for PIC24 family microcontrollers – USB Powered; no external power required – Built-in integrated programmer/debugger • No bootloader needed • We’ll use the PIC24HJ64GP502 microcontroller with the Microstick • Same family as PIC24HJ32GP202 but more program memory – Same ISA and pinout Board Configuration Power supplied through USB cable Programming using MPLAB 1. 2. 3. 4. 5. 6. 7. Load the code into MPLAB IDE. Inform MPLAB IDE what device is plugged in to the Microstick Board by selecting the appropriate device from the Configure>Select Device>Device menu. Choose PIC24HJ64GP502. Build the project by selecting Project>Build All. Connect the Microstick Board to the development computer via a USB cable. Enable the MPLAB IDE debugger by selecting Debugger>Select Tool>Starter Kits. Download your code into a device on the Microstick Board by selecting Debugger>Program. Run the application previously downloaded by selecting Debugger>Run. Configuration Bits •Optionally, you can modify the configuration bits to disable the Watchdog Timer •Select Configure>Configuration Bits to change the timer Writing LATx is the same as writing PORTx A Demo Program RB15 .include "p24Hxxxx.inc" .global __reset .text ;Start of Code section __reset: mov #__SP_init, W15 mov #__SPLIM_init,W0 mov W0, SPLIM ; set bit 15 to 0 so RB15 is set to output mov #0x7FFF,W4 mov W4,TRISB mloop: mov #0x8000,W5 mov W5,PORTB ; set bit 15 to 1 call delay mov #0x0000,W5 mov W5,PORTB ; set bit 15 to 0 call delay bra mloop delay: mov #0xFFFF,W6 dloop: dec W6,W6 cp0 W6 bra NZ, dloop return .end