Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

external interrupts 8051

Status
Not open for further replies.
Hello , i've two problems , i wanna use INT0 to stop a motor and while this it does something else like doing a while loop and counter ..etc
example.


at interrupt
motor_stop

while (1)
{
motor_start;
// do robot program

}
the problem is when removing other robot program the external interrupt works , the program doesnt work simulatanously (interrupt + robot program ) e.g robot move forward while onother motor will stop till it touches the limit switch using external interrupt.

2nd problem is when powering the uC circuit it does strange things it makes random things like starting motors and blink leds , i dont know why from where could be the problem ?
 
For #2, maybe you should use the watchdog timer to keep the chip reset until your code is all up and running, but then you have to service the WDT during normal code operation. This is actually a good way to overcome problems resulting from locked up code.
Other thought is that your supply is not stable when your uP comes out of reset. Can you increase the reset time?
 
you can filter the mcu with 100n and 10u capacitors or inductors...by the way. i posted a new thread but i could not see it. why did it not appear?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top