Maximum value of ADCIN


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    No, that won't matter.

    Can you post your Proteus files (zipped)?
    DT

  2. #2
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    Yes, all is OK now !
    If v_cal is 1023 (maximum 5.000V) it's correct this command for memorise in EEPROM :
    write 0, v_cal
    I read the PBP help, but I find only this : write 5,B0 ' Send value in B0 to EEPROM location 5.
    And I can read them when I need, with this command :
    read 0, v_cal ???
    It's enough like these or need more ?
    Thanks in advance and sorry for my ignorance...

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    If v_cal is 1023 (maximum 5.000V) it's correct this command for memorise in EEPROM :
    write 0, v_cal
    ...
    read 0, v_cal ???
    It's enough like these or need more ?
    If you have PBP 2.60, then you could ...

    Code:
    write 0, WORD v_cal
    
    read  0, WORD v_cal
    If you don't have 2.60 yet, you'll need to ...

    Code:
    write 0, v_cal.LowByte
    write 1, v_cal.HighByte
    
    read  0, v_cal.LowByte
    read  1, v_cal.HighByte
    DT

  4. #4
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    I understand now ; I read 10 pages of search "eeprom".
    Of course, the answer it's simple if somebody help ! Thanks, Mr.Darrel !
    ....
    So, if eeprom it's like in picture :
    75 (hex) = 117 (dec)
    v_cal = 117 * 4,8875 = 572 mVolts ?
    Attached Images Attached Images  
    Last edited by fratello; - 14th November 2010 at 16:31. Reason: adding picture

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    So, if eeprom it's like in picture :
    75 (hex) = 117 (dec)
    v_cal = 117 * 4,8875 = 572 mVolts ?
    Yes, if you saved the MAX A/D value instead of the converted value.

    In that case, be sure to use the previous formula to convert it to voltage.
    Code:
    v_cal=v_cal * 5000            ' I use VDD as Vref
    v_cal=div32 1023.
    DT

  6. #6
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default

    I use this code :
    Code:
        vmax = 0
        for cnt =1 to 70       			
            adcin 3, v_cal
            vmax =vmax max v_cal
            pause 100
        next cnt
    
        v_cal=vmax * 5000            ' I use VDD as Vref
        v_cal=div32 1023
    
    write 0, v_cal.LowByte
    pause 10
    write 1, v_cal.HighByte
    pause 10

  7. #7
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Then you have saved the value as a Voltage.
    And 117 means 117mV.

    Since I = E / R ... with a 0.02 ohm resistor ...

    0.117 / 0.02 = 5.85 Amps

    Dividing by 0.02 is the same as multiplying times 50.

    117 * 50 = 5850 or 5.850 Amps.
    DT

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