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.

Sensor Using 89c2051 on Proteus

Status
Not open for further replies.

engineer4

Newbie level 4
Joined
Jan 10, 2011
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,310
Please help me about code and circuit is right?
here is code on KEIL
If it is wrong tell me what is wrong here?
____________________________
#include <AT892051.h>
sbit Buzzer=P1^7;
sbit PUSH_BUTTON=P3^0;
#define ON 0
#define OFF 1
void wait_a_second()
{
unsigned int x;
for(x=0;x<33000;x++);
}
main()
{
int i;
Buzzer=OFF;
for(;;)
{
while(PUSH_BUTTON==1)
{
}
for(i=1;i<30;i++)
{
Buzzer=ON;
wait_a_second();
Buzzer=OFF;
wait_a_second();
}
}
}
_________________________
 

Attachments

  • circuit.jpg
    circuit.jpg
    74.2 KB · Views: 111
Last edited:

If it is wrong tell me what is wrong here?
What result you were expecting??
Circuit is looking fine but I have some doubt on reset resistor and capacitor. shouldn't resistor on power side and capacitor on ground side ????

while(PUSH_BUTTON==1)
put ';' if you want the controller to be wait for button signal.
for(i=1;i<30;i++)
{
Buzzer=ON;
wait_a_second();
Buzzer=OFF;
wait_a_second();
}
This will toggle the buzzer 30 time with delay.

Please provide more detail about the project it may help us to help you :)
 

I didnt see your code, but confirm that the capacitors connected to the Xtal are 33Pf and not 33 microfrad as i saw in your schematic. With 33 Microfarad capacitors at osc pins, nothing will work.
 

I didnt see your code, but confirm that the capacitors connected to the Xtal are 33Pf and not 33 microfrad as i saw in your schematic. With 33 Microfarad capacitors at osc pins, nothing will work.

Proteus doesn't entertain external crystal and capacitor.
see what is the osc freq set in the properties of 89c2051.
PS: All capacitors used is ideal, replace them with real ones
 

Thank you for helping me.
What result I want is if button is pressed buzzer is giving sound.
I wanna make a sensor circuit.
I am replacing button to any sensor and buzzer is replacing any alarm circuit .
Is it clear to understand now?
 

clear a bit.
Every sensor has different interface, different protocols and even different voltage levels.
have you checked the osc frequency?
And I am still ambiguous about your question?what exactly you want to get from this forum? your code is OK for button and buzzer, circuit is also right. what else????
 

On the proteus ,it doesn't work.So I am asking from this forum.
Can you explain about sensor interface and protocol more clearly?
How to check the osc frequency?
I have attached my proteus file.Please check out it??:lol:
 

Attachments

  • buzzer.rar
    15.5 KB · Views: 77
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top