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


Results 1 to 22 of 22

Threaded View

  1. #1
    Join Date
    Mar 2008
    Posts
    13

    Default Need help for my project(16f877,2x16LCD,)

    Hello ! As you see i'm a newbee .
    (Merhaba arkadaşlar.)
    I've started to learn about a pic for about a month ago .
    I learned to write something to the LCD with 2 lines(rows).
    This was a first step for me to learn the 'p' of pic.
    I'm an undergraduate student and my final project is to show the voltage change from the output of LM358 IC with 16f877 with using 2x16 LCD.
    I'll show the change as the bar graph.
    I have square wave 15V from the LM358 IC output.
    The output mostly stays about 15V , so the ADC will be vice-versa.
    I learned that 16f877 has 10 channels ADC , so we have 0-1023 interval.
    As i said above , the peak of the signal is 15V and as i said above it's a square wave.
    The most important point is , the ADC must be vice-versa.
    For example : for my 15-14V input , the first interval must be 0-68 , for 13-12V input , second interval : 68-136 ...
    I'm using pic basic pro and I don't know how to write a program .
    And i read about LCD bar graphs , but i couldn't make it. ( http://www.picbasic.co.uk/forum/showthread.php?t=2359 )
    Here is what i learned about pic :

    @ DEVICE pic16F877
    @ DEVICE pic16F877, WDT_on
    @ DEVICE pic16F877, PWRT_ON
    @ DEVICE pic16F877, PROTECT_OFF
    @ DEVICE pic16F877, HS_OSC


    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 0
    DEFINE LCD_RSREG PORTE
    DEFINE LCD_RSBIT 1
    DEFINE LCD_EREG PORTE
    DEFINE LCD_EBIT 0
    DEFINE LCD_RWREG PORTE
    DEFINE LCD_RWBIT 2
    DEFINE LCD_BITS 8
    DEFINE LCD_LINES 2

    DEFINE LCD_COMMANDUS 1000
    DEFINE LCD_DATAUS 225

    DEFINE ADC_BITS 10
    DEFINE ADC_CLOCK 2
    DEFINE ADC_SAMPLEUS 100
    ADCON1=%10001110


    TRISB=0
    TRISE=0


    LOW PORTE.2


    LCDOUT $FE,1
    PAUSE 200

    LCDOUT $FE,2,"PIC BASIC"
    LCDOUT $FE,$C0,"PRO"

    END
    I really need help .
    Thank you
    Last edited by karamastik; - 19th March 2008 at 20:49.

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