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 / 89c2051 controller

89c2051 controller

|

Microcontroller › 8051 › 89c2051 controller

  • This topic has 2 replies, 3 voices, and was last updated 11 years, 7 months ago by Ashutosh Bhatt.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • October 18, 2014 at 2:40 pm #3299
    awais
    Participant

     

    hay every one i have compiled a code for interfacing of optical sensor and metal detector to control relay i am usng 89c2051 controller but problem is that i am tring to change the out put of controller with the out put of comparator plz help me and code is

     

    #include<AT89X51.h>
    sbit pro=P3^0;
    sbit eye=P3^1;
    sbit out1=P1^3;
    sbit out2=P1^2;
    sbit an1=P1^0;
    sbit an2=P1^1;
    sbit out3=P3^6;
    void delay(unsigned int limit)
    {
    int i,j;
    for(i=0;i<limit;i++)
    {
    for(j=0;j<1275;j++);
    }
    }
    void main()
    {
    while(1)
    {
    pro=1;
    eye=1;
    an1=an2=out3=1;
    if(pro==1&&eye==0&&out3==0)
    {
    out2=0;
    delay(200);
    out2=1;
    }
    else if(pr0==1;&&eye==0&&out3==1)
    out2=0;
    }
    while(pro==0&&eye==1)
    {
    out2=1;
    out1=0;
    delay(200);
    out1=0;

    }
    while (pro==0&&eye==0)
    {
    out1=0;
    out2=0;
    }
    }
    }

    end;

    plz help me 

    October 20, 2014 at 5:23 am #12298
    AJISH ALFRED
    Participant

    Hi,

    “problem is that i am tring to change the out put of controller with the out put of comparator” ……. and what happens when you try that, what result are you expecting??

    October 20, 2014 at 5:44 pm #12306
    Ashutosh Bhatt
    Participant

    pls post your circuit diagram also

    that makes easy to understand ur program code

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

RSS Recent Posts

  • Battery discharger May 20, 2026
  • Relay question May 19, 2026
  • Phone Charger 5v to 12v May 19, 2026
  • reviving old swordfish program but? May 18, 2026
  • Assistance locating a 'trail' camera gadget, please ? May 18, 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