Microcontroller › 8051 › need help to convert into assembly…please help me…
- This topic has 3 replies, 2 voices, and was last updated 10 years, 6 months ago by
Ashutosh Bhatt.
-
AuthorPosts
-
October 13, 2014 at 3:23 pm #3294
fitrie
Participant#include<reg51.h>
int scan_key();
int scan_key1();
void display();
void start();
void tochar(unsigned int value);
void onemintdelay();
sbit rs=P3^5; //Register select (RS)
sbit en=P3^6; //Enable (EN) pin
sbit r0=P1^0;
sbit r1=P1^1;
sbit r2=P1^2;
sbit r3=P1^3;
sbit c0=P1^4;
sbit c1=P1^5;
sbit c2=P1^6;
sbit c3=P1^7;
char clock[]={“CLOCK!”},hour[]=”HOUR 01 to 12″,mint[]=”MINT 01 to 60″,set[]={“RESET 1”};
int count=0,H,M,S=0,hour1[1],mint1[1];
void delay(unsigned int time) //Time delay function
{
unsigned int i,j;
for(i=0;i<time;i++)
for(j=0;j<5;j++);
}
void lcdcmd(unsigned char value) //Function for sending values to the command register of LCD
{
P2=value; //sending commands on port 2 Means to the lcd command register
P3=0x40;
delay(50);
en=0;
delay(50);
return;
}
void lcddata(unsigned char value) //Function for sending values to the data register of LCD
{
P2=value; //sending data on port 2 Means to the lcd data register
P3=0x60;
delay(50);
en=0;
delay(50);
return;
}
void lcdint(void) //Initializing lcd and ports
{
P1=0xFF;P2=0x00; P3=0x00;delay(15000);
lcddata(0x30);delay(4500);lcddata(0x30);
delay(300);lcddata(0x30);
delay(650);lcdcmd(0x38);delay(50);lcdcmd(0x0C);
delay(50);lcdcmd(0x01);delay(50);lcdcmd(0x06);
delay(50);lcdcmd(0x80);delay(50);
}
void settime() //Setting time
{
lcdcmd(0x01);
lcdcmd(0x80);
while(hour[count]!=’