EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / need help to convert into assembly…please help me…

need help to convert into assembly…please help me…

|

Microcontroller › 8051 › need help to convert into assembly…please help me…

  • This topic has 3 replies, 2 voices, and was last updated 11 years, 3 months ago by Ashutosh Bhatt.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • 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]!=’’){lcddata(hour[count]);count++;
    }
    count=0;lcdcmd(0xC8);
    while(count!=2){hour1[count]=scan_key();count++;
    }
    H=(hour1[0]*10)+hour1[1];
    count=0;lcdcmd(0x01);lcdcmd(0x80);
    while(mint[count]!=’’){lcddata(mint[count]);count++;
    }
    count=0;lcdcmd(0xC8);
    while(count!=2){mint1[count]=scan_key();count++;
    }
    M=(mint1[0]*10)+mint1[1];count=0;delay(10000);
    lcdcmd(0x01);lcdcmd(0x80);
    }
    void onemintdelay()
    {
    int count1=0,sec,check;
    xyz:
    S=2;
    for(sec=0;sec<59;sec++){
    count1=0;
    while(count1!=500)
    {
    TMOD=0x01;TH0=0xF8;TL0=0xCC;TR0=1;
    while(!TF0);TR0 = 0;TF0 = 0;count1++;
    }
    S++;lcdcmd(0xCB);tochar(S);
    check=scan_key1();
    if(check==1)
    {
    start();goto xyz;
    }}  
    display();
    }
    void main()
    {
    lcdint();start();
    while(1){onemintdelay();}
    }
    void start()
    {
    settime();delay(100);count=0;lcdcmd(0x01);lcdcmd(0x80);
    while(set[count]!=’’){lcddata(set[count]);count++;
    }
    count=0;lcdcmd(0x89);
    while(clock[count]!=’’){lcddata(clock[count]);count++;
    }
    count=0;lcdcmd(0xC4);tochar(H);lcddata(‘:’);tochar(M);
    lcdcmd(0xCB);tochar(S);
    }
    void display(){
    count=0;lcdcmd(0x01);lcdcmd(0x80);
    while(set[count]!=’’){lcddata(set[count]);count++;
    }
    count=0;lcdcmd(0x89);
    while(clock[count]!=’’){lcddata(clock[count]);count++;
    }
    count=0;
    if(H==12 && M>=60 && S>=60)
    {S=1;H=1;M=1;}if(M>=60){H++;M=1;S=1;}if(S>=60){M++;S=1;}
    lcdcmd(0xC4);tochar(H);lcddata(‘:’);tochar(M);lcdcmd(0xCB);tochar(S);
    }
    int scan_key1()
    {
    int c;
    r0=0;r1=1;r2=1;r3=1;
    if(c0==0 && r0==0 ){c=1;}
    else c=0;P1=0xFF;return c;
    }

    October 13, 2014 at 6:03 pm #12276
    Ashutosh Bhatt
    Participant

    assembly language programming is too much hard

    it is prefered to program in C language when we have to interface LCD, RTC and other such devices

    so i suggest you dont try to convert it in assembly language

    October 13, 2014 at 6:20 pm #12280
    fitrie
    Participant

    I need to make one project by using assembly….too difficult to find coding project in assembly…:(

    October 16, 2014 at 5:54 pm #12291
    Ashutosh Bhatt
    Participant

    a very simple project but very interesting and excelent I can suggest is

    “LED chaser using micro controller”

    or

    “dancing LED pyramid using micro controller”

     

    such projects are very easy to do programming in assembly because it does only LED on/off in specific sequence

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • factory device from 2017'ish with web ui - too old to function with Microsoft Edge ? January 14, 2026
  • flexible copper cable January 14, 2026
  • renewed interest in old project I call it WICKED 8 January 14, 2026
  • updating circuit with power on off switching January 14, 2026
  • Steering angle sensor question January 13, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise