Forum Replies Created
-
AuthorPosts
-
January 12, 2013 at 5:27 pm in reply to: 16×2 LCD Skipping Alphabetic Letters (b,d,f,h,j etc.) – AT89C5131A #8937guydParticipant
4bit communication with LCD passed successfully.
Thanks.
December 31, 2012 at 2:31 pm in reply to: 16×2 LCD Skipping Alphabetic Letters (b,d,f,h,j etc.) – AT89C5131A #8887guydParticipantSorry I did not write for a while.
No, it did not help.
I tried another methods to send data to LCD, more delays,
trying to send a single letter, “B” which is 0x42, or 01000010, port on the card is on the right data, also port on the lcd is on the right data, but still the display show “C”.
maybe LCD is defective?
December 21, 2012 at 8:50 pm in reply to: 16×2 LCD Skipping Alphabetic Letters (b,d,f,h,j etc.) – AT89C5131A #8870guydParticipantWell, in theory that is the problem…
but for some reason, the problem still extist.
the code:
//Program to display String on LCD
#include<reg52.h>
#define lcd_data_pin P2
sbit rs=P3^0; // Register select pin
sbit rw=P3^1; // Read write pin
sbit en=P3^2; // Enable pin
void delay(unsigned int msec) //delay function
{
int i,j;
for(i=0;i<msec;i++)
for(j=0;j<1275;j++);
}
void lcd_command(unsigned char comm) // function to send command to LCD
{
lcd_data_pin=comm;
en=1;
rs=0;
rw=0;
delay(1);
en=0;
}
void lcd_data(unsigned char disp) // function to send data on LCD
{
lcd_data_pin=disp;
en=1;
rs=1;
rw=0;
delay(20);
en=0;
}lcd_dataa(unsigned char *disp) // function to send string to LCD
{
int x;
for(x=0;disp[x]!=0;x++)
{
lcd_data(disp[x]);}
}void lcd_ini() //Function to inisialize the LCD
{
lcd_command(0x38);
delay(5);
lcd_command(0x0F);
delay(5);
lcd_command(0x80);
delay(5);
}
void main()
{
while(1){
lcd_ini();
lcd_dataa(“A B :a;a”);}
}Result: LCD Displays “A!C!;a;a”
December 21, 2012 at 7:27 pm in reply to: 16×2 LCD Skipping Alphabetic Letters (b,d,f,h,j etc.) – AT89C5131A #8869guydParticipantHey,
Thanks for the reply, I managed to debug it, seems like port 2.0 did not change it value, so D0 on LCD was getting ‘1’ all the time.
Thanks again for taking your time trying to help!
-
AuthorPosts