CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

LCD display program for PIC Millennium board

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Manor_Villages



Joined: 09 Mar 2009
Posts: 5

View user's profile Send private message

LCD display program for PIC Millennium board
PostPosted: Mon Mar 09, 2009 9:02 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Mar 09, 2009 9:04 am     Reply with quote

I use a PIC 16F877A for this board Smile
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Mar 09, 2009 12:10 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Mar 10, 2009 8:00 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Mar 10, 2009 8:02 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Mar 10, 2009 8:07 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Mar 10, 2009 9:43 am     Reply with quote

Read about using multiple source files with the CCS compiler:
http://www.ccsinfo.com/forum/viewtopic.php?t=37125
Guest








PostPosted: Tue Mar 10, 2009 10:15 am     Reply with quote

Thanks a lot!! Smile ...it was very helpful PCM!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group