ADC PIC18F2431 or PIC18F4431


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    Hi, Mark

    I do not think PBP can directly do what you are expecting ...

    you should have a closer read of the ADC chapter of your datasheet and , after , drive the relevant registers ...
    that are somewhat more numerous than those driven by a classical Adcin PBP command.

    You'll also note there are fixed input groups, and Channel 0 + Channel 1 is not a valid group ...

    PBP doesn't do everything for you, in short terms ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi, Mark

    I do not think PBP can directly do what you are expecting ...

    you should have a closer read of the ADC chapter of your datasheet and , after , drive the relevant registers ...
    that are somewhat more numerous than those driven by a classical Adcin PBP command.

    You'll also note there are fixed input groups, and Channel 0 + Channel 1 is not a valid group ...

    PBP doesn't do everything for you, in short terms ...

    Alain
    Hi Alain,

    Thanks for your reply. Yes I concluded last night that adcin would not work, but was
    hoping otherwise!
    Most likely will need a routine to set the group, channel, GO/DONE and store results on each read.

    Regards
    Mark

  3. #3
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Here's one example of A/D with this series. http://www.picbasic.co.uk/forum/showthread.php?t=6768
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Bruce View Post
    Here's one example of A/D with this series. http://www.picbasic.co.uk/forum/showthread.php?t=6768
    Thanks Bruce!

    Perfect

    I searched the forum for pic18f4431, not pic18f4331

    Regards

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


    Did you find this post helpful? Yes | No

    Cool

    Today I trapped into the same hole...

    ADCIN doesn't work on a PIC18Fxx31.

    I have just written some code to read AN0..AN7 on devices who have this inputs.

    Init-Part:
    Code:
        ;ADC
        ADON=true:ADCON2=%11101101                      ;FOSC/16 AN0-AN4=analog right-justified, 40xTAD Sample
        ANSEL0=%00011111
    Inside Main-Code:
    Code:
            ;ADC-Zyklus
            ;messen, umrechnen und gewichtet mitteln
            ;CtADC contains the ADC-channel
            ADCHS=0:If CtADC.2 Then ADCHS=%01010101     ;Channel-Select
            ADCON0.3=CtADC.1:ADCON0.2=CtADC.0
            GO=true:Repeat:Until !GO                    ;ADC starten
            DummyW.Highbyte=ADRESH:DummyW.Lowbyte=ADRESL
    PBP 2.50C, MCS+ 3.0.0.5, MPLAB 8, MPASM 5.14, ASIX Presto, PoScope, mE mikroBasic V7.2, PICKIT2

Members who have read this thread : 1

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