Newby with ADC problems.


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Mark Scotford's Avatar
    Mark Scotford Guest


    Did you find this post helpful? Yes | No

    Smile Got there in the end

    Thanks Dwayne, you pointed me in the right direction. I did not realise how important the Microchip Data sheets are, I thought PBP did everything for you. I had to learn (by trial an error) how to set the ADCON manually, got there now, can read my Pot and output 0-255 just lovely (what was that about the Blinkey Light?)
    Regards Mark

  2. #2
    GEEZER's Avatar
    GEEZER Guest


    Did you find this post helpful? Yes | No

    Default Ad Converter

    I have been looking at this post and may have picked up a little something. You guys are way ahead of me. I have only a few weeks experience.

    I have an 16F877A which I have managed to interface with an LCD and KEYPAD.
    All works great. Now I would like to read voltage through the ADC, A0 - A9.

    Here is the code I am using.

    DEFINE ADC_BITS 10
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 50

    X VAR BYTE
    TRISA = %11111111
    ADCON1 = % 10000010
    PAUSE 500

    MAIN:
    ADCIN 1, X
    LCDOUT X, " VOLTS"
    PAUSE 500
    GOTO MAIN
    END

    What I am getting now is random ascii characters for X. Sometimes they are sequential for a while.

    Any help will be appreciated.

    Geezer

Similar Threads

  1. Problems with ADC
    By mcbeasleyjr in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th January 2009, 17:34
  2. 16F819 ADC problems
    By MUC in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 22nd March 2008, 18:36
  3. PIC18f2423 two 12bit adc input problems
    By Brandon in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 16th December 2007, 09:47
  4. I have problems with de ADC...
    By jomavilla24 in forum Off Topic
    Replies: 1
    Last Post: - 16th February 2007, 16:24
  5. adc problems
    By MARAD75 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd December 2006, 05:47

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