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.

AT89C2051 not working URGENT

Status
Not open for further replies.

amayilsamy

Advanced Member level 1
Joined
Feb 5, 2013
Messages
420
Helped
38
Reputation
76
Reaction score
34
Trophy points
1,308
Location
Chennai,India
Activity points
3,370
I'm using AT89C2051 for small function..

I post My code and schematic.. it is working Proteus in my circuit is not worked.



Code:
  #include<reg51.h>

  sbit led = P1^7;

  sbit sw  = P1^6;



  int i,a;

  void delay(unsigned int ms) ;

  void main()
  		
			{
			P0=0x00;

			while(1)
			{
			  P1=0x00;
//			led  = 1;
//			sw   = 0;

		
			delay(10);

//			led  = 0;
//			sw   = 1;
			P1=0xff;
			delay(1);
			}

			}

void delay(unsigned int ms)
			
		{

			for(a=0;a<=5;a++)
				{
					for(i=0;i<=10000;i++);
					for(i=0;i<=10000;i++);
					for(i=0;i<=10000;i++);
				}
		}
 

Attachments

  • 2051.pdf
    17 KB · Views: 53

I changed delay(10000) and removed the lines P1=0x00; P1=0xff; Again its not work..

And I also see the output in scope..

And I power up the controller all pins in high (4.85 V) except P1.1,P1.0.

I try to low the all port pins its doesn't work.

Code:
void main()
{
while(1)
{
P1=0x00;
P3=0x00;

}
}
 
Last edited:

Maybe it is a problem with Proteus 89C2051 model. Try in hardware. Are you sure you have included the right device header file in the code?

Copy paste this hex data to a txt file and save it as .hex file and use this file and see if it works.

:03000000020003F8
:0C000300787FE4F6D8FD7581070200004C
:00000001FF
 
Last edited:

hello,
while you program the ic , open and see the hex file is there some program , because in some compiler hex for 2051 will not be produced . or you could check this same code with 4051. once i had also got a problem like this my compiler was not producing proper hex file.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top