Shop OBEX P1 Docs P2 Docs Learn Events
P0 RCTIME Question — Parallax Forums

P0 RCTIME Question

aldude999aldude999 Posts: 4
edited 2012-07-24 08:13 in BASIC Stamp
So I just recently wrote a program that makes P0 and P7 touch sensitive on the BASIC Stamp Homework Board (http://aldude999.net/Downloads/Touch.bs2 if you're interested, just plug a wire into P0 and put the other end in the air, and do the same on P7. Also put a speaker on P15. Touch P7 to test and P0 to enter Configuration mode) and I've been playing with it, but I've noticed something odd. If I use P0 I get random readings anywhere from 0-2400, but if I change it to something like P2 it generally stays around 0 and 1. Is this because of noise, or is it possible this pin is messed up?
Thanks in advanced for any help.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-07-24 07:28
    Noise.

    There's no fundamental difference between P0 and any other I/O pin. If you follow the PCB traces on the Homework Board, you'll see that there's little difference between P0 and any of the other I/O pins in the first group of 8 (P0-P7).

    I notice in your program that you "hard coded" I/O pin 0 and I/O pin 7 in various HIGH and LOW statements, yet use a constant PIN name for the RCTIME statements. You really should use the same PIN name in the HIGH and LOW statements. If you change RC without changing the other statements, it won't work.
  • aldude999aldude999 Posts: 4
    edited 2012-07-24 08:13
    Mike Green wrote: »
    Noise.

    There's no fundamental difference between P0 and any other I/O pin. If you follow the PCB traces on the Homework Board, you'll see that there's little difference between P0 and any of the other I/O pins in the first group of 8 (P0-P7).

    I notice in your program that you "hard coded" I/O pin 0 and I/O pin 7 in various HIGH and LOW statements, yet use a constant PIN name for the RCTIME statements. You really should use the same PIN name in the HIGH and LOW statements. If you change RC without changing the other statements, it won't work.

    Oh, nice catch. Fixed.

    Alright. I was just wondering if I had possibly messed up the pin with a previous experiment with diodes and reading temperature. Oddly, now Pin 0 reads 0-1 with the rest of the pins, so I guess whatever it was is gone now.

    Thanks again.
Sign In or Register to comment.