ADC conversion trouble


Closed Thread
Results 1 to 25 of 25

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    hey that' SOS right?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    That is affirmative.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Code:
    .-- .... .- - . ...- . .-. / -.-- --- ..- / -.. --- --..-- / -.. --- / .. - / .-- . .-.. .-.. / .- -. -.. / . -. .--- --- -.--
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Smile

    Hello again,

    No smoke… yet.

    I made and plugged in a 2.000 Volt reference for Vref+.
    The old brain is partially hibernating and I can’t get the decimal to appear correctly.
    Some changes to the code:

    ANSEL = %00001111 ‘ not sure if I need both AN2 and AN3 for Vref since I only use Vref+ on AN3.. well seems to work so far. Perhaps better to make AN3 an output?

    ADCON1 = %11100000 ‘ right justify – clock/2 - use Vref+.

    ADCIN 0,T

    T = (T*/200)>> 2

    LCDOUT $FE,1,"TEMP= ",DEC T, “.”, DEC1 T, “C”



    Could use a sharper brain!

    Yes, I have fun!

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    try
    Code:
    LCDOUT $FE,1,"TEMP= ",DEC (T/10), ".", DEC T DIG 0, "C"
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Dec 2007
    Location
    Sweden
    Posts
    73


    Did you find this post helpful? Yes | No

    Unhappy

    Thanks Steve,

    However this only moved the dot so instead of 26 C I got 2.6 C!

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    so you just need to adjust this line
    T = (T*/200)>> 2
    PBP works with integers only. If your result=263, you will display 26.3C with the LCDOUT line i've suggested.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Can't get ADC to loop
    By TravisM in forum mel PIC BASIC
    Replies: 2
    Last Post: - 11th October 2009, 15:33
  2. A/D conversion with PIC18F67J50
    By ScaleRobotics in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 8th May 2009, 01:48
  3. Help with ADC conversion
    By dbachman in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 1st February 2009, 20:02
  4. ADC trouble with PIC16F88
    By inventosrl in forum mel PIC BASIC
    Replies: 9
    Last Post: - 3rd December 2008, 12:56
  5. ADC problem
    By NacNud in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 15th December 2004, 02:27

Members who have read this thread : 0

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