Lcd With 16f819


Results 1 to 7 of 7

Thread: Lcd With 16f819

Threaded View

  1. #1
    Join Date
    Sep 2007
    Posts
    2

    Default Lcd With 16f819

    EDIT: I solved the problem, the EBIT was on set to the wrong pin. Anyway, I will leave the post active if anyone wants to know how to interface a 16F819 with the LCDOUT command in PB. Setting on EPIC Programmer is XT.


    I have tested my circuit on the 16F84A and the LCDOUT program works perfect.

    I am now trying to get this working with 16F819 so I can use the ADC and I just cannot get anything to display on the LCD....any suggestions?
    Also, I am not sure my config for the external osc is correct. I am using a 4Mhz crystal with two 18p caps and selecting XT in the EPIC oscillator Config setting....which worked fine for the 16F84A.

    Code:
    
    DEFINE OSC 4
    
    DEFINE LCD_DREG PORTA	' uses Port A on Ports A 0,1,2,3
    DEFINE LCD_DBIT 0
    DEFINE LCD_RSREG PORTA
    DEFINE LCD_RSBIT 4
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 3
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2
    
    
    TRISA = %00000000 'make Port A outputs
    TRISB = %00000000 'make Port B outptuts
    
    ADCON1 = 7 ' turns off adc
    
    	Pause 1500      ' Wait for LCD to startup
            BlinkyLED VAR PORTB.1    ' This LED will BLINK
    
            Pause 1500       ' Wait for LCD to startup
    
    loop:   
    		High BlinkyLED
    		LCDOut $fe, 1   ' Clear LCD screen
    		Pause 500
            LCDOut "Hello"  ' Display Hello
            Pause 1000       ' Wait 1 second
    
            'LCDOut $fe, 1   ' Clear LCD screen
            LCDOut $fe, $c0 ' Move to next line on LCD
            LCDOut "How are you?" 
            Low BlinkyLED
            Pause 1000       ' Wait 1 second
    
            GoTo loop       ' Do it forever
    Last edited by EliteGM; - 22nd September 2007 at 19:53.

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, 19:14
  2. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  3. Play with LCD on PICDEM
    By The IceMan in forum mel PIC BASIC
    Replies: 5
    Last Post: - 22nd August 2008, 16:56
  4. Need help with LCD number display.
    By Steve Matson in forum mel PIC BASIC
    Replies: 8
    Last Post: - 26th June 2007, 23:07
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02: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