Shop OBEX P1 Docs P2 Docs Learn Events
Problem using input on Stamps in Class BOE — Parallax Forums

Problem using input on Stamps in Class BOE

llryanllryan Posts: 5
edited 2007-12-21 17:00 in Learn with BlocklyProp
Hi,
I am using a Stamps in Class BOE board to test a gear tooth sensor. I have it set up detecting gear teeth sensor pulses. I am connecting the pulses to one of the inputs (P7)·on the BOE so I can count them.
Here is the Basic:

' {$STAMP BS2}
' {$PBASIC 2.5}
toothcount VAR Byte
DEBUG "Hall-effect sensor test program is running!", CR
DEBUG "Starting to count gear teeth", CR
DEBUG "
", CR
DO
·· DEBUG CRSRXY, 0, 3,· 'Start the line at col 0, 4th line down
· "Input logic level = ", BIN1 IN7 'Make sure P7 is·normally zero with everything wired
·· IF (IN7 = 1) THEN toothcount = toothcount+1 'ENDIF causes syntax error for some reason
··· DEBUG CRSRXY, 0, 5,"Number of gear teeth counted= ", DEC2 toothcount· 'Display
· 'the total -·max·will be 24 teeth
LOOP

When I substitute a manual pushbutton·into P7, and·wired like the whisker on P 171 of "Robotics With the Boe-Bot" it works. I can push the button and see the count increase from 00 to whatever. However when I connect the pulse output of the gear teeth sensor, I get no count at all. I have a scope connected to P7·and I can see the pulses go from zero to +5v. If I touch a logic probe to the wire to P7, I can see the pulses on the logic probe.

The sensor module is powered from the BOE +5V and an external 12V source that has common ground with the BOE (VSS)

Pulse width is 100 uS and swings from ground to +5V. Is this pulse too narrow for the BOE timing and CPU speed?

Thank you,

Comments

Sign In or Register to comment.