16F877a PORTA ADC and digital help


Results 1 to 7 of 7

Threaded View

  1. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Hi RF,

    Since RA4 is not an analog pin you get it as digital at default.

    Then, the rest is as you needed. See the table below.
    -----------------------------

    <img src="http://img4.picsplace.to/img4/26/adc.GIF" alt="Image Hosting by PicsPlace.to" >

    -----------------------------

    RE0-RE2 meaning that AN5, AN6 and AN7 are needed as digital in your case.

    Thus, you endup with
    ADCON1.0=0
    ADCON1.1=1
    ADCON1.2=0
    ADCON1.3=0

    ADCON1.4=0
    'ignore
    ADCON1.5=0 'ignore

    Then, assuming you want to use RC OSC,
    ADCON1.6=0 '(here you should use DEFINE)

    Then, you need 10-bit res.,

    ADCON1.7=1 'right justified is needed with 10-bit. Left justified is needed with 8-bit.


    You are set.

    -------------------------------
    Edit: Don't forget to set your TRIS registers for input/output thingie.
    Last edited by sayzer; - 22nd October 2006 at 00:04.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. Replies: 5
    Last Post: - 16th October 2009, 18:29
  2. Can't get ADC to loop
    By TravisM in forum mel PIC BASIC
    Replies: 2
    Last Post: - 11th October 2009, 15:33
  3. 16F877A problem: "coupled" digital values
    By Lupo83 in forum General
    Replies: 16
    Last Post: - 4th December 2007, 12:46
  4. Replies: 4
    Last Post: - 24th January 2007, 22:20
  5. Problem with ADC
    By savnik in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 25th November 2006, 07:37

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