All,
I am trying to find a way to create custom characters using the CGRAM of a 20x4 LCD. I've been trying to browse online and I've only located ASM examples. I can't completely understand ASM so I'd much rather write it in PBP. I have the LCD wired to PORTB of my PIC16F877A MCU. I've listed my define's as shown in the code below.
Now, I have no problem with sending messages to my LCD.Code:DEFINE OSC 20 ' Define 20MHz Oscillator DEFINE LCD_RSREG PORTB ' Set LCD Register Select port DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit - pin 4 of LCD DEFINE LCD_RWREG PORTB ' Set LCD Read Write port DEFINE LCD_RWBIT 2 ' Set LCD Read Write bit - pin 5 of LCD DEFINE LCD_EREG PORTB ' Set LCD Enable port DEFINE LCD_EBIT 3 ' Set LCD Enable bit - pin 6 of LCD DEFINE LCD_DREG PORTB ' Set LCD Data port DEFINE LCD_DBIT 4 ' Set starting bit (0 or 4) if 4-bit bus DEFINE LCD_BITS 4 ' 4-bit LCD data bus - pins 11 - 14 of LCD DEFINE LCD_LINES 4 ' Set number of lines on LCD DEFINE LCD_COMMANDUS 2000 ' Set command delay time in us DEFINE LCD_DATAUS 50 ' Set data delay time in us
However, I've designed a "logo", if you will, that I would like to display on the LCD. I know that I want to use the 5x8 dot format but I'm not sure how to do this in PBP. Nor am I certain of how to write to the CGRAM addresses that need to be written to in order to display the characters that I'm trying to create. Can anyone provide an example PBP code to help me with this?Code:MAIN: LCDOUT $FE, 1 LCDOUT $FE, 2 LCDOUT $FE, $0C LCDOUT "Testing my 20x4" LCDOUT $FE, $C0 LCDOUT "LCD project." LCDOUT $FE, $94 LCDOUT "Built By:" LCDOUT $FE, $D4 LCDOUT "Me" PAUSE 3000 GOTO MAIN
Thanks in advance....




Bookmarks