|
|
View previous topic :: View next topic |
Author |
Message |
cenadius
Joined: 13 Mar 2010 Posts: 11
|
|
Posted: Sat Mar 13, 2010 9:25 pm |
|
|
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
|
|
Posted: Sat Mar 13, 2010 10:25 pm |
|
|
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
|
|
Posted: Sat Mar 13, 2010 10:46 pm |
|
|
#fuses HSPLL, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
so i change the XT fuse to HS, ok i get it.
thank you very much. |
|
|
|
|
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
|