Mystery instability of 16f628a


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: Mystery instability of 16f628a

    Have you try turning off the analog comparators? if you dont know how just add ADCON1=7 near the top row...

  2. #2
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    704


    Did you find this post helpful? Yes | No

    Default Re: Mystery instability of 16f628a

    Also, add the line

    TRISA = 0
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default Re: Mystery instability of 16f628a

    CMCON = 7 will disable the comparators. Also place a small 0.1 or 0.01uF cap between the PIC gnd & vcc pins. Make sure it's as close as possible to the pins.

    It's also a good idea to include at least the minimum config options in your code so you're not left with whatever the default unprogrammed config bits are.

    I would use at least @ device pic16F628A, intrc_osc_noclkout, wdt_on, mclr_on, lvp_off, protect_off.

    If that doesn't take care of it, check your power supply.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: Mystery instability of 16f628a

    yup..my mistake...its cmcon = 7...

  5. #5
    Join Date
    Dec 2009
    Posts
    21


    Did you find this post helpful? Yes | No

    Default Re: Mystery instability of 16f628a

    Hi,
    Thanks for the suggestions folks. tried them all one by one and got nowhere, then noticed that /MCLR was checked in PicKit 2. Unchecked it and everything worked like a dream ! I then worked backward taking each mod off in turn to see which one had done the trick! Yes, youve guessed it .. the dam thing still worked. I have reintroduced all suggestions again in the hope that this thing shows a tad more reliability, but I'm not holding my breath !

    Thanks again
    David

  6. #6
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default Re: Mystery instability of 16f628a

    Glad to hear you got it working, but you really do want to include that cap between the gnd & vcc pis. Without it you might have more problems down the road. Some older PIC types could get by without this cap, but most all newer A versions will experience problems without it. Just FYI. It's cheap insurance...
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  7. #7
    Join Date
    Dec 2009
    Posts
    21


    Did you find this post helpful? Yes | No

    Default Re: Mystery instability of 16f628a

    Thanks Bruce. It's back in even as we speak ! Belt, braces and a piece od string as they say !
    Cheers

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


    Did you find this post helpful? Yes | No

    Default Re: Mystery instability of 16f628a

    Hello Davidmarks,
    I am curious, are you getting any warnings when you compile? It occurs to me, without the present ability to check MY pbp due to a hard drive failure here at home, What is the default OSC setting in the 16F628A.inc file? Have you opened it and commented it out ? Because if not, your program will use the default osc setting and NOT the one you wrote into your code. So if the default is for using a crystal instead of INTRC_OSC * * * you will in effect have the external crystal ports open to the ether looking for a finger to help start the oscillator by stray capacitance. One more thing, is the " [ " at the beginning of the config statement, in you code or just in your post?
    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.

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