Help for my project(16f877,2x16LCD,)


Results 1 to 22 of 22

Threaded View

  1. #5
    Join Date
    Mar 2008
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    Okay ,
    for ADC :

    PORTA = %00000001
    RAW var word ' the input voltage
    volt var word
    Mvolt var byte

    START:

    ADCIN 0,RAW ' Analog read from #ch0 and move it to RAW
    LOOK : IF ADCON0.2=1 THEN LOOK ' when ADC finished ADCON0.2=0
    ' for 0-5V , 0-1024 - > 5/1024 = 0.0048828 = very small number
    '0.0048828*1000 = 4.8828 ( raw/V)
    '4.8828 * 256 = 1250 ( 1250 = 5/1024 * 256*1000 ) we made 32bits calculation
    Volt=(Raw*/1250)/100
    MVolt=Volt//10 ' Mvolt = Volt mod 10
    Volt=Volt/10
    LCDOUT $FE,2,"VOLT=",#VOLT,",",#Mvolt
    PAUSE 500
    GOTO START
    I tried to read the voltage from LM358 and to write the LCD as Volt.Mvolt
    I'm waiting for help.
    Thanks.
    Last edited by karamastik; - 19th March 2008 at 23:03.

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