PicKit3

Discussion in 'General Electronics Chat' started by Guinness1759, Jan 3, 2011.

  1. Guinness1759

    Thread Starter Member

    Dec 10, 2010
    64
    0
    Hi,
    I received the PicKit3 today and I have a few questions. In MPLab IDE, do you need to create project before you program the microcontroller? When I was using freescale microcontrollers, I could just write a .c file and program it with that file. I prefer to keep it as simple as possible since my program will only be about 100 lines.

    Should I select the PicKit3 from the select programmer menu? If anyone knows of quick start guide in video format let me know, since I learn better from video rather sorting though tons of help files.

    Also getting this error: "Target Device ID (000027a0) does not match expected Device
    ID (000028a0)." when selecting PicKit3 as a programmer.
     
  2. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    What is the big deal about creating a project? It is very easy.

    You need to select the PickKit 3 from the programmer or debugger menu, whichever environment you are compiling.

    You need to pick your target device. This is found under Configure/Select Device. Or it is done when you run the Project Wizard under Project.

    You probably have the wrong device selected.
     
    Guinness1759 likes this.
  3. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,866
    988
    Look for a publication called PICkit™ 3 Debug Express PIC18F45K20 – MPLAB® C Lessons. It is for the PIC18F45K20 but should apply. It will take you over the basics of MPLab and PIC programming.
     
    Guinness1759 likes this.
  4. Guinness1759

    Thread Starter Member

    Dec 10, 2010
    64
    0
    Think I'm finally making some progress now... The C Lessons are helping me.
     
    Last edited: Jan 4, 2011
  5. Guinness1759

    Thread Starter Member

    Dec 10, 2010
    64
    0
    It's giving me some errors when I try to compile. I noticed that a lot of tutorials want me to add a linker file. In the High Tech C compiler folders there is no linker file folder. Any ideas?
     
  6. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Guinness1759 likes this.
  7. Guinness1759

    Thread Starter Member

    Dec 10, 2010
    64
    0
    t06afre, In that guide, it wants me to select the C18 compiler. The MPLab CD came with the "High Tech C" compiler. I don't have the C18 compiler on my computer. Is the C18 compiler better than the High Tech C compiler that came with the the MPLab software?
     
  8. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Can you post the code for one of your examples? Before the C18 compiler was used in the debug express sample code. But it could be that Microchip has changed to HI-Tech C in the debug express examples. As HI-Tech now is owned by Microchip
     
    Guinness1759 likes this.
  9. Guinness1759

    Thread Starter Member

    Dec 10, 2010
    64
    0
    Here is a screenshot.

    http://i51.tinypic.com/2q8swig.jpg

    I'm testing the blink-led program.

    As you can see there is no linker project folder like in the C18 version. Does this mean that we don't need to use linker files?

    Maybe the easiest thing to do would be use the C18 version, since everyone seems to know how to get that one to work. Where can I download the free version of that?
     
  10. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Guinness1759 likes this.
  11. Guinness1759

    Thread Starter Member

    Dec 10, 2010
    64
    0
    I'm trying to program the PIC16F1827. I have no need to program the demo board. From the link you showed, it looks like I'll have to use the High Tech C compiler. Any ideas?
     
  12. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    But the code you showed me where does it come from? Using HI-Tech C is not problem. I do it. But your code is for Micro-C. And it is many differences between Micro-C and HI-tech C. You have to port the code ;). For using HI-Tech C it is a folder named docs in the instal folder. Here you will find the manual and the quickstart.pdf among other documents
     
    Guinness1759 likes this.
  13. Guinness1759

    Thread Starter Member

    Dec 10, 2010
    64
    0
    Ah yeah :)

    When you go to Configure and Configuration bits and set the register values, any ideas where that file is stored in the project?
     
    Last edited: Jan 4, 2011
  14. Guinness1759

    Thread Starter Member

    Dec 10, 2010
    64
    0
    I think I found the answer to my first question. For example here: http://www.elexbook.com/tutorials/003/003_Blinking_LED_PICC.php

    __CONFIG(HS & WDTDIS & MCLREN & UNPROTECT & LVPDIS & DEBUGDIS);
    /* External High speed clock, Wathcdog Off, MCLR Enabled, Code unprotected,
    Low voltage programming OFF, INTIO for internal OSC */


    But how do you get these codes?
     
  15. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    They are at the end of header file always I think. But in HI-Tech C many MCUs share the same header file. You have to open the pic.h file to find out which header file that is used. Refer to the MCU datasheet for more info about the settings.
     
    Last edited: Jan 4, 2011
    Guinness1759 likes this.
  16. Guinness1759

    Thread Starter Member

    Dec 10, 2010
    64
    0
    Thanks for the help. I got the blink LED program working now :) And I've figured out everything that I need to start programming. This is my first time using Microchip and I'm excited about how much simpler everything was to setup and use. I used Freescale before and they are a pain in the neck. Have a good day.
     
  17. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Then I first started with PICs. I felt like a fish on land. It is normal that things start kind of slow.
     
Loading...