View previous topic :: View next topic |
Author |
Message |
karthickiw
Joined: 09 Aug 2007 Posts: 82 Location: TN, India
|
problem with 16 X 2 LCD |
Posted: Wed Apr 29, 2009 12:32 am |
|
|
Hello CCS friends,
I try to display " Hello world " on LCD display, but LCD don't display any character, even cursor also. I use inbuilt lcd.c library. My lcd model is JHD162A. I connect LCD in port B.
My code is
Code: |
#include<16f873a.h>
#device adc=8
#use delay(clock=4000000)
#fuses NOWDT,XT, PUT, PROTECT, NODEBUG, BROWNOUT, NOLVP, CPD, NOWRT
#include <lcd.c>
#include <string.h>
///////////////////////////////void main function///////////////////////////////
void main()
{
lcd_init(); // init the LCD
delay_ms(100);
output_high(pin_a0);
lcd_putc("\fHello World\n");
while(true)
{
output_high(pin_a0);
delay_ms(200);
output_low(pin_a0);
delay_ms(200);
}// while
}
|
Please see my code and give the best solution. |
|
![](templates/subSilver/images/spacer.gif) |
UDIPTA
Joined: 29 Apr 2009 Posts: 13 Location: Kolkata,India
|
|
Posted: Wed Apr 29, 2009 4:19 am |
|
|
The CCS LCD.c file defaults to all connections to port D. If U wish to use PORTB then the line #define use_portb_lcd TRUE must be added in your program before the LCD.c file is included. Try it now !! |
|
![](templates/subSilver/images/spacer.gif) |
karthickiw
Joined: 09 Aug 2007 Posts: 82 Location: TN, India
|
already... |
Posted: Wed Apr 29, 2009 7:37 am |
|
|
UDIPTA wrote: | The CCS LCD.c file defaults to all connections to port D. If U wish to use PORTB then the line #define use_portb_lcd TRUE must be added in your program before the LCD.c file is included. Try it now !! |
i already un-comment that line.... |
|
![](templates/subSilver/images/spacer.gif) |
|