Potentiometer reading


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Oct 2011
    Posts
    54


    Did you find this post helpful? Yes | No

    Default Re: Potentiometer reading

    Hi again
    Read 'Selecting the A/D conversion clock' in the datasheet
    It says R/C clock source not recommended at frequencies above 1mHz
    For 20mHz clock source should be %010 or %110 (2 decimal or 6 decimal) ie
    Define ADC_CLOCK 2
    or
    Define ADC_CLOCK 6

    Phil

  2. #2
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Re: Potentiometer reading

    Hi jetpr and Sherbrook, I tried your suggestions but did not work for me...I will try to get another pot today and try it again...thanks for sharing your ideas.

    Regards,
    tacbanon

  3. #3
    Join Date
    Jun 2011
    Location
    Philippines
    Posts
    223


    Did you find this post helpful? Yes | No

    Default Potentiometer reading(solved)

    Hi everyone, I got the code to work but on 10K pot... Thanks for the inputs everyone.
    I used the same connections and the codes from forum's input.
    Code:
    DEFINE    OSC 20
    ' Define ADCIN parameters
    DEFINE ADC_BITS 8
    DEFINE ADC_CLOCK 3 
    DEFINE ADC_SAMPLEUS 50 
    
    
    adval Var Byte          ' Create adval to store result(slider)
    
    
    TRISA = %11111111    
    ADCON1 = %00000100  
      
    mainloop:
    
    
       ADCIN 0, adval       ' Read channel 0 to adval
       Serout2 PORTD.2, 84, [$1B,$45]      ' Clear
       Serout2 PORTD.2, 84, [" Slider: ",#adval]'
    
    
       Pause 150            ' Wait .15 second
       Goto mainloop        ' Do it forever
    
    
       End
    Name:  slider.jpg
Views: 2184
Size:  171.9 KB

    regards,
    tacbanon

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