1. 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.
    Dismiss Notice

[help] car using microcontroller

Discussion in 'Microcontrollers' started by rahuljin, Oct 11, 2007.

  1. rahuljin

    rahuljin New Member

    Joined:
    Oct 6, 2007
    Messages:
    20
    Likes:
    0
    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 :eek:
     
  2. donniedj

    donniedj Banned

    Joined:
    Jan 16, 2004
    Messages:
    336
    Likes:
    3
    Location:
    So Cal
    !!!!!!!!!!
     
  3. mramos1

    mramos1 Active Member

    Joined:
    Sep 15, 2005
    Messages:
    2,403
    Likes:
    9
    Location:
    Boynton Beach, Florida USA
    Totally lost. Can you explain what you want to do. That would help a lot.

    You stated you are new.

    You need power on the micro to make it work. And you have a button to interrupt pin and a program running on the micro I assume?
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. rahuljin

    rahuljin New Member

    Joined:
    Oct 6, 2007
    Messages:
    20
    Likes:
    0

    thanks for the reply !!
    i change the circuit.
    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. but this is not working. help me please !! i hav give 3 days to this problem.

    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).

    [​IMG]

    i provide a 12V, 1.3 AHr supply to the microcontroller.
    mramos1,u r right i hav button on int0 and i hav programed the microcontroller.
     
    Last edited: Oct 11, 2007
  6. ssylee

    ssylee New Member

    Joined:
    May 30, 2007
    Messages:
    189
    Likes:
    0
    Location:
    Vancouver, Canada
    From your diagram, when you press the button, you have the 5V from the power supply shorted to ground, which creates a short circuit, causing everything to not run if you don't a spark. The proper way to connect the button would be have the button connected between Vcc and one end of the resistor, with the other end of the resistor connected to ground. There should be another connection at the node of the resistor and button that connects to the input pin so that the microcontroller can detect the change in the voltage levels.
     
  7. rahuljin

    rahuljin New Member

    Joined:
    Oct 6, 2007
    Messages:
    20
    Likes:
    0
    thanks dude !!! it may help me !!!

    will 1k ohm be enough ??? also can u tell me how to make a logic inverter(NOT gate) with the resistors, diode or transistor with complete description(values and their number) ??

    thanks for the great help !!!
     
  8. rahuljin

    rahuljin New Member

    Joined:
    Oct 6, 2007
    Messages:
    20
    Likes:
    0
    i got it and it worked !!! thanks to all !!!
    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 pushed it does not call the interrupt.
    any help regarding this !!
     
  9. ssylee

    ssylee New Member

    Joined:
    May 30, 2007
    Messages:
    189
    Likes:
    0
    Location:
    Vancouver, Canada
    Did you check if there are any unintentional shorts or if the interrupt input pin is getting the signals properly?
     
  10. rahuljin

    rahuljin New Member

    Joined:
    Oct 6, 2007
    Messages:
    20
    Likes:
    0
    i put a 15k ohm resistance and it works correctly.

    can u help me to my another problem (sorry for so much trouble) ??

    when circuit is on, circuit board pins has 1 to its pins and gives 0 to all the pins of the microcontroller. therefore when i give 0 value to the pins of the circuit board, circuit board give 1 to the microcontroller.
    therefore when button is not pushed, 0 is passed to the pin of the circuit board and circuit board gives 1 to the pin of the microcontroller and microcontroller calls the interrupt.
    circuit board works on 0-logic.
    circuit board is the test board.
     
    Last edited: Oct 13, 2007
  11. ssylee

    ssylee New Member

    Joined:
    May 30, 2007
    Messages:
    189
    Likes:
    0
    Location:
    Vancouver, Canada
    try hooking up swapping the resistor and the switch around. i.e. instead of having:

    Vcc - switch - resistor - ground
    |
    interrupt pin

    try


    Vcc - resistor - switch - ground
    |
    interrupt pin

    to invert the logic on the circuit level.
     
  12. rahuljin

    rahuljin New Member

    Joined:
    Oct 6, 2007
    Messages:
    20
    Likes:
    0
    thanks dude !!! all problems hav been resolved !!! thanks to all u guys !!!
     

Share This Page