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.

[51] AT89C2051 Works in Proteus But it not works in Hardware.

Status
Not open for further replies.

yuvarajbe

Newbie level 5
Joined
Nov 12, 2013
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
79
hello ,

i am working on AT89C2051, i am trying to make a simple code as a start up for my full project .
i wrote i code just to switch the led on at P3^1 , it works in proteus but it is not working in real hardware .
also i tried to wrote a simple code in c language using Keil platform, and it burner by Willar Programmer. Here with I attached my code

anyone can give a help to solve the problem .

code:


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <at892051.h>
 
/*function for delay of 1 sec*/
sbit p3=P3^1;
void delay()
   {
      unsigned int x;
      for(x=0;x<33000;x++);
      }
 
 
 
main()
   {
   int cnt = 0;
      for (;;)
     {
      p3=1;
           delay();
            p3=0;
           delay();        
     }
    }

 

Attachments

  • Programmer_screenshot.png
    Programmer_screenshot.png
    72.8 KB · Views: 66
Last edited by a moderator:

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
21,994
Helped
4,591
Reputation
9,196
Reaction score
4,812
Trophy points
1,393
Activity points
145,219
Hi,

it works in proteus
.. this tells me the code does work.

So what about your hardware?

Klaus
 

yuvarajbe

Newbie level 5
Joined
Nov 12, 2013
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
79
Hi,
In Hardware nothing happened.its idle mode.I have one more doubt.

I am using IDE Keil uvision 2 its Evaluation version.For this any problem occur???
 

saswat

Junior Member level 2
Joined
Nov 16, 2012
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,416
Hi,
In Hardware nothing happened.its idle mode.I have one more doubt.

I am using IDE Keil uvision 2 its Evaluation version.For this any problem occur???
No problem in using IDE Keil uvision 2 Evaluation version. The Evaluation version is capable to handle the code size up to 2 kb and your code is less than this. Have you made your own hardware or you are using EVK board (or development board) ??.
 

yuvarajbe

Newbie level 5
Joined
Nov 12, 2013
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
79
Hi
Its my Own hardware. Connection shown below image.I connect port 3.1 instead of led pin in imagesch1.png
 

saswat

Junior Member level 2
Joined
Nov 16, 2012
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,416
What is the resistance value of the resistor which is connected with led?
 

yuvarajbe

Newbie level 5
Joined
Nov 12, 2013
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
79
Resistance Value is 330ohm. But i directly measured the pin3.1 through multimeter. there is no response While i give high or low by coding.
 

Okada

Banned
Joined
Jun 16, 2016
Messages
1,159
Helped
129
Reputation
252
Reaction score
128
Trophy points
63
Activity points
0
Maybe you have compiled for Debug mode instead of release mode.
 

yuvarajbe

Newbie level 5
Joined
Nov 12, 2013
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
79
In the debug mode, debugger use .obj files, and generate hex file in the state of release mode.
I cant get what u said?
 

saswat

Junior Member level 2
Joined
Nov 16, 2012
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,416
But i directly measured the pin3.1 through multimeter. there is no response While i give high or low by coding.

Just add one pull up resistor of 10K fromVcc to P3.1 and check by giving logic high and low!!

Capture.PNG
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top