ADC PIC18F2431 or PIC18F4431


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    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

  2. #2


    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

  3. #3
    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