Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Flash PIC16F688 In-Circuit

  1. #1
    Join Date
    Feb 2009
    Location
    Plymouth, MN
    Posts
    8,019

    Default Flash PIC16F688 In-Circuit

    With the new Renard Start_Addr firmware, I thought it might be helpful to come up with a way to flash the pic while it was on the board. My thinking was that there would be less wear-and-tear on the chip itself, since those little pins can bend pretty easily.

    I cobbled together this solution. I had an old 16-pin test clamp, and I took a piece of cat5, soldered some connectors to wires on both ends, plugged it into my PIC programmer and then clamped it onto the 16F688 in my SS24 when the SS24 was NOT powered up. I was able to read the chip, erase it and reflash it very easily.

    The closeup of my PIC programmer shows the ICSP header pins, and after a little research, I tried the following, which seemed to work fine for the 16F688 chip. Reading the PIC programmer's pins from left to right:

    LOW - no connection
    PGC - to pin 12 (RA1/ICSPCLK)
    PGD - to pin 13 (RA0/ICSPDATA)
    GND - to pin 14 (VSS)
    VCC - to pin 1 (VDD)
    VPP - to pin 4 (RA3/MCLR)

    This was just a test to check for feasibility and it worked out very well. Now the task is to make a more permanent connector and cable, and hopefully one that isn't as stiff as the cat5.
    Attached Images Attached Images
    Last edited by dirknerkle; 04-06-2010 at 10:15 PM. Reason: Typo
    dirknerkle

    The DIGWDF Store is the place to go for wireless stuff for Renard... controllers, adapters... or other junk that
    nobody else would probably ever make. It's all in stock right now at http://diychristmas.org/store

  2. #2
    Join Date
    May 2007
    Location
    Apple Valley, MN
    Posts
    3,191

    Default Re: Flash PIC16F688 In-Circuit

    I made one similar except for surface mount. I used flat 6 wire CAT3 cable soldered directly to the clip strain relieved it with 5 minute epoxy. My programmer uses a 6 pin RJ11 connector. I usually make these about a foot long because it seems to be the most manageable length.

    I made one that was two feet long and it worked without issue but I found that it easily got caught on everything.
    A mediocre person tells. A good person explains. A superior person demonstrates. A great person inspires others to see for themselves.

    Click here to show/hide my display details ...
    Click here to show/hide DIYC Links ...

  3. #3
    Join Date
    Sep 2008
    Location
    Baulkham Hills, NSW
    Posts
    2,241

    Default Re: Flash PIC16F688 In-Circuit

    Great solution to an awkward problem.
    I also use both:
    • 8 pin DIL for Tiny13 in my Ikea Mood lights
    • 20pin Soic for my RGB Kittys.
    The 3M clips have a strong spring in them and after programming 50 chips your fingers get sore, and the push on terminals break. I end up soldering them.

    The Blue T&B clips are easier to use.
    Matt

    You too can become a Supporting member of DIYC.
    Check it out here

    Baulkolites.com is going to close - my new site is MyNoelLights.com

  4. #4
    Join Date
    Nov 2007
    Location
    Middle Earth
    Posts
    2,251

    Default Re: Flash PIC16F688 In-Circuit

    I don't know why the ISCP header was never put on the renard boards.. I always put it on any boards i design, just leaving the pads, and not even putting a plug in.
    stellascapes - LED lighting solutions for the Prosumer, Commercial and Entertainment Industries.
    Doing pixels first since 2009 with just another megatree.
    Follow us on Facebook at www.facebook.com/stellascapes
    web: www.stellascapes.com

  5. #5
    Join Date
    May 2007
    Location
    Apple Valley, MN
    Posts
    3,191

    Default Re: Flash PIC16F688 In-Circuit

    I don’t bother with the ISCP header on any of the boards I make for myself. For something that’s seldom or never used again, I don’t find the extra space necessary.

    If I was going to make a lot of boards that I would be changing a lot, I would just make a fixture with pogo pins. Since I have the CAD files, it’s nothing to make a drill plot for the pin locations. I usually use a CNC machine to make such a fixture, but I’ve also just printed the locations and used it as a template for hand drilling.

    I guess it’s all in what you like, have always used or what you feel is necessary.
    A mediocre person tells. A good person explains. A superior person demonstrates. A great person inspires others to see for themselves.

    Click here to show/hide my display details ...
    Click here to show/hide DIYC Links ...

  6. #6
    Join Date
    Jan 2008
    Location
    Fountain Valley, CA (Orange County, So. Cal)
    Posts
    1,744

    Default Re: Flash PIC16F688 In-Circuit

    Quote Originally Posted by dirknerkle View Post
    The closeup of my PIC programmer shows the ICSP header pins, and after a little research, I tried the following, which seemed to work fine for the 16F688 chip. Reading the PIC programmer's pins from left to right:

    LOW - no connection
    PGC - to pin 12 (RA1/ICSPCLK)
    PGD - to pin 13 (RA0/ICSPDATA)
    GND - to pin 14 (VSS)
    VCC - to pin 1 (VDD)
    VPP - to pin 4 (RA3/MCLR)

    This was just a test to check for feasibility and it worked out very well.
    Will that work with more than one PIC on the board? for example, if there are multiple PICs that are sharing VSS, VDD and RA3, do you need to make sure that VPP only goes to one of the PICs while it is being flashed?

    don
    Click for display details >>
    web site: http://www.eShepherdsOfLight.com or http://www.facebook.com/eShepherdsOfLight
    technical articles: http://downloads.eshepherdsoflight.com

  7. #7
    Join Date
    Feb 2009
    Location
    Plymouth, MN
    Posts
    8,019

    Default Re: Flash PIC16F688 In-Circuit

    Quote Originally Posted by djulien View Post
    Will that work with more than one PIC on the board? for example, if there are multiple PICs that are sharing VSS, VDD and RA3, do you need to make sure that VPP only goes to one of the PICs while it is being flashed?

    don
    It's a good question. I think the best idea is to flash the chip with the board powered off. Pins 12 and 13 are not shared by any other PIC and I believe that's enough to keep it local to the PIC in question.

    But you have piqued my curiosity... I'll have to give it another test. ;)

    EDIT: I reflashed the 1st PIC on an SS24 with the diagnostic code (so I could tell the difference) and it flashed only the chosen PIC and nothing down the line.
    Last edited by dirknerkle; 04-11-2010 at 12:17 AM. Reason: Added verification note
    dirknerkle

    The DIGWDF Store is the place to go for wireless stuff for Renard... controllers, adapters... or other junk that
    nobody else would probably ever make. It's all in stock right now at http://diychristmas.org/store

  8. #8
    Join Date
    Jan 2008
    Location
    Fountain Valley, CA (Orange County, So. Cal)
    Posts
    1,744

    Default Re: Flash PIC16F688 In-Circuit

    Quote Originally Posted by dirknerkle View Post
    I think the best idea is to flash the chip with the board powered off.
    I was looking at a board where the VSS pins were all on a common trace and the VDD pins were all connected with another trace, so if one PIC had power then they all would. In that case, is there a distinction between one PIC having power vs. the whole board having power?

    Quote Originally Posted by dirknerkle View Post
    Pins 12 and 13 are not shared by any other PIC and I believe that's enough to keep it local to the PIC in question.

    But you have piqued my curiosity... I'll have to give it another test. ;)

    EDIT: I reflashed the 1st PIC on an SS24 with the diagnostic code (so I could tell the difference) and it flashed only the chosen PIC and nothing down the line.
    Thanks for checking that! I have a board with multiple PICs on it that I was trying to fit in a 2-pin header on the VPP line that could be shunted or not, but if that is not needed then that will make the ICSP connections simpler.

    don
    Click for display details >>
    web site: http://www.eShepherdsOfLight.com or http://www.facebook.com/eShepherdsOfLight
    technical articles: http://downloads.eshepherdsoflight.com

  9. #9
    Join Date
    Oct 2008
    Location
    San Jose, CA
    Posts
    7,763

    Default Re: Flash PIC16F688 In-Circuit

    The MCLR line (pin 4) is also required for programming but since it is tied together on most Renards (it's the ZC input) you will hold all the PICs in reset mode at the start of programming. Since the ICSPCLK and ICSPDATA lines (pins 12 and 13) are separated from each other this should allow you to program each PIC separately. This is how I am planning to program my boards that have 6 PICs on them since I did not want to tie up space/cost for an ICSP header for each.
    Brian

    Christmas in San Jose! - WEB - FB - VIDEOS
    Halloween in San Jose! - FB
    2013 Halloween Show - Homemade tombstones, Grave Crawler, 2x 3-axis skulls, Video Projection
    2013 Christmas Show - 5x E681-12, 1x Ren48LSD, 30x 42 TLS3001 pixels, 4x 50 GECE C9, 4x Rainbow Floods, 2x DIYC Floods, SuperPixelStar... - no AC stuff!

    Ignorance is Temporary - Stupidity is Forever...

  10. #10
    Join Date
    Feb 2009
    Location
    San Antonio, TX
    Posts
    128

    Default Re: Flash PIC16F688 In-Circuit

    The next question is whether the programmer (PICkit or similar) has enough current available to hold all the PICs (8 for Ren64XC) at Vpp, plus power the whole circuit through Vcc. On some boards the programmer might see the PIC, a diagnostic LED, and an opto coupler load on the clock and data lines.

    But this ain't NASA, so try it and see what color the smoke is.
    (yet another Don)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •