Generating pulses with BS1 USB
Richard Balogh
Posts: 8
Hello,
i need to generate a sequence of pulses, where logic values are coded as pulses of different width.
One is represented with 0.56 ms pulse of log.1 followed by the same length of log.0
Zero is represented as 0.56ms pulse of log.1 followed by the 1.69ms log.0
(see attached image, or following link please:
)
I did this successfully with BS2 module, with following code:
PULSOUT 9, MyData.BIT0 * 510 + 280 ' Bit-0 pulse
PULSOUT 9, MyData.BIT1 * 510 + 280 ' Bit-1 pulse
PULSOUT 9, MyData.BIT2 * 510 + 280 ' Bit-2 pulse
etc.
For my application seems to be perfect idea to use as the controller BS1/USB.
But I am not able to generate such a short pulses with BS1 processor.
Any ideas how to generate pulses with BS1?
Richard Balogh
i need to generate a sequence of pulses, where logic values are coded as pulses of different width.
One is represented with 0.56 ms pulse of log.1 followed by the same length of log.0
Zero is represented as 0.56ms pulse of log.1 followed by the 1.69ms log.0
(see attached image, or following link please:
)
I did this successfully with BS2 module, with following code:
PULSOUT 9, MyData.BIT0 * 510 + 280 ' Bit-0 pulse
PULSOUT 9, MyData.BIT1 * 510 + 280 ' Bit-1 pulse
PULSOUT 9, MyData.BIT2 * 510 + 280 ' Bit-2 pulse
etc.
For my application seems to be perfect idea to use as the controller BS1/USB.
But I am not able to generate such a short pulses with BS1 processor.
Any ideas how to generate pulses with BS1?
Richard Balogh
Comments
The BS1 can do exactly the same thing, but you'll need to do a bit more code for it. Such as:
As you can see, the BS1's code is essentially the same, but since the BS1 can't do expressions mid-statement like the BS2 can, you have to calculate things separately before running the statement.
Post Edited (Sarten-X) : 12/9/2006 10:12:08 AM GMT