Shop OBEX P1 Docs P2 Docs Learn Events
Lots of strange data — Parallax Forums

Lots of strange data

A.C. fishingA.C. fishing Posts: 262
edited 2006-08-05 00:46 in Robotics
I've been getting a lot of strange data. I went back to·basics, and wired a simple pushbutton circuit.(onee wire to Vdd and one to P0. I used this code:
' {$STAMP BS2}
' {$PBASIC 2.5}
' {$PORT COM4}
    DO
IF (IN0 <> 0) THEN
DEBUG "a"
endif
loop

As soon as i click run, I get a ton of a's. So I disconnect Vdd. And I still get A's, even when I restart. Perhaps something with my circuits are wrong,·because this has happened a lot lately.
I tried this on a BOE and a home work with no luck.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

Somebody said...
-Never Underestimate the power of human stupidity.
·

Comments

  • A.C. fishingA.C. fishing Posts: 262
    edited 2006-06-08 10:43
    Now just tested:
    A pushbutton wired to P0. That is it. I used the same code as above. As soon as I touch the pushbutton, the aa's appear, but now they will go away when i release. The strange thing is there is no Vdd attached!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Somebody said...
    -Never Underestimate the power of human stupidity.
    ·
  • BeanBean Posts: 8,129
    edited 2006-06-08 11:02
    You need a pull down resistor on P0. Something like a 10K to Gnd should work.
    The pins are very sensitive and they are picking up electrical noise caused by your body.
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com

    "I reject your reality, and substitute my own." Mythbusters
    ·
  • A.C. fishingA.C. fishing Posts: 262
    edited 2006-06-08 19:24
    Thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Somebody said...
    -Never Underestimate the power of human stupidity.
    ·
  • A.C. fishingA.C. fishing Posts: 262
    edited 2006-06-10 12:25
    Bean-
    Does that mean that I could hook up a large plece of metal to a pin, and have it detect my motion? Is this the basis of a PIR sensor?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔

    Somebody said...
    -Never Underestimate the power of human stupidity.
    ·
  • Tech HelperTech Helper Posts: 3
    edited 2006-08-05 00:46
    Technically, yes, you could.· However, since the electrical parts that make the microcontroller so sensitive are MOSFETs, what you are asking about is NOT a good idea.· MOSFETs are not only extremely sensitive, but also very easy to blow out using static electricity.· Often, when touch-sensitivity is used, JFETs, a close cousin of MOSFETs, are the preferred part.


    Post Edited By Moderator (Chris Savage (Parallax)) : 8/5/2006 1:49:00 AM GMT
Sign In or Register to comment.