16F877A won't keep relay on 100% of the time


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Try removing the relay and use an LED with a resistor. If the LED works, your code is OK and the relay coil is the culprit. I've had interference problems with small vibrating motors located very close to the PIC.

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Lightbulb Some ideas ...

    Hi, Coyote

    1) Did you try to use HIGH Portx.y ...

    I noticed many times it is much more reliable than Portx.y = 1 in disturbed circuits ...

    2) @ 20 Mhz, you also could try PULSIN instead of count ( as it is a square wave )... nominal result will be 20 ... and there will be a little less "rollover" issues ...

    3) The ideal way would be to use the "capture" feature of the CCP modules ... in a '877 there are two modules !! ...

    Darrel's instant interrupts are ... the easy way ... to make that. And it takes much, much, much less CPU time ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Feb 2005
    Location
    Essex, UK
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi, Coyote

    1) Did you try to use HIGH Portx.y ...

    I noticed many times it is much more reliable than Portx.y = 1 in disturbed circuits ...
    That's interesting! I learn something new every day! Nice one!

    Cheers

    Rob

Similar Threads

  1. First time with external oscillator - 16F877a Not working
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 15th October 2009, 17:14
  2. I don't understand this code!
    By Russ Kincaid in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 13th February 2008, 02:55
  3. Serial Relays
    By tazntex in forum General
    Replies: 3
    Last Post: - 17th May 2007, 17:42
  4. Serout2/serin2 Pbp Problem
    By SOMRU in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th December 2006, 19:55
  5. Timer in real time
    By martarse in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th July 2005, 14:24

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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