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 support@ccsinfo.com

LCD with PICDEM 2 PLUS Board problems

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



Joined: 08 Apr 2008
Posts: 16

View user's profile Send private message

LCD with PICDEM 2 PLUS Board problems
PostPosted: Thu Apr 10, 2008 1:50 pm     Reply with quote

Hi there,

Can anyone help? I'm trying to get the LCD display working on my PICDEM 2 PLUS board but I'm having no luck. Here is my code:
Code:

#include<16f877.h>

#use delay(clock=4000000)
#fuses xt,nowdt,noprotect,put

#include<lcd.c>

#define LCD_DB4 PIN_D0
#define LCD_DB5 PIN_D1
#define LCD_DB6 PIN_D2
#define LCD_DB7 PIN_D3

#define LCD_E PIN_A1
#define LCD_RS PIN_A3
#define LCD_RW PIN_A2


void main()

{
lcd_init();

while(1)

   {

   //lcd_gotoxy(a,2);

   lcd_putc("Hello");
   
   delay_ms(1000);   

   }
}

I have the correct pinouts etc.. and the file compiles ok. I'm quite new at this so any help would be great!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Apr 10, 2008 2:04 pm     Reply with quote

There are two different versions of the PicDem2-Plus board, and they
require different versions of the Flex LCD driver.

This page shows the old version of the board: http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010072&part=DM163022

This page shows the new "Rohs update" version:
http://www.microchipdirect.com/ProductSearch.aspx?Keywords=DM163022

Which board do you have ?

The driver that you're using comes from this post in the Code Library.
It has a sample program below the driver. It also has a link to the
changes required if you have the "Rohs" version of the PicDem2-Plus.
http://www.ccsinfo.com/forum/viewtopic.php?t=24661

However, I'm not sure you're using the Flex driver, because you have
an #include statement that refers to "lcd.c". That's the name of the
CCS driver. It's different from the Flex driver, given in the link above.
Use the one in the link, and save it as "flex_lcd.c".

I suggest that you use the sample test program. Your code as posted
leaves out several essential things. You've left out the NOLVP, and
you've left out the \f in the printf statement, which clears the LCD screen
and puts the cursor in the home position. If you use the sample code in
the link above, it will fix most of your problems.
mxkid



Joined: 08 Apr 2008
Posts: 16

View user's profile Send private message

PostPosted: Thu Apr 10, 2008 2:57 pm     Reply with quote

Thanks for the prompt reply, Works a treat!!
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