01. Introduction
I wrote this guide because I could not find many resources online on the PIC24. Granted, the chip set only came out in 2006, and there was a datasheet for each family of microcontrollers, I had a lot of trouble finding sample code, or learning how the different modules functioned. The Microchip forums were very helpful, as well as some of the calls to Microchip’s technical support (though some of the tickets were not answered at all).
I became very familiar with the PIC24 at work. I graduated in the discipline of electrical engineering, and during my first job in this field, I had to learn to use the PIC24JF64GA002 for one of the projects needed to design an electronics control system with the microcontroller from the ground up. In case one of you out there who are in the same situation, I hope this tutorial will give you a heads start on the learning process.
This guide assumes that you have some background in assembly programming. While you can get by with just knowing how to program C, very low level programming, assembly, is more or less a hardware process. C on the other hand can be both hardware and software, but most of the time, programmers tend to think of the language as the mother of all software programming. There are many concepts in this guide that will be very easy to grasp if you’ve ever done any work on the old Intel 8080 or the Motorola 68000, but for those of you who’ve only dealt with software, some of the notions may seem foreign.
The PIC24 is a very versatile microcontroller. It is a new generation of 16 bit microcontrollers that is based on a completely different architecture. This is the main distinction between the PIC24s and Microchip’s previous line of 16 bit chips (such as the PIC18). Personally, I like using the PIC24s because they are very powerful and versatile. Though the PIC18s are a very good set of processors, the PIC24s architecture is almost the same as the digital signal processors, dsPIC30s and dsPIC33s. This allows for easy transitions when project calls for DSP. These powerful set of processors are almost the same as the PIC24s, with the exception that they have a series of instructions that allows for quick digital signal processing. The processors allows for easy, and unbelievably fast implementation of functions that are somewhat awkward on a conventional microprocessor. These include fast Fourier transforms (FFT), divisions and multiplications, as well as a bunch of other instructions with dedicated silicon. I mention this, because as most assembly programmer would probably know, writing a multiplication function on the 8051 or the 68000 was a big pain in the ass, and was extremely slow to execute. But, enough about the dsPIC3x line of products. The PIC24 enjoys all the benefits of the new 16 bit architecture, but without the fancy digital processing circuitry. They are built for versatility, more or less. I won’t go into the specifics of these chips as they may change in the future, but I am always very impressed with how much stuff they can squeeze into the chip plastic packages.
Microchip’s gracious engineering department gives away the MPLAB Integrated Development Environment (IDE) for free. The program comes with the assembler, ASM30. For all those programmers who are purists, or the sadist software engineers who likes to bang their forehead on the keyboard, this is the compiler software suite for you. However, I like to spend my work time practically. If I’m going to write 32 kb of code, I would definitely consider using C along with an assembly compiler. I know there are purist assembly programmers out there who would probably put down this guide right this second. The arguments are usually something like “writing in C and compiling to assembly makes the code execute too slow” or “the code doesn’t optimize very well” or “the code takes too much space”. However, the PIC24s nowhere near the dinosaur ICs of yesteryears. They are lightning fast and have plenty of space. In addition, Microchip’s engineers did a great job of making sure the compiler optimization of code is robust and streamlined. For the purists assembly programmers out there, it is definitely a good time to join the Dark side. Cause really, at up to 120 MHz, and up to 256 Kb of programming memory, the Dark side really isn’t so bad. In all seriousness though, the C30 C compiler is a great tool, and makes me want to puke in disgust when I look back at the programming process of those old DOS-based assembly programming suites.
There’s the introduction, now let’s get to some programming.
Table of Contents
Next – 2. Getting Started

Entries (RSS)
I have used PLM (complier designed by Intel back in 1975). I want to learn C but confused about which micro to choose from various micro. I have read the first page and I am impressed. Let you know after furthe pages.