How do you chose ADCIN channel in this case


+ Reply to Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: How do you chose ADCIN channel in this case

    Quote Originally Posted by richard View Post
    why would it not be 32 like it says ?
    Because I'm a potato-head.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: How do you chose ADCIN channel in this case

    Note to the next guy:

    You don't need the register if there's only the ADC channel inside it (I keep the list only as documentation for the channel numbers).

    Code:
    'ADPCH = %00000000                   ' ADC POSITIVE CHANNEL SELECTION REGISTER
    '   bit 7-6 Unimplemented: Read as ‘0’
    '   bit 5-0 ADPCH<5:0>: ADC Positive Input Channel Selection bits
    '               111111 = Fixed Voltage Reference (FVR)
    '               111110 = DAC1 output
    '               111101 = Temperature Indicator
    '               111100 = AVSS (Analog Ground)
    '               111011 = Reserved. No channel connected.
    '               •
    '               •
    '               •
    '               100010 = ANE2       * 16F18877 only
    '               100001 = ANE1       * 16F18877 only
    '               100000 = ANE0       * 16F18877 only
    '               011111 = AND7       * 16F18877 only
    '               011110 = AND6       * 16F18877 only
    '               011101 = AND5       * 16F18877 only
    '               011100 = AND4       * 16F18877 only
    '               011011 = AND3       * 16F18877 only
    '     26 --->   011010 = AND2       * 16F18877 only
    '     25 --->   011001 = AND1       * 16F18877 only
    '               011000 = AND0       * 16F18877 only
    '               010111 = ANC7
    '               010110 = ANC6
    '               010101 = ANC5
    '               010100 = ANC4
    '               010011 = ANC3
    '               010010 = ANC2
    '               010001 = ANC1
    '               010000 = ANC0
    '               001111 = ANB7
    '               001110 = ANB6
    '               001101 = ANB5
    '               001100 = ANB4
    '               001011 = ANB3
    '               001010 = ANB2
    '               001001 = ANB1
    '               001000 = ANB0
    '               000111 = ANA7
    '               000110 = ANA6
    '               000101 = ANA5
    '               000100 = ANA4
    '               000011 = ANA3
    '               000010 = ANA2
    '               000001 = ANA1
    '               000000 = ANA0

    You only need to declare the channel in the ADCIN command:

    Code:
            ADCIN 26, ADCinput
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: How do you chose ADCIN channel in this case

    I think this was always the case with the integrated ADCIN command of the PBP.

    Then you can always mess with the registers if your are brave enough!

    Ioannis

Similar Threads

  1. Best way to shut down HPWM channel?
    By LetTheSmokeOut in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th January 2010, 22:01
  2. 16-Channel LED Drivers
    By Sponge Bob in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 16th February 2009, 04:48
  3. Multiplexer channel selection
    By Castor in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 19th May 2008, 10:51
  4. I need Help to Connect P-Channel Mosfet
    By jetpr in forum Schematics
    Replies: 1
    Last Post: - 6th February 2006, 12:06
  5. 16F819 ADCIN Channel Select?
    By modifyit in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 27th April 2005, 18:31

Members who have read this thread : 8

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