Hardware of software problem?

Discussion in 'General Electronics Chat' started by bug13, Dec 6, 2012.

  1. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    So today the PCB for my project arrived, all look good, but One of the incremental rotary switch stop working after 1 minute or so. It starts working if I reprogram the MCU or I touch the programming header on the PCB.

    I suspect it's my PCB layout problem, is this possible? (My code should be fine, because I use the same code for the other rotary and it works all right)
     
  2. SPQR

    Member

    Nov 4, 2011
    379
    48
    It sounds like you might have a cold solder joint. (you touch something and something changes).

    Have you checked all the joints, and/or resoldered?
     
  3. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,016
    Unless you post your schematic, code and what you have done to troubleshoot the problem, the best anyone can do is guess what your problem is.

    But the above souns like a good guess.
     
  4. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    Well, if the switch quits working after the same length of time, or after some amount of usage, every time you run the unit, it's software. It just has to be.

    Try running it until the switch quits, then reset the processor without jarring the board, and see if it comes back. If it does, then it was the reset that cured it, not any sort of mechanical shock. And so it must be in the software.
     
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    This may also be a floating input: touching it or near it "drives" it to a good value,later it drifts to something that doesn't work.
     
  6. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,365
    To follow up on ErnieM, look for a pin that has not been soldered. Done it myself.
     
  7. bug13

    Thread Starter Well-Known Member

    Feb 13, 2012
    1,208
    38
    Ok it's a software problem, in the header define section, I have assigned a wrong port in a #define code.

    but when I check, I do have a cold join on the other pin not related to this.

    Thanks guys, very appreciate it. :)
     
  8. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,016
    And you were so sure it was not a software problem. :)
     
  9. WBahn

    Moderator

    Mar 31, 2012
    17,777
    4,805
    You can't be using the same code otherwise you would be talking to the other rotary switch.

    The point is that there ARE some differences in both the software and the hardware that distinquish the two. Look carefully at the differences IN BOTH realms as your first target of investigation.
     
    bug13 likes this.
Loading...