How to Program a PIC Microcontroller Without a PICkit 3 Programmer
Introduction
Programming a PIC microcontroller can be a rewarding experience, especially when you have specific requirements and constraints. In this article, we'll explore how to program a PIC microcontroller using an Arduino Uno or directly through USB, without a PICkit 3 programmer. This method can be a viable alternative for those looking for flexibility and independence in their projects.
Alternative Method: Controller Development with Arduino Uno
While the traditional method involves using the PICkit 3 programmer, it's possible to achieve your goals using alternative methods. One such method involves using an Arduino Uno as a microcontroller development platform. Here's a step-by-step guide to help you get started:
1. Select a Suitable PIC Microcontroller
The PIC16F72, for instance, is a popular choice among hobbyists due to its versatile I/O and peripherals. If you already have a bundle of these chips, they can be a cost-effective and suitable choice for your application, especially if they are still appropriate for your project's requirements.
2. Obtain a Third-Party PICKit 3 Programmer
Another viable option is to purchase a third-party copy of a PICKit 3 programmer/pod and obtain the firmware from the Microchip website. This approach can be more accessible and cost-effective compared to purchasing a brand-new programmer. Although older, such second-hand programmers can be acquired at a lower price on platforms like eBay.
3. Download and Install Programmer Software
Once you have your programmer, you will need to download the appropriate software package from the Microchip website. This software is essential for configuring and using the programmer to flash the PIC microcontroller. Make sure to follow the installation instructions carefully to avoid any issues.
4. Connect the Programmer to Your Computer
Connect the programmer to your computer via a USB port. The programmer will typically come with a compatible software package that will allow you to interface with your computer and flash the microcontroller. Follow the prompts in the software to configure the programmer and connect it to your computer.
5. Design and Build Your Custom Board
Using a custom board layout and design tools such as DipTrace, create and design a board layout that includes the required connections for your microcontroller and programmer. Pay attention to the specific pin connections needed for programming and ensure they are correctly routed on your board.
6. Program the Microcontroller
Once your board is designed and built, you can program the microcontroller using the programmer software. Ensure that the correct pins are configured for programming, and follow the software's instructions to flash the desired program onto the microcontroller. This process may involve power cycling the microcontroller and sticking to specific pin configurations.
Note that while some programmers may require you to use a zero-insertion-force socket for programming, others may allow direct connections to the microcontroller's pins. Refer to your specific programmer's documentation for detailed instructions.
Dealing with Legacy Controllers and Upgrading Your Programmer
If you're working with legacy controllers or want to move to a more advanced programmer in the future, Microchip offers several options. The MPLAB ICD5 is an upgrade from the ICD3 and offers a more user-friendly interface, but it comes at a higher cost. If you're just starting out, you might consider the PICKit 5, which is more affordable and compatible with older PIC controllers.
Keep in mind that newer programmers like the ICD5 may offer additional features such as in-circuit debugging and surface mount programming. However, for many hobbyists and beginners, a basic programmer like the PICkit 5 is sufficient.
Conclusion
With the right tools and a bit of patience, programming a PIC microcontroller can be a hassle-free process. By using an Arduino Uno as a development platform or acquiring a third-party PICKit 3 programmer, you can enjoy the rewards of programming PIC microcontrollers without the need for a standard hardware programmer. Happy coding and good luck with your projects!