introduction to pic programming in c

Welcome to Our Tutorial

My goal is to create several tutorials, increasingly more difficult, leading up to a major project (I have one in mind, but it may change). The tutorials will start with assembly and will likely lead> to C code.

For the assembly tutorials, my assumptions are that the reader has:

  • Some intuition with Windows
  • Some understanding of C/C++ (preferable)
  • Some understanding of circuits (I will try to provide external links for most new things I mention)
  • Little or no understanding of assembly language (at least at the beginning)

Since most of the PIC basics are explained very well in the PIC datasheet, I would highly recommend looking over it. It can be found here. Specifically, Section 10 describes the I/O ports and Section 26.1 describes the instruction set.

After unsuccessfully trying out several DIY programmer designs, I purchased a PicKit 2 from Allied Electronics and am VERY happy with it. Unlike these serial/parallel port DIY programmers, this USB device supports high voltage programming, debugging and works with laptops without any hassle.

I will be working with the following until further notice:

  • PIC18F4550
  • PicKit 2
  • MPLAB IDE V8.00
  • MPASM V5.14

I hope to do several small projects with MPASM to get comfortable with assembly language programming. Afterwards, I plan on using either the SDCC C compiler or the student edition C compiler created by Microchip. The tutorials will focus on MPASM/PicKit2 with the 18F4550, but the general instructions should be applicable for most 18 series devices.

Much of my own progress has stemmed from the Microchip 16F tutorials and with the help of the friendly people at the Microchip support forum. However, unless noted all the tutorials here are my own work. Any similarities come from the fact that there are only so many basic concepts (and only so many best ways to do them).

Comments

dfgdfsgdfgfdg

You may also like...