Help with ADCin


Closed Thread
Results 1 to 13 of 13

Thread: Help with ADCin

Hybrid View

  1. #1
    Join Date
    May 2011
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: Help with ADCin

    Steve:

    Here are the conifgs:
    @ device pic16F873A, HS_OSC ' High Speed Crystal/Resonator, 4 MHz and above
    @ device pic16F873A, WDT_ON ' Watchdog timer enabled
    @ device pic16F873A, PWRT_ON ' Power on timer enabled
    @ device pic16F873A, BOD_ON ' Brown out detect enabled

    There is a 0.1uf between Vss and Vdd

    The Vdd has less than 1mV of ripple.

    Both Vss pins are tied to ground.

    I added the following to my configs, still no change.
    @ device pic16F873A, LVP_OFF ' Low-Volt ICSP programming disabled

    With any of PortB pins high the ADC will not respond until AN0 is above 0.063Vdc. If I ensure that all PortB pins are low the ADC responds correctlty.

    I even added a 100 mS pause before and after issuing the ADCIN statement, that helped some, but didn't solve the issue.

    In this aplication it's not a problem. I ensure that all pins on PortB are low before reading the ADC. The ADC now correctly reads 1 count for every 0.0488 volts.

    Thanks,
    Ron

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Help with ADCin

    I often use a 16F877, sister chip to your 16F873, and never had this problem.

    The manual says to pull-down the PGM pin.

    It also goes on to say that it is best to disable LVP during regular programming (low voltage programming can be used during in-circuit-programming).

    What about MCLR, is that pulled up to VDD?

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Help with ADCin

    Try something, load the PGM pin to gnd with a pull down resistor (says 1K), if it works, then the chances are that your device programmer don't program the fuses properly.

    On the other hand, a nasty breadboard could do some problem. Some have broken power strip along the way. It still looks like a bad Vss connection to me.

    EDIT: Program your device, but before check the fuses settings in your device programmer software to see if they match your program. If so, program your device... then read it back. Se if the fuse setting remain the same. Case not, throw your device programmer away Nah, sometimes, just a pull down resistor on the PGM pin while programming is needed. Try it!
    Last edited by mister_e; - 17th May 2011 at 20:08.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    May 2011
    Posts
    7


    Did you find this post helpful? Yes | No

    Default Re: Help with ADCin

    Demon and Steve:

    Thanks for the sugestions guys, tried them to no avail.

    I don't have a 16F877, but I do have a 16F876. Tried it and it does not make a difference. Also tried a 16F819 it also behaves the same way.

    Tried 1k pull down on PGM pin, no difference.

    LVP is disabled in programmer. BTW, it's a PicKit 2, I have two of them both program fine. I can change the fuse settings and verify that the changes are making it to the PIC.

    Now as to the breadboard. The breadboard that I normaly use is chocked full of another project (thats another story), so I borrowed one form my son, its a cheap-O from Jameco. Now that you bring it up, I'm starting to question if it might be the problem... I'm going to build this circuit up on a custom PCB and see it that solves the problem. Might very well be the culprit.

    Very strange that I have to ensure that all pins on PortB are low before the ADC will read below 0.063 Vdc on AN0.

    Thanks,
    Ron

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