16F876A Pulsin issues


Results 1 to 16 of 16

Threaded View

  1. #13
    Join Date
    Mar 2010
    Posts
    52


    Did you find this post helpful? Yes | No

    Default

    Am I on the right track?

    the "//" operator will store the remainder in the chosen Var, thus:

    Code:
    ADCIN 4, volt                  ' Read AN4 into temp variable
    volt = volt * 2                 'Correct the ADCin for the Voltage divider?
    FVolt = (5*volt/1023)
    MVolt = (5*volt // 1023)  'millivolts?
    
    lcdout $FE, $C0+8, dec FVolt,".",dec4 MVolt,"V"
    Sorry for getting overly complex with this but trying to understand how it works, I have been able to simulate what I need to do in excel, just not sure if the above will work in PBP:

    D1 = Vref @ 5.00
    D5 = Adc Corrected @ 1021
    D6 = 10 bit ADC @ 1024

    D14 = Whole number (Formula =TRUNC(D9,0), result = 4
    D15 = Remainder (Formula =(MOD((D5*D1)/D6,1)*1000)), result = 990

    I could then LCDout D14, ".", D15 in theory if the formula in PBP equaled the excel result.

    not sure though, still a bit confused

    Cheers
    Rob
    Last edited by Bobbo_ZA; - 31st March 2010 at 09:39.

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