Shop OBEX P1 Docs P2 Docs Learn Events
What's up with my HomeWork board? — Parallax Forums

What's up with my HomeWork board?

Thomas C.Thomas C. Posts: 2
edited 2010-01-28 04:30 in BASIC Stamp
In the "What's a Microcontroller?" workbook for the HomeWork board, there is an exercise on pages 76-78 using the Pushbutton. I built the circuit in Figure 3-6, connected power, wrote the program on page 78 exactly, and something is still wrong: whenever I run the program, IN3 always equals 1, regardless if I'm pushing the button or not.

I took apart the circuit and rebuilt it, and the same thing happens - IN3 always equals 1 in the debug window. Finally I took everything off the board and ran the program, and IN3 keeps coming up as 1.·I can take a picture also and upload it here if needed.

Is there something wrong with the board, or could I have possibly damaged it?

Post Edited (Thomas C.) : 1/27/2010 4:32:12 PM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-27 17:13
    It's possible there's something wrong with the board. An easy way to tell is to use a different I/O pin. Wire up the circuit in Figure 3-6, but use I/O pin # 7 or # 0 and change the IN3 to IN7 or IN0 and see what happens. If it works with a different I/O pin, then pin # 3 may have a problem.

    Do check the wiring again. You might have made a mistake there. Also, try a different set of holes in the breadboard area. Try the identical layout, but shift everything upwards 3 rows. There might be something wrong with the breadboard.

    Note that, if an I/O pin is not connected to anything, then its state (0 or 1) could be anything. That's why the circuit has a 10K resistor connected to Vss and the I/O pin. That forces the default I/O pin state to be zero.
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-01-27 17:24
    You could also check your circuit with a voltmeter. Unplug the end of the 220 ohm resistor from P3, and attach it to the positive lead of the voltmeter. Attach the other lead to ground (VSS).
    You should get 0V when you're not pushing the button, and right around 5V when you are pushing it. If that's not happening, your wiring isn't right.
  • Thomas C.Thomas C. Posts: 2
    edited 2010-01-28 01:35
    I think I figured out what the problem was - I might have the pushbutton in the wrong way. Should the writing above the pushbutton be facing the right of the board, or the VDD/VIN/VSS holes? When I had it facing the VDD/VINVSS, that's when INx always equaled 1. When I rotated it 90 degrees clockwise, it worked like it should.
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-01-28 04:30
    Been there, done that. I find those pushbuttons confusing, and I'm still doing them by trial and error.

    I'm glad to hear it wasn't the Homework board.
Sign In or Register to comment.