Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to write a busy flag program?

Status
Not open for further replies.

ru

Junior Member level 1
Joined
Sep 30, 2004
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
168
how to write busy flag?

how is the busy flag program looks like?
how to use it??
anyone who knows pls help me asap.. is urgent...
thanks...
 

how to write busy flag?

Salam,

You forgot to mention where do you use the busy flag.

busy flag is general word used in many applications.

Please be more detail.

SphinX
 

Re: how to write busy flag?

#include<at89s53.h>

#define EN P0_1
#define RW P0_2
#define RS P0_7
#define SW P0_6
#define clearLCD 0x01


void Delay(unsigned int Duration)
{
while((Duration--)!=0)
{
unsigned int loop=1000;
while((loop--)!=0);
}
}

void strobe()
// Generate the E signal
{
EN = 1;
Delay(5);
EN = 0;
Delay(5);
}


void LCD_control(unsigned char controlCode) // Control position of characters which is going to be displayed.
{
P2=controlCode;
RS=0;
RW=0;
strobe();
}

void LCD_CMD_Write(unsigned char Command)
{
EN=0;
P2=Command;
RS=0;
RW=0;

EN=1;
Delay(5);
EN=0;
Delay(5);
}

void LCD_DATA_Write(unsigned char Data)
{
EN=0;
P2=Data;
RS=1;
RW=0;

EN=1;
Delay(5);
EN=0;
Delay(5);
}

void main()
{
unsigned char x,y;

LCD_CMD_Write(0x38); //8-bit, 2-line display, 5x7 font
LCD_CMD_Write(0x06); //auto increment
LCD_CMD_Write(0x0E); //display on, cursor on, no blinking
LCD_CMD_Write(clearLCD); //clear display, reset


while(1){


LCD_CMD_Write(clearLCD); //clear display, reset

for(x=0x41;x<0x5B;x++)
{

LCD_CMD_Write(0x0e);
LCD_control(0xcf);
LCD_DATA_Write(x);
Delay(5);
}

for(y=0x31;y<0x3a;y++)
{
LCD_CMD_Write(0x0e);
LCD_control(0x80);
LCD_DATA_Write(y);
Delay(5);
}

}

}




somewhere in between the program to replace the delay function.
to make it program more efficient n fast..
thanks for ur kind reply..
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top