PIC Resources

From DP

Jump to: navigation , search



Third Party Compilers

  • JALv2 is an open source JAL (Just Another Language) compiler. JAL is a high level language designed to hide the general nuisance of programming a Microchip PIC. It is derived from the original JAL, by Wouter van Ooijen, which is loosely based on Pascal. JAL compiles code for baseline, midrange and the 18F PIC series. JALv2 is an open source cross platform compiler running under Windows, Linux, FreeBSD and Mac OS X.Extensive libraries are available for JAL and there is an IDE called JAL Edit. There is an alternative open source IDE PicShell for Windows/Linux/others which includes a simulator supporting JAL and ASM code on the PIC 16F877, 16F876, 16F628 etc.
  • Great Cow BASIC An open Source BASIC compiler for Microchip PIC (and Atmel AVR) microcontrollers. There's also Great Cow Graphical BASIC which is an icon-based program editor. It allows you to create Great Cow BASIC programs without having to memorise commands. This makes it particularly useful for those who have never before done any programming.
  • PicForth is a Forth compiler written in gforth and hosted on Unix (or Linux) which generates code for the PIC 16F87x and 16F88 series. It includes two kinds of cooperative schedulers.
  • SDCC is a retargettable, optimizing ANSI - C compiler that targets the Intel 8051, Maxim 80DS390, Zilog Z80 and the Motorola 68HC08 based MCUs. Work is in progress on supporting the Microchip PIC 16 and 18 series. SDCC is Free Open Source Software, distributed under GNU General Public License (GPL).
  • PMP (Pic Micro Pascal) is a free Pascal cross compiler for PIC processors. It is intended to work with the Microchip MPASM/MPLINK suite installed; it has its own IDE and it is a highly optimized compiler. It supports most devices from PIC 10 to 18.
  • mikroElektronika sells C, BASIC, and Pascal compilers for Windows with their own IDE for the Microchip PIC and dsPIC microcontroller series. These compilers have extensive function libraries. Code size limited demo versions are available for free download.
  • SourceBoost Technologies sell BASIC, C and C++ compilers running under Windows for PIC18, PIC16 and some PIC12s. Code and RAM-size limited lite versions are available for free download.

Operating Systems, Kernels, Libraries

  • AVIX is a commercial RTOS based on the segmented RTOS architecture. Developed from the ground up for many of the most advanced micro controllers and fully exploits their capabilities. Available for Microchip PIC24F, dsPIC30F, dsPIC33F and PIC32MX (and ARM® Cortex-M3 based) microcontrollers.
  • FlashForth is a native Forth operating system for the PIC 18F and the dsPIC 30F series. It makes the PIC a standalone computer with an interpreter, compiler, assembler and multitasker.
  • FreeRTOS is a mini real time kernel ported to the PIC 24, dsPIC and PIC 32 series.
  • MIOS is a real-time operating system written in PIC assembly for the requirements of flexible MIDI applications like MIDI controllers, processors, synthesizers, sequencers. PIC 18F452, 18F4620 and 18F4685.
  • Novo RTOS is a small kernel of code that provides a co-operative multi-tasking environment when used with the BoostC, BoostC++ or BoostBasic compiler.(Demo compilers come with a free precompiled library copy.)
  • NuttX is a real time embedded operating system for 8-bit to 32-bit MCUs. Its goals are to achieve a high degree of standards compliance (POSIX and ANSI) while maintaining a small footprint. It’s compatible with various MCU boards from a number of manufacturers including Atmel, Freescale, Renesas and Microchip. NuttX is open source under the BSD license.
  • PICOS18 is an operating system for the PICmicro microcontrollers from the Microchip PIC18 family. It is totaly free and is distributed under the GPL licence.
  • OSA is a cooperative multitasking real-time operating system (RTOS) for Microchip PIC10, PIC12, PIC16, PIC18, PIC24, dsPIC (and for Atmel AVR 8-bit microcontrollers, and for STMicroelectronics STM8).It is free and distributed under the BSD licence.
  • SmallTooth is an open source Bluetooth stack coded from scratch with an embedded device in mind. It runs on a PIC32/24.
  • 16FUSB is an open source USB 1.1 bit-banging implementation for PIC16F628/628A in assembler.
  • M-Stack is an open source USB stack for PIC16F, PIC18F, PIC24F, and PIC32MX devices.


Microchip and clones

  • PICkit 2 The hobbyist's choice. A powerful programmer and debugger with cross-platform programming software (Windows via the MPLAB IDE, standalone application and command line application; Linux - with source code; Mac OS X - with source code). Debugging is only available with the Windows MPLAB IDE software. Additional Windows-only software is freely available from the Microchip website for a UART Tool (use the PICkit 2 for PIC MCU serial communications) and a Logic Tool Analyzer (use the PICkit 2 to capture digital waveforms in a circuit). You can connect multiple PICKit 2 programmers to your PC at the same time, use one as a programmer, another as a logic analyser, a third as a serial port (UART tool). The PICkit 2 can also be used to program microcontrollers without being attached to a computer (Programmer-To-Go feature). Since the release of the PICkit 3 in 2009 (see below) Microchip have hinted that they will not add support for newer microcontrollers, but this does not seem to have been the case to date (latest device file update was November 2011). There is also a user-created tool, the PICkit 2 Device File Editor which makes it easy(ier) to add new devices yourself. Note that some devices are not supported in the MPLAB IDE but require the use of the standalone PICkit 2 programming application.
  • PICkit 2 clones Microchip made the PICkit 2 schematic, firmware and software freely available from their website and this has encouraged a slew of Chinese clones and a small number of enhanced, more expensive, clones. See eBay or AliExpress for current clones (priced around $US 10 delivered worldwide), also check vendors' own websites which may be cheaper (but watch the shipping charges!).
  • PICkit 3 Beware the newer PICkit 3. It is more like an ICD2 rather than a PICkit 2. From a hardware viewpoint, the PICkit 3 is a hybrid of the PICkit 2 and the ICD 2; from a software viewpoint, it is purely an ICD 2. None of the good software architecture of PICkit 2 has shown up in the PICkit 3 (yet anyway). The UART Tool and the Logic Tool Analyzer Tool are not available for it. The only programming and debugging software available for it is the Windows MPLAB IDE. To top it off it costs more than the PICkit 2 for significantly less functionality. The only reason you might consider it is that Microchip has committed to support it for future microcontrollers.
  • The LProg Programmer by Embed Inc (and resold by microchipDirect for $USD 20) is a low cost, light weight programmer for 3.3V PICs only (includes the 24H, 24F, 33F, and 18FJ families). The LProg is USB powered, and can provide up to 100mA Vdd current to the target plus some other enhanced features. Embed Inc programmers have an excellent reputation for quality and reliability.
  • ICD 2 Superseded by the newer, cheaper ICD 3 (see below). Avoid.
  • ICD 3 In-Circuit-Debugger. Faster programming than a PICkit, but 4 times more expensive (or more compared with PICkit 2 clones). Also requires the purchase of additional header boards with a special microcontroller for debugging some 8-, 14- and 18-pin PIC microcontrollers.

Use a Bus Pirate

  • The Pirate PIC Programmer software application turns your Dangerous Prototypes' Bus Pirate into a basic PIC programmer! It has somewhat limited PIC support at present and needs a programming adapter for older 8 bit PIC 12/14/16/18 devices that use a 13 volt supply for programming. The hardcore hacker's choice - feel free to add support for your favourite PIC device and get a free programming adapter!

Build your own

There are many designs on the web for PIC programmers. Some are clones of the Microchip programmers that use a PIC inside of the programmer. The first category of programmers use a PIC microcontroller as the core. Note: There is a chicken and egg bootstrapping problem with building your own PIC programmer that contains a PIC, you need a way of programming the PIC that goes in the programmer.

The second category of programmers is simple designs that do not contain an microcontroller such as a PIC. Typically these are serial port programmers, that require an RS-232 port that puts out at least 12 Vdc. Many laptop serial ports and USB serial port adapters cheat a bit and do not put out enough voltage for PIC high voltage programming (HVP) which needs 12-13 V. In order to go the full DIY route, a simple serial port programmer like the JDM2 could be used to program an 18Fx550 used in the PICkit 2 or ICD 2 clones.

The third category of programmers is those that contain a microcontroller other than a PIC.

Programmers built around a PIC

Programmers without an internal PIC/MCU

  • Business Card PIC Programmer - Simple JDM2 style serial port programmer posted by Ian on Instructables,com. Originally it was submitted for a Hack-a-day contest. Useful for burning the firmware for the PIC18F2550 used in PICkit 2 clones.

Programmers built around a non-PIC MCU

Programmers to avoid at all costs

  • The K150 (aka DIY and kits 'r us) and knockoffs. Outdated, buggy software, limited device support, very slow (see the original designer's site and the Microchip Forum thread Reasons not to buy a...!).
  • iCP01 (PICkit 2 clone) – a yellow heatshrink wrapped usb stick that destroys PICs and also itself and also its faulty ZIF socket adaptor. It appears to have NO Vdd control circuit (5V always on!) and therefore cannot reprogram chips that need the Vpp first method. Also low Vpp is reported. Source: Microchip Forums thread Reasons not to buy a...!).
  • GENIUS G540/G840 universal device programmer - It caused amazing problems simply trying to program a PIC16F84A. Also it has the manual from hell! Source: Microchip Forums thread Reasons not to buy a...!).
  • PUP-0401 (PICkit 2 'clone') - a $16.50 USD Iranian board with a ZIF socket and allegedly 3.3V capable but without all the Vdd control circuits. The product page seems to expect errors due to low Vdd! It has Severe problems programming and incompatibilities with MPLAB.Reasons not to buy a...!).
  • MCUMALL PRG-017 USB PIC programmer - non-existent documentation and atrocious support. Probably a Kits'R Us rip-off (see below).Reasons not to buy a...!).
  • Kits 'R Us DIY.... series (+ clones) - Very buggy PC application with NO possibility of future fixes as the Delphi source can no longer be compiled. Also extremely slow. Reasons not to buy a...!).

Development Boards

  • Microchip provides a comprehensive range of development boards and kits. Of particular note is the inexpensive ($US 24.99) Microchip Microstick; a USB-powered, breadboard compatible board and programmer/debugger supplied with the 28 pin DIP packaged PIC24HJ64GP502 and dsPIC33FJ64MC802 (Note: these were the only devices initially supported by the inbuilt programmer/debugger). The following devices are now supported (presumably with later MPLAB releases): [ dsPIC33 family ] dsPIC33FJ64MC802, dsPIC33FJ128MC802 and [ PIC24H family ] PIC24HJ64GP502, PIC24HJ128GP502.
  • Seeed Studio (China) sells Dangerous Prototypes' very own Web Platform which is a great inexpensive dsPIC33 development board. It comes with a bootloader already installed so you do not need a programmer to start programming! Just $US 40 including worldwide delivery from Seeed Studio.
  • Jaluino (through hole) and Jaluino Bee (SMD) are open-source and open-hardware projects to provide Arduino-like boards based on the PIC 18 family and powered by jalv2 and jallib. Schematics, PCB Gerbers, tutorials, etc are all available.
  • XINO basic for PIC and PICAXE is a very low cost (sub-$5) development system supporting the following PICAXES: 18M2, 18, 18A, 18M, 18X, 28A, 28X, 28X1, 28X2 and any similarly pinned 18 or 28 pin PICs. Available via eBay.
  • Pinguino is an open-source and open-hardware project to build an Arduino compatible board and language with a real USB microcontroller using an 8 bit PIC 18F2550 or PIC 18F4550 or a 32 bit PIC 32MX460F512L or PIC 32MX460F512L. The Pinguino IDE is based on Python and SDCC. Before the compilation, a preprocessor translates specific instructions of the Arduino language to native C instructions.
  • DuinoMite is an open-source and open-hardware computer running BASIC on an PIC 32MX795 (80MHz, 512K FLASH, 128Mb RAM, 26 pin GPIO) with Arduino shield like layout. DuinoMite allows you to program in the BASIC language (interpreted at 30,000 lines per second) and have a VGA and PS/2 keyboard interface without the need for a computer. Code is stored on the micro SD-Card or internal flash drive and may be executed on power up. You can also use the Pinguino IDE to program it with Arduino sketches or MPLAB to program it in C. Several versions are available assembled starting at Euro 19.95.
  • ChipKIT is an open-source hardware and software solution intended for beginners and users with little or no knowledge of embedded controllers who wish to explore embedded applications. The Uno32 uses a PIC32MX320F128H and the Max32 uses a PIC32MX795F512L. Both are programmed with a modified Arduino IDE called MPIDE or Microchip's MPLAB using C. Priced from $US 26.95 (Uno32).


  • PIC18Fxxx Tutorial A comprehensive PIC18Fxxx tutorial from a Microchip Conference (2002) - MPLAB IDE, C18 C compiler.
  • Compiling PIC projects Dangerous Prototypes PIC projects tutorial - MPLAB IDE, C18 C compiler, C30 C compiler.
  • PIC24 Tutorial Comprehensive treatment of the PIC24: config, i/o, oscillator, timers, UARTs, I2C, ADC, SPI, PWM DAC and USB.
  • MPLAB X Installation (Linux), Converting legacy MPLAB 8.xx projects, limitations - beta MPLAB X IDE

Books (free)

mikroElektronika rather generously makes the following books which it publishes (and sells in hard copy) available online for free:

John B. Peatman, Professor of Electrical and Computer Engineering at The Georgia Institute of Technology, also generously makes:

  • Coin-Cell-Powered Embedded Design available as a free electronic download or you can purchase it as a self-published paperback from Lulu.com. The book introduces the reader to code writing for a microcontroller via a series of template files and using Microchip's free version of their C compiler for the PIC18 family.
  • Embedded Design with the PIC18F452 Microcontroller - (a condensed version) available as a free electronic download. Introduces a template of assembly language code that encompasses a set of features of the PIC18F452 plus its interactions with some I/O devices.