
Originally Posted by
LEDave
I'm game, don't forget I couldn't turn an LED on a few weeks ago though!
Sure, most of us couldn't flash an LED when we started.
But Mackrackit is doing a nice job of getting you up to speed, and a parallel LCD display isn't that hard to set up.
You'll need to set up 4 pins on your PIC, all on one port for your LCD data lines, and 2 more pins for Enable and Register Select
You'll need to make sure that those 6 pins are setup as digital outputs and any other stuff that shares those pins (ADC, comparators, etc) are disabled.
Once the pins are set correctly then you'll add a few DEFINE's to your program to tell the PIC where to find your LCD and what pins are what.
Like this, but with YOUR particular ports and pin numbers that you are using:
Code:
DEFINE LCD_DREG PORTD 'Set LCD Data port
DEFINE LCD_DBIT 4 'Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_RSREG PORTE 'Set LCD Register Select port
DEFINE LCD_RSBIT 0 'Set LCD Register Select bit
DEFINE LCD_EREG PORTE 'Set LCD Enable port
DEFINE LCD_EBIT 2 'Set LCD Enable bit
DEFINE LCD_BITS 4 'Set LCD bus size (4 or 8 bits)
Then it's just a matter of using the LCDOUT command...
Code:
LCDOUT $fe, 2, "HELLO WORLD"
or if you wanted to display the content of a variable as a decimal number:
Code:
myvariable var word
myvariable = 3955
LCDUT $fe, 2, DEC myvariable
It's easy! 
steve
Bookmarks