|
|
View previous topic :: View next topic |
Author |
Message |
loops0901
Joined: 01 Apr 2012 Posts: 5 Location: Malaysia
|
Problem on Interfacing VCM162A LCD display with PIC16F877A |
Posted: Sun Apr 01, 2012 9:11 pm |
|
|
Hi,
I am doing a simple project regarding interfacing LCD display with PIC16F877A. I am using CCS C compiler to produce HEX file. Then i use MPLAB IDE with PicSTART Plus to program the PIC. However, the LCD display does not worked with the program written where it shows blacked out with the backlight on. The model for LCD display used are VCM162A. Please help me checked whether where i had been done wrongly. Below are the codes and circuit :
Code: | #include <16F877A.h>
#use delay(clock=2000000)
#fuses HS,NOWDT,NOPROTECT,NOLVP
#define use_portb_lcd TRUE
#include <lcd.c>
int i;
int a,b,c;
char x[]={'W','e','l','c','o','m','e',' ','T','o',' ','M','i','c','r','o','-','C'};
void main()
{
lcd_init();
while (TRUE) {
for(a=0;a>=0;a++){
if(a==0){
printf(lcd_putc," READY!");
delay_ms(20);
printf(lcd_putc,"\f");
printf(lcd_putc," loading\n");
for(b=0;b<3;b++){
for(c=0;c<16;c++){
printf(lcd_putc,".");
delay_ms(3);
}
if(b==1)
printf(lcd_putc,"\n");
else
printf(lcd_putc,"\f");
}
}
else{
lcd_getc(3,1);
for(i=0;i<=17;i++){
printf(lcd_putc,"%c",x[i]);
delay_ms(11);
if(i==9){
lcd_getc(4,2);
}
}
delay_ms(20);
printf(lcd_putc,"\f");
}
}
}
}
|
Thank you very much |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Apr 01, 2012 9:49 pm |
|
|
Your program is too complicated for an LCD test program. Try a more
simple program. Example:
Code: |
#include <16F877A.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock=4M)
#define use_portb_lcd TRUE // LCD is on port B
#include <lcd.c>
//===================================
void main()
{
lcd_init();
lcd_putc("Hello World");
while(1);
}
|
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9241 Location: Greensville,Ontario
|
|
Posted: Mon Apr 02, 2012 5:26 am |
|
|
also.. while you say you're using the 'VCM162A' LCD your schematic lists an 'LM016L' LCD.
Be sure to check the entire datasheets to be 100% sure that they are the same! There could be some timing differences or other criteria that may not allow the VCM162A to perform using the LCD.C driver.
The simply LCD test program given will quickly tell !
Always start small...build upon small sucesses. |
|
|
loops0901
Joined: 01 Apr 2012 Posts: 5 Location: Malaysia
|
|
Posted: Mon Apr 02, 2012 9:46 pm |
|
|
I had tried the simple circuit as well but it still does't work for me... The result is still the same where it only show black blocks in a line.
The circuit that i posted is to show the connection of PIC and LCD display. In Proteus Software , model VCM162A does not included in the library. So i just simply replace LCD with the model available in the proteus. I had checked datasheet as well and their connection pins between VCM162A and LM016L are the same. |
|
|
loops0901
Joined: 01 Apr 2012 Posts: 5 Location: Malaysia
|
|
Posted: Mon Apr 02, 2012 10:30 pm |
|
|
I found that VCM162A's controller is KS0066. Does this controller capable to perform using LCD.C driver? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Apr 03, 2012 3:51 pm |
|
|
Quote: | #include <16F877A.h>
#use delay(clock=2000000)
#fuses HS,NOWDT,NOPROTECT,NOLVP
|
In the #use delay() statement above, you have done the usual mistake
of dropping a 0 from the frequency. You have set it for 2 MHz.
You probably really want it to be set for 20 MHz.
I recommend that you do it like this:
Quote: |
#include <16F877A.h>
#use delay(clock=20M)
#fuses HS,NOWDT,NOPROTECT,NOLVP
|
The compiler accepts that frequency notation and it's much easier to see
that it's correct when you type it. |
|
|
loops0901
Joined: 01 Apr 2012 Posts: 5 Location: Malaysia
|
|
Posted: Sat Apr 07, 2012 3:26 am |
|
|
Hi, my LCD worked with the flex_lcd driver. Thank you so 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
|