Connect with us

Do PIC pins just... die?

Discussion in 'Electronic Design' started by Peter S. May, Jul 20, 2007.

Scroll to continue with content
  1. Peter S. May

    Peter S. May Guest

    (I'm sorry if this is off the topic of design. Please post a detour
    sign if you're upset...)

    If some arbitrary pins on PORTA of a PIC16F88 didn't seem to be
    outputting any signal even though your program told them to (including
    having already set them to output by clearing TRISA), would you
    automatically assume they were hosed?

    A chaser program is on the two '88s I have. In both cases, all of PORTB
    works as expected. A couple of PORTA pins also work, but it's not the
    same pins on each of the two chips, leading me to believe some
    unintended entropy is in play.

    Also confusing is that one of the nonfunctioning pins on both is the
    /MCLR pin, which has to be at least somewhat functional or else the
    programming wouldn't be continuing to take. (But I suppose the
    switching mechanism among that pin's various functions could still work
    without one of the functions itself working.)

    Thoughts? :-/

  2. Did you remember to clear ANSEL?
    Output pins can be killed.
    When using MCLR as an I/O pin, it only works as an input.
  3. Phil Hobbs

    Phil Hobbs Guest

    <ignorance warning>
    I've never used a 16F88, but I did teach myself to program 17-series
    PICs some years ago (back when the 17 series was the latest and
    allegedly greatest, naturally).

    It sounds as though there's a configuration register that you aren't
    setting up properly in your startup code--i.e. some of your 'outputs'
    are programmed to be inputs.


    Phil Hobbs
  4. Peter S. May

    Peter S. May Guest

    Well, don't you win the Helping Hand award for the evening? This
    immediately fixed all problems _except_ RA5/Vpp/!MCLR. Still trying to
    figure out that one, though...bit 5 of CONFIG1, MCLRE, is cleared, so
    RA5 is supposed to be I/O. I even ran a version of the test with that
    bit set, and it ended up not running unless set high (as expected).

    So, there's apparently nothing physically wrong with the pin itself, but
    I'm not entirely sure about what's behind it. Do you think there is
    anything else I ought to check?

    Thanks a zillion
  5. Peter S. May

    Peter S. May Guest

    I just caught this one. Never mind... Jeez, they really need to be
    louder when they say some of their pins are input-only!

    All right, so my chips are working as intended, and I don't have to go
    to bed worried. Thank you!

  6. The other one that catches a lot of people, is AN4, which on many of the
    slightly larger PICs, is an 'open collector' style output (pull down
    The permutations and variations on PIC pins, is one of the 'delights', of
    this product...

    Best Wishes
  7. Rich Grise

    Rich Grise Guest

    No. I'd take a nap or go watch TV or have a drink or something and
    come back a few hours later and triple-check my wiring. :)

    Good Luck!
  8. Rich Grise

    Rich Grise Guest

    OK, Anthony solved it for you - but now my advice is even _more_
    applicable - while taking your nap or watching your show, you don't have
    to fret about getting the thing running. ;-)

  9. Apart from the other good advice, check the stepping number on the chip.
    I.e: "it worked before, now it does not" or "it works in the programmer and
    on the bench, not in the Job".

    I had major strangeness because of changes between revisions of silicon that
    required updates to the programmer ;-)
  10. One of the most irritating debugging sessions I experienced was with a
    PIC that I had bought (a few pieces for development) 8 months or so
    earlier. When we actually got around to finishing the development
    there were persistent issues one of the peripherals. I finally
    narrowed it down to a silicon bug, but Microchip had already
    eliminated all traces of the errata from that stepping from their
    website, and I had not archived the errata and datasheets since it
    wasn't in production. One of the earlier errata was still floating
    around the net (on a University website).

    Best regards,
    Spehro Pefhany
  11. krw

    krw Guest

    I had a similar episode some years back. I was pulling my hair out
    trying to get an 8051 variant to wake up on interrupt. It simply
    wouldn't. It got to the point that I was calculating battery life
    with the processor constantly running (it was a CMOS variant) and
    trying to figure out how to squeeze enough elsewhere to make the
    budget. Seeing my frustration my boss asked if he could help. Sure,
    here's the databook, handing him a new one off the shelf. Next day
    he comes in pointing at a paragraph describing pretty much my
    problem, but saying that it was too obvious. "Wait just a minute!"
    "That paragraph isn't in my copy!". My dog-eared and marked-up copy
    was slightly older and didn't have all the secrets of the brew.
  12. SparkyGuy

    SparkyGuy Guest

    I had a similar episode some years back. I was pulling my hair out
    Don't these companies have an application support engineer that will answer
    such questions? Seems that it might have saved time...

  13. Tim Wescott

    Tim Wescott Guest

    I have found it useful to get the name of the first competent guy you
    find, then call him directly.

    Or just figure it out myself, because as you said the front line is
    pretty unhelpful.


    Tim Wescott
    Wescott Design Services

    Do you need to implement control loops in software?
    "Applied Control Theory for Embedded Systems" gives you just what it says.
    See details at
  14. Whenever I've done that I've found the people you can contact easily
    tend to be less knowledgable than I am-- junior engineers who have a
    very shallow knowledge of a lot of products, and are capable of
    dealing mostly with questions that should not have been asked in the
    first place (sort of gatekeepers). Eventually, if you persist, and
    have the time to work at it, you can usually drill down to someone who
    knows a lot, but it might take days, and even they may not be entirely
    candid with you if it looks like something that's their fault.

    There are probably some designers who develop a relationship with the
    FAE for a particular product line and use it for hand-holding through
    the process, but I suspect most of us don't (and perhaps can't) work
    that way.

    Best regards,
    Spehro Pefhany
  15. krw

    krw Guest

    They will answer if you find someone who knows. We had direct
    contacts but none were of any practical help. "Should work" isn't
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day