Mikroc for pic help needed!!!!!!!!!!

Discussion in 'Programmer's Corner' started by mailus, Jul 28, 2012.

  1. mailus

    Thread Starter New Member

    Jun 16, 2012
    19
    0
    hello,,,,
    i am beginner to microcontroller. i want to learn programming throw mikroc.
    any body help me..... give some examples

    doubt in pic16f84

    how to read a switch from port A.
    how to set RB0 as input & RB1-7 as output.
     
  2. DumboFixer

    Active Member

    Feb 10, 2009
    219
    34
    Have you tried looking at the website for the people who supply the MikroC compiler ?

    http://www.mikroe.com/

    There you can download examples of programs written in MikroC
     
  3. JohnInTX

    Moderator

    Jun 26, 2012
    2,341
    1,024
    Download the data sheet and read section 4 first. Even with C you have to know something about the underlying hardware.

    After that, you'll have to rough out a problem-solving strategy (flow chart etc) that identifies all of the parts of your problem and create a step by step procedure to solve it. This step does not require a PIC, compiler or even a programming language. A pencil and paper will do.

    Presumably, you know something about C. If not, learn the basics of its syntax and some common constructs (variables, loops, function calls etc).

    Once you know what you have to do, combine what you have learned about the PIC I/O (how to use it and what it can do) with the C language as described by your compiler and write code that fits the job.

    There are lots of examples here that do simple things like flashing an LED. While you can learn a lot from reading good code, the best examples for learning are the ones you write and debug yourself.

    I'm not familiar with your compiler but you should take a look at MPLAB-X with a free compiler and lots of tutorials.

    Its a step-by-step process, have fun!
     
Loading...