How can an accurate time of a BS2 program be determined?
po2le
Posts: 76
I'm using this program to count pulses.· How can I determine elapsed time during the 'DO LOOP' ?
It seems to be longer than the 1000 msecs during the count command.
' pulsecount.bs2
' count pulses
' {$STAMP BS2}
' {$PBASIC 2.5}
reps··· VAR···· Word
time VAR Word
plscount· VAR Word
reps· = 0
DO WHILE (reps <= 20)
· COUNT 0, 1000, plscount················· 'equals number of pulse/1000ms
·· DEBUG DEC plscount, CR
·· reps = reps + 1
LOOP
END
My circuitry: Basic Stamp homework board with Embedded Basic stamp 2, powered by 9v battery. It has a serial port connector, a header for connecting i/o pins to embedded breadboard, with volt regulator and some EEPROM. I'm taking pulses from a motorcycle electronic ignition at the primary side of the ignition coil (the same point that the tach. circuit is fed from). Then counting the pulses using the above BS2 program.
Thanks,
PO'T
It seems to be longer than the 1000 msecs during the count command.
' pulsecount.bs2
' count pulses
' {$STAMP BS2}
' {$PBASIC 2.5}
reps··· VAR···· Word
time VAR Word
plscount· VAR Word
reps· = 0
DO WHILE (reps <= 20)
· COUNT 0, 1000, plscount················· 'equals number of pulse/1000ms
·· DEBUG DEC plscount, CR
·· reps = reps + 1
LOOP
END
My circuitry: Basic Stamp homework board with Embedded Basic stamp 2, powered by 9v battery. It has a serial port connector, a header for connecting i/o pins to embedded breadboard, with volt regulator and some EEPROM. I'm taking pulses from a motorcycle electronic ignition at the primary side of the ignition coil (the same point that the tach. circuit is fed from). Then counting the pulses using the above BS2 program.
Thanks,
PO'T
Comments