Stable ADC readings


Closed Thread
Results 1 to 40 of 91

Hybrid View

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

  2. #2
    Join Date
    Aug 2011
    Posts
    40


    Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    Hi Steeve,

    i test intensity value with some résistors tie together to one led.

    But with your program , trisb stay at 255 , i put some select case for test but no trisbx.0 work (255 always)
    I will try to my test platine .
    I understand your "voodoo formule" , it is for have only one button put on , no action with 2,3 .. together .

    Regards.
    Hervé

  3. #3
    Join Date
    Aug 2011
    Posts
    40


    Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    i repeat my question :
    how tie the resistors on the side of PIC together to have a resultant resistor in parallele ?
    i agree that the other side is tie together to the radio , but on the ground ,yes
    but the +5V for PIC RBx ?

    Regards.

    Hervé

  4. #4
    Join Date
    Aug 2011
    Posts
    40


    Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    in fact , the simulator isn't reactif with adc , i must go slowly with an0/an1 choice .
    But step by step around button(i) , it works.

    I must add six other buttons in programm and .

  5. #5
    Join Date
    Aug 2011
    Posts
    40


    Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    Can i use btn as word variable for a select case like 1110111111111111 ?
    (with your formule dcd(i).... )
    i can't for the moment ...
    i use adcchannel 0 to 3 .

    Regards.
    Hervé

  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

    pbp 3 manual section 2.12
    Steve

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

  7. #7
    Join Date
    Aug 2011
    Posts
    40


    Did you find this post helpful? Yes | No

    Default Re: Stable ADC readings

    Hello,

    it works all !
    great and many thanks.

    I made another "formule" in addition to yours (to work with 12 buttons and 4 channels__3 buttons on a wire)
    It is perhaps not proper .
    I add to this : PIC Simulator IDE 6.91 works great , all test with it and great.


    . btn = ((DCD i) << (ADCChannel*3))^255
    . if ADcchannel = 3 and btn = %11111111 then btn = (btn - (3*adcchannel)) << i
    . gosub choose
    ..
    ..
    ADCChannel = ADCChannel + 1 'Switch to the other ADC channel
    if ADCchannel = 4 then adcchannel = 0
    ..
    ..
    choose:
    select case btn
    ' first bloc of 6 buttons
    case %11111011 ' AN0-270 --- 47k and 5k = 4.6k
    TRISB.0 = 0 ' 5k and 5k = 2.5k
    TRISB.1 = 0
    case %11111101 ' AN0-164 --- 47k and 10k = 8.2k
    TRISB.1 = 0 ' 5k and 5k = 2.5k
    TRISB.2 = 0 ' 47k and 47k = 22k
    case %11111110 ' AN0-90 --- 47k and 22k = 15k
    ........


    Regards
    Hervé

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