View previous topic :: View next topic |
Author |
Message |
Manor_Villages
Joined: 09 Mar 2009 Posts: 5
|
LCD display program for PIC Millennium board |
Posted: Mon Mar 09, 2009 9:02 am |
|
|
Hi, I am new to using a PIC Millennium board and MPLAB. I need to write a program that will display a message or string on to the LCD of my board.
The LCD display is a 16 character by 2-line type using the industry standard HD44780. Can someone please help me out here. I have a LCD.C driver for this but don't really know how to modify this to display words on my LCD.
c:\program files\picc\drivers\lcd.c |
|
|
Manor_Villages
Joined: 09 Mar 2009 Posts: 5
|
|
Posted: Mon Mar 09, 2009 9:04 am |
|
|
I use a PIC 16F877A for this board |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Mar 09, 2009 12:10 pm |
|
|
This board needs to have jumpers added, to connect the PIC to the LCD.
Choose some pins and make the connections. Then you can use this
LCD driver. Edit the pin list at the top of the driver file to match the
same PIC pins that you are using on the Millennium board.
http://www.ccsinfo.com/forum/viewtopic.php?t=24661 |
|
|
Manor_Villages
Joined: 09 Mar 2009 Posts: 5
|
|
Posted: Tue Mar 10, 2009 8:00 am |
|
|
Code: | I tried the program below and it works fine
#include <16F877A.H>
#fuses XT,NOWDT,NOPROTECT,BROWNOUT,PUT,NOLVP
#use delay (clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
void lcd_putc(char c)
{
printf("%X ", c);
}
//=================================
void main()
{
lcd_putc("Hello World");
while(1);
} |
but I get the following error when i try to run the LCD.C driver on CCS.
Quote: | *** Error 128 "C:\picproject\test.c" Line 52(1,12): A #DEVICE required before this line |
|
|
|
Manor_Villages
Joined: 09 Mar 2009 Posts: 5
|
|
Posted: Tue Mar 10, 2009 8:02 am |
|
|
Also Should I put the LCD.C driver under other files? and the main program uder Source files? |
|
|
Manor_Villages
Joined: 09 Mar 2009 Posts: 5
|
|
Posted: Tue Mar 10, 2009 8:07 am |
|
|
I modifies the LCD.C driver as given below but i still get the error.
#define LCD_D4 PIN_D4
#define LCD_D5 PIN_D5
#define LCD_D6 PIN_D6
#define LCD_D7 PIN_D7
#define LCD_enable PIN_D0
#define LCD_RS PIN_D1
#define LCD_RW PIN_D2
the error is shown before this line of commands
struct lcd_pin_map { // This structure is overlayed
BOOLEAN enable; |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Guest
|
|
Posted: Tue Mar 10, 2009 10:15 am |
|
|
Thanks a lot!! ...it was very helpful PCM! |
|
|
|