Using the pic12F683


Closed Thread
Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    Thank you.

    For this particular chip the ANSEL is used instead of ADCON1?

    Would I still need to set up the ADCON0 if the ANSEL is set up?

    Would you only disable the analog comparator when using a digital input?


    Here's what I have now:

    DEFINE OSC 8 'Oscillator speed in MHz
    DEFINE ADC_BITS 10
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 15
    OSCCON = %01110000 ' Set internal OSC to 8MHz
    ANSEL = %00001111 ' Set AN0-AN3 analog, rest digital
    TRISIO.5 = 0 ' GP5 is output
    ADCON0.7 = 1 ' Right justify for 10 bit result

    INTCON = %00000000 'all interrupts OFF



    Thanks again,
    Tony


    Quote Originally Posted by Bruce
    Hi Tony,

    You don't necessarily have to set these pins to inputs with TRISIO before
    using ADCIN, but it definitely is good practice to do so.

    Pins are inputs by default at power-up, but I always include TRIS statements
    in code just to be 100% sure the pin is an input before reading it.
    Last edited by TonyA; - 6th April 2006 at 17:47.

Similar Threads

  1. Pic12f683 Cmcon0 = 7
    By penelopepug in forum mel PIC BASIC Pro
    Replies: 25
    Last Post: - 12th June 2009, 18:23
  2. Programming Problem PIC12F683
    By StoneColdFuzzy in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 2nd June 2009, 21:39
  3. pic12f683 being picky about pins...
    By erice1984 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th March 2009, 23:16
  4. pic12F683 , gpio.5 not accessible...
    By flipper_md in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 9th May 2008, 05:25
  5. How to calculate ADC resolution (pic12f683)
    By peu in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th April 2007, 18:39

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