Stable ADC readings


Closed Thread
Results 1 to 40 of 91

Hybrid View

  1. #1
    Join Date
    Aug 2011
    Location
    Guadalajara, México
    Posts
    28


    1 out of 1 members found this post helpful. Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    That's right Master mister_e, he mention the 10k pull-up before, but I want to be sure he is assembling his circuit properly (just to have peace of mind)

    By the way Master, I'm new to this forum as well to picbasic and since I first read your posts you became my "Personal Jesus"
    Regards!

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


    Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    Don't do that, Depeche Mode have some Copyright on that quote

    Welcome aboard!
    Steve

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

  3. #3
    Join Date
    Aug 2011
    Posts
    40


    Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    Hello,
    First many thanks to your answers .

    OK, please answer the following question:

    Q1: The Resistor attached to the button are built-in the remote/Steering and you can't modify anything in right?

    A1:_Yes , it is too little inside because it is cms components .

    Q2: You have a 10K pull-up On RA0, and another on RA1... true?

    A2: Yes , it is an omission but it is 10Komhs for test ( 3.96 Volts with no action)

    Q3: If so, assuming you don't push on any button, Between GND and RA0 AND between GND and RA1 with your multimeter you should read something like 1.4Volt RIGHT?

    A3: No , i read 3.96 Volts on 10K resistors and RA0,RA1.

    So , (3902/(3902+10000))*5 = 1.403 .
    i will verify if there is another resistors but i see 3902 ohms (i am sure) , perhaps an error . I will tell you about.

    I don't understand : TRISB = ((DCD i) << (ADCChannel*3)) ^255

    Name:  bmf.JPG
Views: 1788
Size:  40.9 KB

    Best regards
    Hervé
    Last edited by mazoul72; - 28th August 2011 at 21:20.

  4. #4
    Join Date
    Aug 2011
    Posts
    40


    Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    Name:  IMG_6708.jpg
Views: 1698
Size:  131.8 KB

    i don't know why 3.96 V and not 1.4 V ....

  5. #5
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323


    Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    Look again at the photo of the circuit board. That resistor near the top right is 39K ohms, NOT 3902 ohms!
    Remember, the last digit is a MULTIPLIER. It tells how many zeros to add after the other digits.
    Last edited by Byte_Butcher; - 16th September 2011 at 03:06.

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


    Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    it's been said at post 59
    Steve

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

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    Quote Originally Posted by mister_e View Post
    it's been said at post 59
    Too long to remember....

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    3902 is actually 39K, so the other resistor are also bad... ok then. So be it.

    modify what's in red
    Code:
    '
    '       Software Variable
    '       =================
            ADRes       VAR WORD    ' ADC Reading
            BTN         var byte    ' Data to be sent to PORTB
            i           VAR BYTE    '
            ADCChannel  VAR BIT     '
            ADCButton   VAR WORD [3]'
    '
    '       Software constant
    '       =================
            ADCSafety   CON 10              ' min/max range for ADC Reading
                                            '
            ADCNone     CON 814 - ADCSafety ' 
            ADCButton[0]  = 90              ' button 1 or 4 
            ADCButton[1]  = 164             ' button 2 or 5 
            ADCButton[2]  = 270             ' button 3 or 6
    should work

    This is Why I asked to measure with your ohmmeter a couple of post back... and nope I'm not going to decipher a PCB

    You have everything on hand....
    Last edited by mister_e; - 28th August 2011 at 22:17.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    I don't understand : TRISB = ((DCD i) << (ADCChannel*3)) ^255
    Check your manual about DCD, logical and bitwise operators. It's all there

    Anyone wants to explain it?

    Yes I've put some black magic in
    Steve

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

  10. #10
    Join Date
    Aug 2011
    Posts
    40


    Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    Hello Steve ,

    i have some erratic values on BTN result ( BTN = TRISB ) under pic smulator ide 6.91 .
    like 1 . 2 . 4 .255 and cycle infinite .

    But i will try this evening on led test or resistors.

    I note in 16f877x datasheet that with "1" TRISB , we have High Impedance so we can choose whose resistor to be put off .
    But with other state bit of TRISB , i don't understand how tie to common +5V of car radio (TIP) to the RB0,RB1,RBx..... ???
    We have agree that it is a result of a resistor between common ground (sleeve) and +5V (tip) on jack "grip" .

    Hervé.

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


    Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    Never trust a sim... as simple as that. They're on the market for laziness and to make good money out of it. Good enough to replace any xBox, Nintendo... or some porn.

    You tie the resistor like the guy in that previous thread. One side on the PIC the other side are tied together and sent to the Radio.
    Steve

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

Members who have read this thread : 2

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