Voltage Ref Problem


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Jan 2012
    Posts
    2


    Did you find this post helpful? Yes | No

    Default Re: Voltage Ref Problem

    This is what I have set:


    trisio = %00011011
    ANSEL = %00001011
    CMCON = %01010111
    ADCON0.7 = 1 ' Set PORTA analog and right justify result

    ADCON0.6=1
    ADCIN 0, VA
    ADCON0.6=0
    ADCIN 3,VA1

    Thanks for help

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: Voltage Ref Problem

    Are VA and VA1 WORD variables?
    Charles Linquist

  3. #3
    Join Date
    Jan 2005
    Location
    Puerto Rico
    Posts
    133


    Did you find this post helpful? Yes | No

    Default Re: Voltage Ref Problem

    'For global reference to system voltage, use the Voltage variable, which is based on a
    'scale of 1 to 1000, with 775 = 7.75 volts. Remember that the resistors on the board
    'divide the actual battery voltage in half so the ADC can "digest" it without damage.
    'ADCIN voltages are limited to 5. Both EGT and Voltage are compared with the onboard
    'precision voltage reference which delivers a perfect 5V.
    '**Voltage**
    LCDVLow=0
    LCDVHigh=0
    Voltage=0
    ADCIN VoltChannel, Voltage 'Take just 1 voltage sample. 7.6V = 194
    ' SerOut LCDScreen, T9600, [LCDCmd, LCDLine1,"VoltsX=",#Voltage] 'RPM
    ' PAUSE 2000
    Voltage = Voltage * 4 '194 * 4 = 776
    LCDVHigh = Voltage / 100 '776 / 100 rounds to 7
    LCDVLow = (Voltage // 100) / 10 '776 // 100 = 76, 76 / 10 = 7
    LCDVLow = LCDVLow - 2
    'Final Display = 7.7
    My Hobbies is PicBasic PRO

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