Which stamp to use as pulse generator / emulator?
Garced Winder
Posts: 4
I am considering using a basic stamp to emulate/generate a automotive crankshaft position sensor signal to allow test-benching and development work of a car ECM, but am unsure which stamp would be most appropriate.
The signal to be generated emulates a magnetic sensor that reads a wheel with 7 notches; 6 evenly spaced and 1 extra notch (sync) which allows the ECM to determine crankshaft position.
Max output would be ~42khz.
Initial plan was to count pulses from external source, turn on/off stamp output pin appropriately.
TIA
The signal to be generated emulates a magnetic sensor that reads a wheel with 7 notches; 6 evenly spaced and 1 extra notch (sync) which allows the ECM to determine crankshaft position.
Max output would be ~42khz.
Initial plan was to count pulses from external source, turn on/off stamp output pin appropriately.
TIA
Comments
The fastest Stamp (BS2px) is not fast enough to handle this. It executes about 20K instructions (not statements necessarily) per second.
A Propeller or an SX would be more than adequate for the task. The Propeller has the advantage of being able to directly handle a PS/2 keyboard and can provide either VGA or NTSC video for a display. It uses a crystal timebase and would not need an external timing source. Have a look at the Propeller Protoboard with the Accessory Kit.
Thanks for the recommendation on the SX or Propeller - will check them out.
It has a single output.
Using a BS2, I sent the output to PIN0 and if HIGH set PIN1 to high to blink the led.
I'm am trying to get a pulse to use with a clock project, but i can't get the pulses to be consistant or the timing to be slow enough.
Any suggestions... I'll apologize now for the poor schematic.
Here is the BS2 app code.
' {$STAMP BS2}
' {$PBASIC 2.5}
Blink PIN 1
Pulse PIN 0
TSeconds VAR Nib 'tenths of a second.
Seconds VAR Byte 'seconds count
Minutes VAR Byte
TSeconds = 0
Seconds = 0
Minutes = 0
DO WHILE Minutes < 1
IF (Pulse=0) THEN
LOW Blink
ELSE
HIGH Blink
IF(TSeconds<9)THEN
TSeconds = TSeconds + 1
ELSE
GOSUB ADDSecond
TSeconds = 0
ENDIF
'GOSUB DisplayTime
ENDIF
LOOP
END
ADDSecond:
IF(Seconds < 59) THEN
Seconds = Seconds + 1
ELSE
Seconds = 0
GOSUB ADDMinute
'GOSUB DisplayTime
ENDIF
RETURN
ADDMinute:
Minutes=Minutes + 1
GOSUB DisplayTime
RETURN
DisplayTime:
DEBUG "Time is: ", DEC Minutes, ":", DEC Seconds, ":", DEC TSeconds, CR
RETURN
If you want an accurate clock, you will need to use a 32768Hz crystal oscillator and a divider to get 1Hz pulses. Here's one example. You can leave out the CD4027 if you're willing to use a 2Hz clock pulse.