Lcd With 16f819


Closed Thread
Results 1 to 7 of 7

Thread: Lcd With 16f819

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    some thing like this I think and your on the wrong forum

    DC_Loops = 20

    Main:

    ADC_Channel = 1 ' ADC on first reference
    GoSub ADC_Average ' Perform an averaging to enhance accuracy

    Temp_Float = ADC_Result ' Store the result

    ADC_Channel = 0 ' ADC on second reference
    GoSub ADC_Average ' Perform an averaging to enhance accuracy

    ADC_Result = ADC_Result * 5000 / 1023 ' Convert values into Volts (with a scale of 1000)
    Temp_Float = Temp_Float * 5000 / 1023 ' to reduce decimal error
    ADC_Result = ADC_Result - Temp_Float ' And calculate difference

    ADC_Result = ADC_Result / 10 ' Scale back down remembering 10mV = 1 Deg C

    If ADC_Result <> Last_Result1 Then ' Check if the data has changed
    Print At 1,1, DEC1 ADC_Result, 0, "C " ' and only update display if it has
    Last_Result1 = ADC_Result ' Store new data
    EndIf

    GoTo Main ' Loop for ever


    ADC_Average: ' Perform an averaging on ADC conversions
    ' to reduce errors
    ADC_Total = 0 ' Clear summing register
    For Temp = 1 To ADC_Loops ' Loop for a pre-determined number of times
    ADC_Result = ADIn ADC_Channel ' Grab a new ADC value
    ADC_Total = ADC_Total + ADC_Result ' Sum it to the total register
    DelayUS 1 ' Allow internal capacitors to discharge
    Next Temp

    ADC_Result = ADC_Total / ADC_Loops ' Determin the average of all the equations

    Return

  2. #2
    wilfrieds's Avatar
    wilfrieds Guest


    Did you find this post helpful? Yes | No

    Default adc stabilized

    Hi guys

    thanks for the tips.
    The adc jumping was sorted out by putting the cap closer to the 7805 regulator.
    A Tantalium cap also improved stability. so for good measure I ised both.

    I also tried ceramic caps but they didn't make any difference.

    The ADC range adjustments seem interesting, still working and experimenting with that one.
    Math calc's don't always seem to be spot on.??? ( maybe it's back to school).

    Regards
    Wilfried

  3. #3
    wilfrieds's Avatar
    wilfrieds Guest


    Did you find this post helpful? Yes | No

    Default adc display

    One more problem remaining.

    How to display say 4.85V from a ADC result.
    Problem being the dot off course.

    Thanks
    Wilfried

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    As your as your result = 485 or 4850, you just need to format it. Look for DIG and DEC modifier in the LCDOUT section.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Is this code not initialising the LCD properly?
    By Platypus in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th January 2010, 20:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 20:54
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 17:56
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 27th June 2007, 00:07
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 03:30

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