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

Problem with LCD

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



Joined: 13 Mar 2010
Posts: 11

View user's profile Send private message

PostPosted: Sat Mar 13, 2010 9:25 pm     Reply with quote

Hi, I am using pic18f452 with 20MHz crystal. I am using PortB for my LCD, but my LCD display still didn't display anything although it compiles with no errors.
Code:

// flex_lcd.c

// These pins are for the Microchip PicDem2-Plus board,
// which is what I used to test the driver.  Change these
// pins to fit your own board.

#define LCD_DB4   PIN_B2 <-- i have change the port to my connection
#define LCD_DB5   PIN_B3 <--i have change the port to my connection
#define LCD_DB6   PIN_B4 <--i have change the port to my connection
#define LCD_DB7   PIN_B5 <--i have change the port to my connection

#define LCD_E     PIN_B1 <--i have change the port to my connection
#define LCD_RS    PIN_B0 <--i have change the port to my connection
//#define LCD_RW    PIN_A2 <-- do i need comment out this? my R/W is connected to ground

// If you only want a 6-pin interface to your LCD, then
// connect the R/W pin on the LCD to ground, and comment
// out the following line.

//#define USE_LCD_RW   1     


My main program for testing is as follows:
Code:

#include <18F452.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 20000000)

#include "flex_lcd.c"
   
//==========================
void main()
{
lcd_init();  // Always call this first.

lcd_putc("Hello World");

while(1);
}

Pls help me check is there any wrong?
My LCD display is in good condition.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Mar 13, 2010 10:25 pm     Reply with quote

Quote:
#include <18F452.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 20000000)

#include "flex_lcd.c"

//==========================
void main()
{
lcd_init(); // Always call this first.

lcd_putc("Hello World");

while(1);
}

The HS fuse is required for a 20 MHz crystal. It won't oscillate with the
XT fuse.
cenadius



Joined: 13 Mar 2010
Posts: 11

View user's profile Send private message

PostPosted: Sat Mar 13, 2010 10:46 pm     Reply with quote

#fuses HSPLL, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP

so i change the XT fuse to HS, ok i get it.

thank you very much.
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