Discussion in "8051 Discussion Forum" started by    rahuljin    Oct 11, 2007.
Thu Oct 11 2007, 08:24 pm
#1
hello, everyone !! i am new to the microcontroller. i am making a car using 8052 microcontroller. i want to call the interrupt to pass the values to other port and rotate the motor. i connect a wire from button to VCC and to the interrupt and other wire to the ground pin of the microcontroller. when i start the microcontroller and i push the button, it short the supply and does not call the interrupt. please help me !! and also help me making a logic invertor(NOT gate) using resistor, diode and transistor !!! thanks anyways
Thu Oct 11 2007, 09:01 pm
#2
can you please provide the circuit? waiting for reply..
Fri Oct 12 2007, 07:47 am
#3
thanks for the reply !!
i made some changes in the circuit(in hope that it might work).
my real problem is that i am unable to call the interrupt because i dont know how to send signal from the button. i connect one wire of vcc pin and same wire to the interrupt and other wire of the button to the ground pin of the microcontroller.

when i push the button, it draws all the power from the microcontroller and does not call the interrupt( i hav an led on other port which stop on pushing the button).

there is a led on p2.2 which should always on because i programed the microcontroller to do so and to on the led on p2.3 when interrupt is called !!!

please help !! i hav already give 3 day to this problem.

Fri Oct 12 2007, 11:51 am
#4
in level triggered mode whenever P3.2 will go low , interrupt routine for this interrupt will be called.
so circuit will be like this



and program
#include<reg51.h>
sbit led =P2^3;
void abbas() interrupt 0
{
led=0;
}
void main()
{
EA=1;
EX0=1;
while(1);
}


[ Edited Fri Oct 12 2007, 11:52 am ]
Fri Oct 12 2007, 12:28 pm
#5
thanks for the suggestion but how this will pass 1 to the p3.2 (interrupt) ?? i dont know about c language so i write my programs in assembly language.
Fri Oct 12 2007, 01:41 pm
#6
this is the correct way to connect a switch or push button...



all you have to do is.. put the code to be executed during interrupt in your interrupt service routine..
vector table for 8051 interrupts are
0000H - Reset
0003H - INT0
000BH - Timer0
0013H - INT1
001BH - Timer1
0023H - RI and TI interrupt or serial interrupts
Fri Oct 12 2007, 05:57 pm
#7
i got it and it worked !!! thanks to all !!! !dance !dance
but i hav another problem !!! i hav purchased a circuit board(in which microcontroller is attached and it has oscillators, etc.), which works
on 0- logic i.e. it works when 0 is passed. so it calls the interrupt by it self when button is not pushed. when button is not pushed it does not call the interrupt.
any help regarding this !!
Fri Oct 12 2007, 07:49 pm
#8
what do you mean by this?

so it calls the interrupt by it self when button is not pushed.

Fri Oct 12 2007, 10:11 pm
#9
yes.
Sat Oct 13 2007, 12:08 am
#10
I am saying that i did not understand what new problem you are facing.. explain in a better way so we can sort it out..

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Michailqfh
Fri Mar 29 2024, 01:53 am
Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm