16F727 ADC problem


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: 16F727 ADC problem

    Could find a edit button.
    Code:
    Device 16F727
    Config1 DEBUG_OFF, BOR_OFF, CP_OFF, MCLRE_OFF, WDT_OFF, INTOSCIO
    Xtal 16
    ;         76543210
    PORTB  = %00000000
    TRISB  = %00000010
    ANSELB = %00000000  ;Or %00000001 or %00000010 or %00000000
    ;         76543210
    ANSELE = %00000010
    PORTE  = %00000000
    TRISE  = %00000010
     
    DEFINE ADC_BITS 10
    DEFINE ADC_CLOCK 3
    DEFINE ADC_SAMPLEUS 10
    ADCON0 = %00011001
    ADCON1 = %01110011
    
    Declare LCD_ENPin = PORTB.3   ;De EN aansluiting moet nu aan PORTA.6
    Declare LCD_RSPin = PORTB.2   ;De RS aansluiting moet nu aan PORTA.7
     
    
    Symbol potmeter   = PORTE.1 
    Symbol voltmeting   = PORTE.2   
    
    Dim var1 As Word
    Dim var2 As Word
    
    '-------[INITIALISE THE PICMICRO]----------------------------------------
    Clear                         ;Wis alle RAM geheugen
    DelayMS 500    ' Wait for the PICmicro to stabilise
    Cls  
    Print "Rdy"       
    GoTo main   ' Jump over the subroutines
    
    
    main:
    While 1 = 1 
    
                 
      
      ADCIN 5, var1
      ADCIN 6, var2
      Print At 1,1, Dec var1  
      Print At 2,1, Dec var2  
    
    Wend   
    
    End

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: 16F727 ADC problem

    yes the signal is present on the leg of the pic but i just get a 3 diget number that keeps changeing and doesnt respond when i turn on my potmeter

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


    Did you find this post helpful? Yes | No

    Default Re: 16F727 ADC problem

    I think you will have better luck on the Proton forum.
    http://www.protonbasic.co.uk/

    When you post there you will want to describe how you have the hardware setup along with the code.
    Dave
    Always wear safety glasses while programming.

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