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.

Start / Stop button. Please help

Status
Not open for further replies.

cubdh23

New Member
Hello i am using a switch that has 3 pins and it should do start and stop
I am using built in pull up resistors and when i connect all 3 pins to the microcontroller. It freezes. When i take off one pin then it works. I have used diferent switches and all seem to do the same thing. There are 3 pins named "C" " NO" and "NC" I have no idea what those mean but when its on C and NO are continous when its off C and NC are contious or vice versa . So i guess C is common. But only C and NO works together. When i do C and NC and i reset my controller it freezes. If i take off the pin reset then place the pin back then it works. but doesnt work if its on and i reset. Any suggestions on what im doing wrong? Greattttttly appreciated.

Wood pitches next week
Prior too :)
 
C is common, NC is normally closed, NO is normally open
meaning NC is closed while the switch is not depressed, NO is open while the switch is not depressed.
kinda hard to troubleshoot without seeing the code or circuit, try posting the code...

-I just reread your post and have no idea what this means: "i connect all 3 pins to the microcontroller" need a little more info
 
OK let me be a little more specific.
Im using motorola 6812
lets say i use pin 0 for NC pin 1 for C and pin 2 for NO.
I make pin 1 output thereby making it ground.
I make pin 0 and pin 2 input with pull up resistor enabled.
When i get a falling edge on 0 and 2 it interrupts to respective zones.
So what im doing is by connecting Common to either pin 0 or pin 2, it causes the pin to go from high to low thereby interrupting. This works only if i reset then stick in the pins. If i stick in the pins then reset, it freezes. Im not using any circuitry. I dont really understand exactly how the switch works. Im wondering if its pulling current or something thats causing it to freeze. dont know
 
NO/NC switch (double throw switch)

Check out this site. It may help with explaining the switch. The only difference between the relay shown and a switch is the switch is flipped manually.https://www.the12volt.com/relays/relays.asp rather than with a coil.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top