Dedicated LCD Controller question


Results 1 to 7 of 7

Threaded View

  1. #6
    Join Date
    Aug 2005
    Posts
    95


    Did you find this post helpful? Yes | No

    Default Try this

    @ DEVICE PIC16F84A, HS_OSC, PWRT_ON, WDT_OFF, PROTECT_OFF

    DEFINE OSC 20 ' Set speed to 20MHz
    TRISB = %00000000 ' All PORTB pins are outputs

    ' LCD DEFINES
    DEFINE LCD_BITS 8
    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 4 'PORTB.0 is first data
    DEFINE LCD_LINES 2 'Number of lines on LCD to be used
    define LCD_RSREG PORTA 'Port used for LCD RS Pin
    define LCD_RSBIT 3 'Port Pin used for LCD
    define LCD_EREG PORTA 'Port used for LCD E pin
    define LCD_EBIT 4 'Port Pin used for LCD E Pin
    define LCD_COMMANDUS 2000 'Delay between sending lcd commands
    define LCD_DATAUS 50 'Delay time between data sent

    SerData VAR word
    SerPin VAR PORTA.2
    TRISA.2=1

    pause 1000
    LCDOut $FE, 1 'Clear LCD
    pause 20
    lcdout $FE, 2 'Return to home position
    pause 20

    GOTO Start

    Start:
    SERIN SerPin,6,SerData 'receive data
    LCDOut Serdata ' Send to LCD
    If serdata =5 then gosub clearlcd
    GOTO Start
    END

    clearlcd:
    lcdout $FE,$80," "
    lcdout $FE,$C0," "
    return

    So if you send number 5 to your pic it will clear the lcd. From your code ive asumed you have use a 2 line lcd.

    Hope it helps
    Sphere

    lcdout $FE,$80," "
    lcdout $FE,$C0," "
    when I post the above it has 20 spaces between " " but it is only showing about 4 so add about 20 in your program
    Last edited by Sphere; - 24th February 2006 at 17:25.

Similar Threads

  1. LCD with T6963C controller
    By Demon in forum Off Topic
    Replies: 9
    Last Post: - 22nd May 2022, 20:11
  2. 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
  3. 16f688 LCD what have I done wrong
    By spitfiredriver in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 8th August 2009, 19:54
  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