send data or char 4m hyperterminal to lcd using 89c51

Status
Not open for further replies.

Send data as ASCII. Post screenshot of ReatTerm with your settings.

http://www.robotappstore.com/Knowledge-Base/2-How-to-Use-a-RealTerm-Terminal/16.html
i m also trying out from ASCII data for send
and my setting is below
1's PORT>port1>Baud9600>Data8bit>stopbits1>Hardware flow none>open >and click on change
2nd
go to in Display as>ascii>inver
3rd
send>send ascii
and here i got some yellow light in Status TXD{3}
and on the real term screen some data in green and red color
and i m using your second hex file that was sent to me ronak patellv2
 

Don't Invert the data in RealTerm but make sure RealTerm sends CR i.e., 0x0D after some character like 'A'. That is type A and use send ASCII button and in EOL options check +CR because in your code your are looping UART routine until you receive 0x0D. Only if 0x0D is received the loop exits and data is printed. In Proteus it adds CR.

Please post the screenshot of your RealTerm PORT, ECHO, SEND, DISPLAY tabs.
 
Last edited:
but i can not find any option for taking screenshot of realterm
 

i cn't find any code in link.
Everything kenwilliam posts is spam. All he/she/it does is copy a random sentence from someone else's post, and add a link to an advert.

edit: Nevermind, I see the mods have just banned kenwilliam and deleted all his/her/it's posts. Yay mods! :grin:
 
Last edited:

Your RealTerm display tab image is not clear, post a new image of it. select display tab in realterm then click the title bar of realterm and ten press ALT+Print screen on keyboard and post the image.

In your code change
Code:
ptr = str;
to
Code:
ptr = &str;
 
Last edited:
 

Check Half-Duplex in Display Tab and see it it works.
still not getting any changes on lcd .here only my name is printed
and in next line there is an cursor of lcd.
and also change that code
#include <REGX51.H>

#define DATA P2
sbit rs= P2^0;
sbit rw= P2^1;
sbit en= P2^2;

////////////////////////////////////Delay////////////////////////////////////
void mdelay(unsigned int itime)
{
unsigned int i,j;
for(i=0;i<itime;i++)
for(j=0;j<1275;j++);
}
/// / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / L C D COMMAND////////////////////////////////////
void lcdcmd(unsigned char value)
{
P1=value;
rs=0;
rw=0;
en=1;
mdelay(1);
en=0;
}
void lcd_data(unsigned char value)
{

P1=value;
rs=1;
rw=0;
en=1;
mdelay(1);
en=0;
}
/////////////////////////////////STRING LCD////////////////////////////////
void string_lcd(unsigned char * ptr)
{
unsigned int h,j=0;
while(*ptr)
{
h++;
if(h<15)
{
lcd_data(*ptr++);
}
if(h>=15)
{
lcdcmd(0xC0+j);
lcd_data(*ptr++);
j++;

}
// *(ptr++);
}
}
//INITIALIZATION///////////////////////////////
void uart_init()
{
TMOD=0x20;
TH1=0xFD;
SCON=0x50;
TR1=1;
}
/// / / / / / / / / / / / / / / / / / / / / / / / / / / / / L C D INITIALIZATION//////////////////////////////
void lcd_init()
{
lcdcmd(0x38);
//mdelay(250);
lcdcmd(0x0E);
//mdelay(250);
lcdcmd(0x01);
//mdelay(250);
lcdcmd(0x06);
lcdcmd(0x80);
} //mdelay(250);

void main()
{

unsigned char str2[40],*ptr;
unsigned int i;
ptr=&str2;
uart_init();
lcd_init();

string_lcd("ronkpatell");
lcdcmd(0xC0);

while(1)
{
while(SBUF!=0x0D) //Checking if the enter is pressed or not
{
while(RI==0);
RI=0;
str2=SBUF;
i++;
}
str2='\0';
string_lcd(ptr);
// To display on LCD
for(i=0;i<6;i++)
{
lcd_data(str2);
}
}
}
 

Post code. Try this code. It will echo back the sent characters. If you send A then you will receive another A in RealTerm.
 

Attachments

  • ronkpatell v3.rar
    202 KB · Views: 84
Last edited:

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…