mplab 8 beginning

Discussion in 'Embedded Systems and Microcontrollers' started by simeonz, Jul 6, 2013.

  1. simeonz

    Thread Starter Member

    Jan 26, 2013
    31
    0
    Hello all

    I have started microprocessor this summer, I try arm, now I try microchip.

    I wish to try to copy the tutorial from this website and begin programming my pic24fj32gb002.

    I wish to program it in c, using free programs mplab8 and c30.

    I am using pickit3, I have wired it up correctly, I can connect to it, 10 k pullup is there etc...all working.

    I simply cannot have a source file that displays correctly where it is supposed to, I try following this simple guide... as you can see, his source files simple appears ready to write in it.

    http://www.technoburst.net/2011/05/pic-programming-in-c-with-mplab-ide.html


    Perhaps the directory must be somewhere special ??

    Can somebody tell how exactly to make leds flash using pic24fj32gb002 with all free mplab tools, or better yet simply an already written led flash that I can just program to my target immediatly.

    thx you
     
  2. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    You need to add the source files yourself... right-click the folder and select "Add existing file"(or something along those lines) and add the files....

    You may want to try starting off with a 16 or 18 series PIC, they do not have quite so many quirks associated with them...
     
    DerStrom8 likes this.
  3. simeonz

    Thread Starter Member

    Jan 26, 2013
    31
    0
    thx

    I already bought 2 of these from digikey, it cost me 20$.

    and these have a multiply and divide hardware.
     
  4. simeonz

    Thread Starter Member

    Jan 26, 2013
    31
    0
    how do I add the files ??

    There is no add existing files, how to create file with .c extension ??
     
  5. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    Go to your compiler's installation directory, and look for the ".h" folder. That will contain your header files. In your project window (the one with the folders labeled "Source Files", "Header Files", "Object Files", etc) right-click on the "header files" folder, click "add files", and add all the necessary header files for your particular project.

    Start a new C file by going to file-->new and save it as a .c extension. Then you need to add that .c file to your "source files" folder using the same method as adding the header files.

    Matt
     
  6. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    File->New

    then, File->Save As... and add the name - do not forget the extension, it will not save a default extension for you!
    [​IMG]

    then, add the file to your workspace:
    [​IMG]

    ... and you are done...
    [​IMG]
     
    absf likes this.
  7. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    This is a video I made a while ago about how to start an mplab project. I use a different compiler and chip, but the process should be about the same.

    https://www.youtube.com/watch?v=CAQ_ek1GAos&feature=player_detailpage#t=7s

    Also, please excuse the crudity of this video. It was one of my first, done on an old computer that didn't work very well :p

    Hope this helps.
    Matt
     
  8. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    Ooh, tshuck, you beat me to the punch with pictures! :p
     
  9. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Faster to make than a video!:p
     
  10. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    True, though this video was already made :D

    Guess I'm finally starting to slow down, computer-wise.... :rolleyes:
     
  11. simeonz

    Thread Starter Member

    Jan 26, 2013
    31
    0
    thx you all, progress comes so slowly I am in debt, have any questions I can give advice about other things, thx guys.
     
  12. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    There's no debt at AAC. We're all here to help out. Feel free to browse the forums though and see if you find any questions you know the answers to. :)

    Regards,
    Matt
     
    tshuck likes this.
  13. simeonz

    Thread Starter Member

    Jan 26, 2013
    31
    0
    I suck @ finding answers fast.

    I work out the solution slowwwwlyy.
     
    Last edited: Jul 9, 2013
  14. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    ...and there's nothing wrong with that. Having the tenacity to finish the problem is what separates the engineers from the business majors. Speed comes with experience and exposure, take your time and understand why you do something a certain way.
     
    DerStrom8 likes this.
Loading...