Shop OBEX P1 Docs P2 Docs Learn Events
How to send pulse train at certain intervals between — Parallax Forums

How to send pulse train at certain intervals between

ArchiverArchiver Posts: 46,084
edited 2000-09-13 05:03 in General Discussion
Dear Experts:
I have a basic problem, I am not sure if I can solve this by
upgrading
to 50MHz SX2 from currently using 20MHz BS2.

(1) my project:

After receiving a positive edge on pin 1 on BS2, I need to
output 128 pulses at a certain rate calculated previously,
so I might need the pulse train sent at 2560 pulse/seconds (2560Hz)
or 2540Hz, or 2530Hz, output at Pin0

(2) I have tried
FOR REP=1 TO 128
PULSOUT 0,100
NEXT
but when I chedcked using OSC, seems it does take BS2 some time >0.5
ms to come back from for loop and give another pulse

I then used
again:
PULSE 0,100
PULSE 0,100
PULSE 0,100
goto again


to test, it seems better, because after it pulsout, it came back low,
then
immediately PULSOUT, no delay in trying to execute loop

(3)CAN I use FREQOUT command to do the task? I might need a TTL
chip to make the signal to be TTL compatible 0-5V pulse? I checked
FREQOUT with OSC seems a lot of strange signal, di have the sine wave
ripple corresponding to the freq I set, is this command only
for analog Audio like loudspeaker?

thanks very much
pete, BS2 user
Sign In or Register to comment.