1. 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.
    Dismiss Notice

Programming all PIC chips with PICkit 2

Discussion in 'Microcontrollers' started by richacm, Jun 5, 2008.

  1. BaCaRdi

    BaCaRdi Member

    Joined:
    Apr 7, 2008
    Messages:
    233
    Likes:
    2
    Location:
    Hoboken / NYC
    This doesn't support Linux for burning does it? I think I am stuck with the Micro's version do to the differences in chipsets. I would really prefer not to but I am in Linux running Eagle as well, so windows is just a VMachine.

    I would have love to get one of these tho! You do a great job and very good designs I have to say Blue, and a Man who can post his Schemo, in the public is always great with me:)

    Cheers m8, :D
    -BaC
     
    Last edited: Jun 6, 2008
  2. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    The PICkit2 & Junebug have some unofficial Linux support. Xiaofan Chens blog has plenty of links.
    Xiaofan's Blog
     
  3. BaCaRdi

    BaCaRdi Member

    Joined:
    Apr 7, 2008
    Messages:
    233
    Likes:
    2
    Location:
    Hoboken / NYC
    Fantastic, cheers going there now.

    -BaC

     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada

    There is a detailed Linux & Junebug article in issue #1 of JPUG (see the JPUG section of my website)
     
  6. BaCaRdi

    BaCaRdi Member

    Joined:
    Apr 7, 2008
    Messages:
    233
    Likes:
    2
    Location:
    Hoboken / NYC
    Thank you Bill.

    -BaC
     
  7. gramo

    gramo New Member

    Joined:
    Oct 2, 2006
    Messages:
    1,221
    Likes:
    23
    Location:
    Newcastle, Australia
    • Like Like x 1
  8. BaCaRdi

    BaCaRdi Member

    Joined:
    Apr 7, 2008
    Messages:
    233
    Likes:
    2
    Location:
    Hoboken / NYC
    Last edited: Jun 6, 2008
  9. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Unfortunately, Linux support for PICS is still not so good. Piklab works reasonably well, but there's no PICkit 2 debugging yet - only ICD2.

    Of all the computers here (too many), they're all Linux except one for accounting and video editing/DVD authoring and this one for microcontroller programming. All the good MCU tools are Windoze only. Some will run with Wine if you feel like fighting with it, but not enough.

    Sometimes when I get interested I have one Windows box for my MIDI/music studio. But lately all that stuff is collecting dust.

    Wish I could get rid of Windoze completely but it's impossible. Linux is great, but weak in certain areas.
     
  10. BaCaRdi

    BaCaRdi Member

    Joined:
    Apr 7, 2008
    Messages:
    233
    Likes:
    2
    Location:
    Hoboken / NYC
    It would have to be ported, no small job my any means. Yeah, I know ICD2 doesn't work, but if I can burn the hex from Linux, just one less thing on windows:)

    I have a VMachine for windows my Linux box is the host OS, so I just go on that just to debug for now. But when I do a program, It puts it out on the shared mount point, and my shell-script does the rest, including backup with tar.

    This way I can remove another task in win32..lol

    -BaC
     
  11. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
  12. BaCaRdi

    BaCaRdi Member

    Joined:
    Apr 7, 2008
    Messages:
    233
    Likes:
    2
    Location:
    Hoboken / NYC
  13. richacm

    richacm New Member

    Joined:
    May 19, 2008
    Messages:
    148
    Likes:
    0
    Location:
    Hamilton, New Zealand
    Just re-opening this thread again as I have a weird PIC problem with circuit I'm using to program the PIC.

    I am just testing the PIC16F877A with its own power supply. I have a 7805 in place which is outputting the 5V (5.14V to be precise) to the VDD pin. However the chip is not working. When I plug the PICKit 2 in to the circuit the chip starts working....then when I unplug the PICKit 2 it stops again. This is without even supplying a power source to the PICKit 2.

    One thing I noted is that when the PICKit 2 is plugged in the VDD drops down to 5.06V. Would this be causing it to work?

    Cheers,

    Craig

    EDIT: Just as a footnote. When I turn everything on and unplug the VDD connection to the V+ then the V+ is actually 5.06V. As soon as I plug in the VDD then the voltage goes up to 5.14V. Is this expected?
     
    Last edited: Jun 17, 2008
  14. futz

    futz Active Member

    Joined:
    Sep 15, 2007
    Messages:
    2,043
    Likes:
    24
    Location:
    Vancouver, B.C.
    Do you have a pullup resistor on MCLR? If it's not there you'll have trouble when the programmer is unplugged.

    It's not the voltage thing. Any voltage between around 3V (and change) and 5V plus a bit should be fine.

    That's not abnormal.
     
    Last edited: Jun 17, 2008
  15. gramo

    gramo New Member

    Joined:
    Oct 2, 2006
    Messages:
    1,221
    Likes:
    23
    Location:
    Newcastle, Australia
    If your using in circuit programming then have a look in the PK2 software package on how to sire up the circuit, theres a great wiring diagram there


    If your programming it separately (this is what I usually do), then you simply need to connect the following pins for use in the target circuit (don't worry about the external oscillator if your using the internal one)

    [​IMG]
    Note; (5 pins, positions vary for different PIC's, but the 18F1320 is shown above)

    You don't need a 10K pull up resistor on MCLR when it is not being used with ICP (in circuit programming), but you do need 5 volts to enable the cpu to stop continually resetting... This could very well be you fault!

    And to program the PIC, I use a breadboard like this,

    [​IMG]

    Handy as you can program almost every DIP package PIC easily :eek:
     
    Last edited: Jun 17, 2008
  16. richacm

    richacm New Member

    Joined:
    May 19, 2008
    Messages:
    148
    Likes:
    0
    Location:
    Hamilton, New Zealand
    Thanks heaps for the pointers. I actually found that the problem was caused by me not setting the B port in the code. If I initialise this (output) and set it to 0 then the PIC worked fine without the PK2 attached.
     
  17. karenhornby

    karenhornby New Member

    Joined:
    Feb 3, 2008
    Messages:
    101
    Likes:
    2
    I'm hoping to build a small circuit board JUST for programming the pic's nothing else
    how could I modify the circuit above?
    I was hoping to power the board from the usb port to save having a seperate psu (JUST for power +5V nothing else) would this work or not, or DO I NEED a 12v psu as well? I still cant figure out if I need to supply 12v or if the pickit somehow supplies that from the 5v usb port?
    I wont be doing in circuit programming, I'm hoping to build a small circuit board JUST for programming the pic's nothing else, do I need the xtal?

    What I've got is the pickit2 programmer, I've looked at the manual for the pickit but I'm as lost now as whebn i got it almost a month ago
    I wont be doing in circuit programming, I'm hoping to build a small circuit board JUST for programming the pic's nothing else, do I need the xtal?
     
  18. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    Take a look at my Firefly manuals schematic. It has a typical PIC ZIF socket adapter for most 8bit PICs.
     
  19. karenhornby

    karenhornby New Member

    Joined:
    Feb 3, 2008
    Messages:
    101
    Likes:
    2
    Do you mean like THIS? IF so can I power the PIC itself from the pickit2 or will I HAVE to supply a seperate 5v psu?
    [​IMG]
     
  20. davidbball13

    davidbball13 Member

    Joined:
    Feb 1, 2008
    Messages:
    399
    Likes:
    3
    Location:
    Up State New York
    were did you get your breadboard power supply and the heatsink for it
     
  21. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    168
    Location:
    Toronto, Canada
    That's it. The PICkit2 can supply about 100ma VDD which is plenty for programming.
     

Share This Page