Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Programming PIC

Status
Not open for further replies.
Hi,

I am absolutely new to PIC microcontrollers. I am trying to use the PIC18F452 in my project but have very little clue on how to start programming it. Any books, links that could help would be very much appreciated.

There's MPLAB in the lab at school so any information about this and other software/hardware required would be great.

Thanks.
 
Hi,

I am absolutely new to PIC microcontrollers. I am trying to use the PIC18F452 in my project but have very little clue on how to start programming it. Any books, links that could help would be very much appreciated.

There's MPLAB in the lab at school so any information about this and other software/hardware required would be great.

Thanks.

PIC programmer software, and PIC Tutorials at:
WinPicProg Page

Elmer 160 Home Page
 
You could also use Microchip's own programmer, the PicKit2 (I note there is a PicKit3 now as well by the way). After years of uisng home built programmers with varying degrees of reliability, I bought the PicKit because it's very cheap - I paid 20UKP for it but I bet in the US it's 20 dollars or thereabouts. It seems to be a fairly well kept secret, this one. So far, I've found it to be 100% reliable. It's also compatible with the Microchip in circuit debugging tools, if you're using their C compilers anyway (I'm not!).

-CF

[PS Edit - I'm using the Sourceboost IDE - again, V cheap; write code for PIC12 - 18 range in C, free RTOS with the pro licence :)]
 
Last edited:
Do you know how to program and if so in what language ?
Are you required to use a specific language ?

Answers in order... Yes, any, no....

However that's not very useful so here's some more info:

Programming skills can only be gained by reading and experience (or tutorship if you want to pay for it). Fortunately, there are literally thousands of books on how to do this, more of which later.

PICs are usually programmed in one of two languages - PIC assembly, or C. Assembly is a low level language that allows you to explain to the PIC what to do in simple step terms. In the case of the PIC, the assembly language is called RISC or reduced instruction set code. The PIC will generally execute one instruction per clock cycle.

C or another high level language is closer to English in a way and allows you to write programs that are more readable. There are many others - Ada, Pascal, Fortran, Cobol etc etc etc... the list is long. But C is the most common for microcontroller projects. The exact **VERSION** of C that you get depends on who wrote the compiler but hopefully they should all be more or less standard (what's known as ANSI C compatible). Despite this, some of the incompatibilities that do exist can make it sometimes quite awkward to translate from one version to another.

There are many resources for learning C. Getting back to books as I promised, there is one that I have seen which goes through this in relation to the PIC in a very simple, project-based and step by step manner. If you were to get a hold of that, you wouldn't be going far wrong. Unfortunately I can't remember the title, maybe someone else will and post it here, but I think it's called the PIC C Cookbook or something like that.

Overall though, I think programming's easy to do - albeit overly mystified a lot of the time. When you get into it, most things will be straightforward. Look for that book!!

-CF
 
PIC hardware programmers :

**broken link removed**
**broken link removed**

And many more if you search, but these two works for me without any problem. I suggest to start with 16F family if don't have any background in PIC MCUs. 16F84 or 16F876 are good starting points with less price.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top