Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Starting learning PIC18F

  1. Oct 21, 2009 #1
    Hi, now i want to learn about the PIC18F series microcontroller. Can anyone teach me where i need to learn 1st? Is it the C programing or the structure of PIC18F? Can introduce me some reference source or book? Thanks. ^^
  2. jcsd
  3. Oct 21, 2009 #2
    you need to be familiar with basic C, and then need to learn the basic block diagram of the PIC to get the idea of its topology or layout. This can be found in the datasheet of the PIC, easily found on the internet. Also it's a good idea to read it from top to bottom.

    might need a development board, and the programmer too,

    look around this site - it has pretty much everything you need.

  4. Oct 21, 2009 #3


    User Avatar
    Science Advisor

    Do you, in fact, have a C compiler for the PIC18? Something like Microchip's own C18 compiler, or the CCS Compiler, or some such? Because otherwise, you should be using assembly (the opcodes are in the back of any of the PIC18 datasheets--the full sized several hundred page ones, not the 20 page 'brief introduction' documents). If you were using an ATMEL, there would be the GCC compiler instead (there is no official GCC port to PICs because of underlying design constraints).

    From a pedagogical (i.e. educational) point of view, assembly language is good because it gives you a deeper understanding of what happens at the hardware level. From a functional point of view, it's probably easier to bang something out and debug C code.

    Note that, if you are a student, you can get a student evaluation version of the C18 compiler (from Microchip) which, when it expires after a few months, is still functional, if not as optimized as the full version (this was true as of a few years ago, at any rate):

    EDIT: There are other threads which mention PIC-derived development boards which are easier to work with, and offer, for instance BASIC support. Perhaps someone will mention one of those later in this thread, or point out one of the preexisting ones?
    Last edited by a moderator: Apr 24, 2017
  5. Oct 21, 2009 #4
    Thanks. Actually i got CCS program and the MPLAB C compiler, i want to learn how to control a robot or cansat by using the PIC18F. May i have any books reference for the basic C programming?
  6. Oct 21, 2009 #5


    User Avatar
    Science Advisor

    You could try the C Programming Wiki book:

    A (professional) programmer friend of mine is a big fan of the O'Reilly series of books, which happens to have Practical C Programming, Third Edition by Steve Oualline:

    Looking at the Amazon page for that, there seem to be a few higher-ranked introductory C programming books than that, including the 20-year old Kernighan and Ritchie, which still seems to be quite popular:
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook