Strangely behaving 16F877a


Closed Thread
Results 1 to 5 of 5
  1. #1

    Question Strangely behaving 16F877a

    Hi
    I am using an external oscillator 4MHz. My program simply toggles one pin every 30ms.
    Problem is that I see sometimes the toggling if I touch the PIC,leg of the capacitor (earth) or touch the bench the circuit is left on and sometimes it works fine and sometimes the led is just on constantly.

    What could be the reason for this???
    Last edited by financecatalyst; - 15th October 2009 at 00:19.
    ___________________
    WHY things get boring when they work just fine?

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by financecatalyst View Post
    Hi
    I am using an external oscillator 4MHz. My program simply toggles one pin every 30ms.
    Problem is that I see sometimes the toggling if I touch the PIC,leg of the capacitor (earth) or touch the bench the circuit is left on and sometimes it works fine and sometimes the led is just on constantly.

    What could be the reason for this???
    My first impulse would be stray capacitance. Pins should be pulled high or to ground with resistors and never left floating.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3


    Did you find this post helpful? Yes | No

    Question

    Quote Originally Posted by Joe S. View Post
    My first impulse would be stray capacitance. Pins should be pulled high or to ground with resistors and never left floating.
    You mean all the remaining 36 Pins? If you do then please can you also advise me suitable values.
    Thanks
    ___________________
    WHY things get boring when they work just fine?

  4. #4


    Did you find this post helpful? Yes | No

    Default

    any resister from 1K to 100K... anything to pull the pin to ground...
    You could just wire them straight to ground, but you need to remember to set all the pins to input...

  5. #5


    Did you find this post helpful? Yes | No

    Red face

    thanks for the input to all. The problem was that my MCLR pin was not made high and was left floating. Its working now.
    ___________________
    WHY things get boring when they work just fine?

Similar Threads

  1. 16F877 vs. 16F877A
    By DavyJones in forum General
    Replies: 12
    Last Post: - 11th April 2009, 18:22
  2. help my bluetooth and PIC 16F877A?
    By slimpeng in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th March 2008, 06:52
  3. Read the newbee threads, 16F877A no go.
    By BobbyA in forum mel PIC BASIC Pro
    Replies: 39
    Last Post: - 31st December 2006, 03:09
  4. Clock connection to DS1802 from 16F877A
    By coyotegd in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd January 2006, 18:52
  5. 1st 16F877A program in PICBasic
    By Borisw37 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th January 2005, 04:46

Members who have read this thread : 1

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