The Microchip Technology, Inc. PICmicro® MCU 8-bit microcontrollers are a powerful series of chips. Whether you are considering these microcontrollers for a hobby project or commercial production, there are useful and cost-effective development tools to assist you.
You may first want to consider the need for a compiler, to convert easy-to-read higher level languages into machine language for the processor. Second, determine if a programmer or debugger/emulator is needed for compiled code. Third, consider the target processor and a test platform to complete the prototyping process.
There are several packages that combine the software and hardware commonly used for developing firmware applications for the PIC® MCU. These kits are typically based on the Microchip Flash series of microcontrollers to allow for low cost development tools.
Your choice of which programming language you will be using will determine whether you need a compiler or an assembler to translate your source code to a .HEX output file (machine code). Low-level or assembly languages are converted using an assembler. High-level programming languages such as C language are converted using a compiler. Programming using C language is preferred by most engineers when compared to programming in Assembly. C language offers greater flexibility and ease-of-use, shorter code or instruction set output, and an overall faster development process. Click here to access a white paper document discussing the optimization concerns of a high order language compared to assembly.
Compilers translate code from the high-level language into hex code that is downloadable to the microcontroller. Compilers enable the engineer to program quicker and more efficiently when using existing libraries and drivers that a compiler may provide. There are less expensive command-line compilers that require just a text editor or compilers with integrated development environments that include more user-friendly features. Click through for Compiler selection assistance.
Programmers are hardware devices that write the program to the target chip. Most programmers use the .HEX file output from a compiler to do the programming. Also available are standard EEPROM programmers that know how to program most Microchip parts. Please note that Flash parts, support in-circuit and out-of-circuit programming, and are becoming the industry standard. Flash chips are extremely fast to program taking only a few minutes. Flash MCUs also contain larger memory space. Keep in mind that some in-circuit debuggers may also act as in-circuit serial programmers. The diagram below depicts how to connect a Mach X unit to a target board for programming. For specific programmers, click through for Device Programmers.
To help with post-production programming and debugging, you should consider adding an ICSP jack to the target board. ICSP stands for in-circuit serial programming. For further instruction on adding an ICSP jack on a target board, click here.
Debugging code can be simplified and expedited by using an ICD, emulator, simulator tools, or the test/burn method. An in-circuit debugger (ICD) is similar to an emulator, however it is only able to work with Flash microcontrollers. There are two I/O pins on a chip that are used to communicate from the target chip to the device and it uses a small amount of RAM and ROM in the target device. Control software lets you update the ICD unit firmware without having to remove the chip from the ICD unit. It can single-step through code, view variables and set multiple break points. The ICD is a good cost for benefit debugging solution. An ICD can be purchased for less than $100 USD. For additional information, click through for Debuggers. The diagram below is also representative of how to connect an ICD for debugging.
An emulator is a higher-end development tool that replaces the target chip with a special connector that connects to a unit to emulate code on the chip. It can single-step through code, view variables, set multiple break points and may be able to keep a history of executed instructions. An emulator runs much faster than an ICD and does not require I/O pins, RAM or ROM. An emulator will generally cost over $1000 USD. For additional information, click through for Emulators or see the diagram below for a visual representation of how to connect to an emulator.
A simulator is a program that runs on the PC and pretends to be a microcontroller. Simulators offer similar debug capability, however there is no hardware interaction. This works well to test a math function, but not for interfacing to other chips. Microchip offers a free simulator with MPLAB®.
The last method is the burn and test method. You compile code, burn to the chip, and test the hardware. If the hardware does not work properly, you would review the code and make changes. Then burn and test the target chip on the hardware again. This is very inexpensive with a Flash part, but more than likely the most time consuming method.
If you are looking for a specific microcontroller to fit your project needs (i.e.: specific I/O pins, A/D converters, external peripherals, ROM/RAM requirements, etc), click here. Once you have picked your target device, if you already have a prototyping board, be sure that you consider either including a socket or ICSP programming jack to make debugging and programming easy.
If you do not already have a prototyping board, you may want to consider purchasing a development board with the microprocessor already on it and the tools necessary for programming and debugging. Many companies have grouped tools together to make starting a PIC® project easy and inexpensive. Click through for software prototyping boards or development kits.
Microchip devices are separated into families based on op-code, baseline (12-bit), mid-range (14-bit) and high-end (16-bit). For a list of devices divided by family, click here. Some easy to use and popular devices include the PIC16F876/877 and the PIC18F4520 microcontrollers.
Here are a few links which may provide further information: