ME Labs, Inc.
719-520-5323
 
Home:
  Developer Resources:

Programming Clues
    Sample Programs
   
    PICBASIC PRO™
Compiler Manual
    PICBASIC™ Compiler
Manual
    Serin2/Serout2 Modes
    ASCII Character Set
    Number Conversion
    Floating Point
Routines
    PBP Debug Monitor
    Articles and Tutorials

Hardware Clues
    Parts / Vendor List
    PICPROTO™ Boards
    LAB-X1 Docs
    LAB-X2 Docs
    LAB-X20 Docs
    LAB-X3 Docs
    LAB-X4 Docs
    LAB-XUSB Docs
    LAB-XT Docs
     
 

microEngineering Labs, Inc. | 1-719-520-5323 | Example Program - LCD.pbp

PICBASIC PRO program to demonstrate operation of an LCD in 4-bit mode.
' Name        : LCD.pbp
' Compiler    : PICBASIC PRO Compiler 2.6
' Assembler   : PM or MPASM
' Target PIC  : 16F or 18F
' Hardware    : LCD display
' Oscillator  : Any internal or external
' Keywords    : LCDOUT
' Description : PICBASIC PRO program to demonstrate operation of an LCD in 4-bit mode.
'

' LCD should be connected as follows:
' LCD   PIC
' DB4   PortA.0
' DB5   PortA.1
' DB6   PortA.2
' DB7   PortA.3
' RS    PortA.4 (add 4.7K pullup resistor to 5 volts)
' E     PortB.3
' RW    Ground
' Vdd   5 volts
' Vss   Ground
' Vo    20K potentiometer (or ground)
' DB0-3 No connect

   Pause 500       ' Wait for LCD to startup

mainloop:
   Lcdout $fe, 1   ' Clear LCD screen
   Lcdout "Hello"  ' Display Hello
   Pause 500       ' Wait .5 second

   Lcdout $fe, 1   ' Clear LCD screen
   Lcdout "World"
   Pause 500       ' Wait .5 second

   Goto mainloop   ' Do it forever

   End

           

Download the program file.