12F1840 ADCIN troubles, help needed :(


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: 12F1840 ADCIN troubles, help needed :(

    RA3 or LATA.3 how you call it, which is input only, ADC works just fine and does not hog current.
    ? really
    RA3 is not an analogue input

    the only way a pic I/O pin will sink 25ma is :- if its an output, damaged or fed more volts than vdd

  2. #2
    Join Date
    Feb 2013
    Posts
    1,158


    Did you find this post helpful? Yes | No

    Default Re: 12F1840 ADCIN troubles, help needed :(

    So, if I understood correctly, I need to set TRISA correctly and that is the issue?

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: 12F1840 ADCIN troubles, help needed :(

    any pin that is set to analogue needs to have its corresponding tris bit set

    from the data sheet
    The TRISA register (Register 12-3) controls the
    PORTA pin output drivers, even when they are being
    used as analog inputs. The user should ensure the bits
    in the TRISA register are maintained set when using
    them as analog inputs. I/O pins configured as analog
    input always read ‘0’.

  4. #4
    Join Date
    Feb 2013
    Posts
    1,158


    Did you find this post helpful? Yes | No

    Default Re: 12F1840 ADCIN troubles, help needed :(

    Yes, thanks, now that clear, changed TRISA to TRISA=%00111101 and it now works just fine!
    Just it is a bit silly, why it can be possible to have same pin both as ADC IN and LOGIC OUT at same time (circuitry-wise)

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,705


    Did you find this post helpful? Yes | No

    Default Re: 12F1840 ADCIN troubles, help needed :(

    Just it is a bit silly, why it can be possible to have same pin both as ADC IN and LOGIC OUT at same time (circuitry-wise)

    why is that you can drive a car for hundreds of miles in low gear , and with the handbrake on ?

    is that any different ?

    just because you're in the drivers seat with the motor running does not mean you are proficient

  6. #6
    Join Date
    Feb 2013
    Posts
    1,158


    Did you find this post helpful? Yes | No

    Default Re: 12F1840 ADCIN troubles, help needed :(

    That's not fair comparison, the situations is like when you can have zipper closed on your pants, but your junk still hanging from zipper

    A side question, I'm going to monitor 9VDC battery voltage via ADCIN. To reduce current consumption, I'll have to increase resistance of both resistors, but this will also make circuit less noise proof. How do you think, what will be the gold cut in that case?

  7. #7
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: 12F1840 ADCIN troubles, help needed :(


Similar Threads

  1. 12F1840 config issues
    By enigma in forum PBP3
    Replies: 13
    Last Post: - 15th February 2015, 08:49
  2. Problem converting 12F683 code to 12F1840
    By RossWaddell in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 14th March 2013, 02:55
  3. Help needed with ADCIN Averaging Routine
    By Aussie Barry in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 24th December 2012, 17:05
  4. PBP Support for 12F1840 8-Pin Device?
    By springtank in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 10th November 2012, 09:32
  5. troubles using more than one PCF8574
    By maus in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 28th July 2007, 20:37

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