Adcon


+ Reply to Thread
Results 1 to 8 of 8

Thread: Adcon

  1. #1
    Join Date
    Jun 2006
    Posts
    16

    Default Adcon

    Hi

    I want to use the command ADCIN but my pro compiler brings errors with ADCON. Can Anybody tell me whats wrong
    Itīs an Error in the pbppic14.lib. mostly the error is "undefinded Symbol"
    can anybody help me

    Martin

  2. #2
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Show us your code please !

  3. #3
    Join Date
    Jun 2006
    Posts
    16


    Did you find this post helpful? Yes | No

    Default Code

    DEFINE ADC_BITS 8
    DEFINE ADC_CLOCK 2
    DEFINE ADC_SAMPLEUS 100

    PORTA = 5
    TRISA = $85
    PORTB = 6
    TRISB = $86

    POKE TRISA, %11111111
    POKE TRISB, %00000000

    W0 var byte

    ADCON1 = 2 'This line is not working !!!!!!!!!
    ADCIN 0, W0 'This line is not working, too

    Martin

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,416


    Did you find this post helpful? Yes | No

    Default Which PIC?

    Hi,
    First you set TRISA to $85 and then overwrite with 255 using the POKE command, same goes for TRISB, seems strange to me but is probably not related to your problem.

    You didn't say what PIC you are using??

    BTW, even though they still work it is recomended to not use the PEEK/POKE commands.

    /Henrik Olsson.

  5. #5
    Join Date
    Jun 2006
    Posts
    16


    Did you find this post helpful? Yes | No

    Default Pic

    Iīm using the pic16f627a. The problem is that the compiler does not racognize the command ADCON. There must be something to include or to register.

    martin

  6. #6
    Join Date
    Oct 2004
    Location
    Hangover, Germany
    Posts
    289


    Did you find this post helpful? Yes | No

    Exclamation

    The PIC16F627A has no ADC, it has no ADCON1-register and ADCON is no command.
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

  7. #7
    Join Date
    Jun 2006
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    ah ok....is there anotherway to meassure voltage ??

    thanks martin

  8. #8
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    To use a 16F819 or a 16F873(6)(a).
    Or if you want to do something under or above an sertain input voltage then you can use the 16F627a with its internal comperators.

Similar Threads

  1. What is ADCON?
    By mbw123 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th January 2007, 23:55
  2. adcon problems with adcin
    By mbw123 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 3rd January 2007, 22:15
  3. 16F818 ADCON question
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 1st February 2006, 10:50
  4. ADCON Explanation
    By eoasap in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th December 2005, 19:08
  5. ADCON does not compile 16F628
    By mslaney in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th January 2005, 15:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts