8051 proramming

20 replies [Last post]
sleepy
User offline. Last seen 18 weeks 5 days ago. Offline
Joined: 03/06/2010
bOt Points: 74

I need to do a 8051 assembly program to control the automobile warning buzzer.Criterion are:

-buzzer activates if headlights are on and the driver's door is opened(they are connected by AND gate or

-buzzer activates if key is in ignition and driver's door is opened.(connected in AND gate)

 

So...what command should i put if i want to activate the buzzer based on the above criterion????

aamiraarfi
aamiraarfi's picture
User offline. Last seen 1 day 7 min ago. Offline
Joined: 11/02/2009
bOt Points: 417
hi sleepy

hi sleepy can u post a rough sketch of your the circuit, so that ppl can help u to achieve you task..

how to upload an image

 

shashwat
User offline. Last seen 5 hours 58 min ago. Offline
Joined: 02/18/2009
bOt Points: 1056
Upload your circuit diagram

Hi sleepy,

Programming part is pretty easy for the above mentioned task but it completely depends on your circuit diagram. Upload your circuit diagram then only it will be clear on which pins input is being received and on which pins output needs to be sent. Follow the link given by aamiraarfi in the above post to learn how to upload image(s).

sleepy
User offline. Last seen 18 weeks 5 days ago. Offline
Joined: 03/06/2010
bOt Points: 74
diagram sketch

Attached is the circuit:

More info on circuit:

1.headlights on,(by pressing S1);led1 on.

2.keys in ignition(by pressing S2);led2 on.

3.driver's door opened,(by pressing S3);led3 on.

4.when buzzer activated,7 segment(SSD1 and SSD2)will display "On";led4 will blink at an interval of 0.5 secs.

aamiraarfi
aamiraarfi's picture
User offline. Last seen 1 day 7 min ago. Offline
Joined: 11/02/2009
bOt Points: 417
8051 i/o assembly programming reference

HI sleepy! its nice to see your post 

I would advise you to go through this easy tutorial given on botskool

8051 i/o assembly programming reference

Make a small flow diagram and try to write a code on your own ..It 'll help you learn better.

hints:

Define your input and output pins

Use conditions and loops to turn on/off buzzer

Input pins:Headlight On,  Key in ignition & Door open

Output pins: LED1, LED2 and Buzzer

Logical operations will be done using assembly program like AND OR.. (depending upon the value of inputs, output pins will be set high)  

If you happen to fail post your logic and code, we are always there to help you ..

happy coding

shashwat
User offline. Last seen 5 hours 58 min ago. Offline
Joined: 02/18/2009
bOt Points: 1056
A better circuit

Hi sleepy,

Follow the instructions given by aamiraarfi in the above post. I have some suggestions for your circuit. Check out the circuit diagram given below -

Buzzer Circuit Diagram 

sleepy
User offline. Last seen 18 weeks 5 days ago. Offline
Joined: 03/06/2010
bOt Points: 74
Hi Shashwat, So...what should

Hi Shashwat,

So...what should I do or rather what code should I put if I want the buzzer to activate if both the headlights and driver's door are opened.Give a hint pls.

shashwat
User offline. Last seen 5 hours 58 min ago. Offline
Joined: 02/18/2009
bOt Points: 1056
Hi sleepy, Have you gone

Hi sleepy,

Have you gone through this tutorial - http://www.botskool.com/tutorials/electronics/8051/input-output-instruct...?

sleepy
User offline. Last seen 18 weeks 5 days ago. Offline
Joined: 03/06/2010
bOt Points: 74
sort of.I only managed to on

 Hi Shashwat,

sort of.I only managed to on the Led1 but I got no idea at the how to on Led3 too in order to activate the buzzer.

Note:- This post has been edited by sleepy at Thu, 03/11/2010 - 14:52.

sleepy
User offline. Last seen 18 weeks 5 days ago. Offline
Joined: 03/06/2010
bOt Points: 74
Hi anyone got solution to the

Hi anyone got solution to the program mentioned???Needed urgently.Tks!!

fatty
User offline. Last seen 19 weeks 5 days ago. Offline
Joined: 03/11/2010
bOt Points: 70
hi!!!!!!

hi  i m a beginner in dis robotics field .... i need to know wat is d c programming for a line follower to cross d a t point and move forward,,,,,,,,,m really strugglin to know dis plz let me know

shashwat
User offline. Last seen 5 hours 58 min ago. Offline
Joined: 02/18/2009
bOt Points: 1056
Hi sleepy, Have you decided

Hi sleepy,

Have you decided which sensor you are going to use for detection of all the three conditions - key in ignition, headlights on & door opened? If yes then before writing 8051 assembly code you need to decide first that output from all these three sensors are being received on which pins of microcontroller 8051. Kindly post these details and I ll help you write relevant 8051 assembly code for buzzer.

shashwat
User offline. Last seen 5 hours 58 min ago. Offline
Joined: 02/18/2009
bOt Points: 1056
Hi fatty, For detecting a

Hi fatty,

For detecting a crossover you need to have atleast have three ir sensors (one in centre and two on sides). If the bOt is following a black line, you can easily detect a crossover because when the bOt is a on crossover all the three ir sensors will be on black line. When such a situation arises just give the bOt command to move forward.

To be able to comprehend this concept properly I will suggest you to go through this tutorial first - Line Follower.

fatty
User offline. Last seen 19 weeks 5 days ago. Offline
Joined: 03/11/2010
bOt Points: 70
thanks!!!!!!!!! now i will giv it a shot

thanku

shashwat
User offline. Last seen 5 hours 58 min ago. Offline
Joined: 02/18/2009
bOt Points: 1056
Welcome!

Hope it helps.  

fatty
User offline. Last seen 19 weeks 5 days ago. Offline
Joined: 03/11/2010
bOt Points: 70
the frward command

the forward command will be 'turning on  all d sensrs'??????

Note:- This post has been edited by fatty at Thu, 03/11/2010 - 16:41.

shashwat
User offline. Last seen 5 hours 58 min ago. Offline
Joined: 02/18/2009
bOt Points: 1056
The forward command will

The forward command will rotate both the motors in the forward direction. Once the condition is satisfied that all the three sensors are on the same colour as that of the line then the bOt should be this forward command. 

sleepy
User offline. Last seen 18 weeks 5 days ago. Offline
Joined: 03/06/2010
bOt Points: 74
Thanks,below are the pins

Thanks Shashwat,below are the pins using:

For the buzzer,i am using 7 segment to replace the buzzer,segment will display "On" and led4 will

blink at a interval of 0.5 secs.

S1 using P1.0

S2 using P1.1

S3 using P1.2

Led1 using P1.4

Led2 using P1.5

Led3 using P1.6

7 segment (SSD1 and SSD2) using P0.6

 

Note:- This post has been edited by sleepy at Fri, 03/12/2010 - 10:42.

fatty
User offline. Last seen 19 weeks 5 days ago. Offline
Joined: 03/11/2010
bOt Points: 70
hi again

yr plz tell me wats d book  or link to study basic  moving codes of  robots plz

shashwat
User offline. Last seen 5 hours 58 min ago. Offline
Joined: 02/18/2009
bOt Points: 1056
Hi fatty, Check out this link

Hi fatty,

Check out this link - http://www.botskool.com/tutorials. It contains a lot of tutorials. 

fatty
User offline. Last seen 19 weeks 5 days ago. Offline
Joined: 03/11/2010
bOt Points: 70
thanku