Generating pulses with BS1 USB
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:
symbol MyData = W0 ' w0 is the only word available in bits. Since it is the only one, ' we don't need to refer to it specifically below. symbol temp = w1 ' This is a temporary place to hold calculated values. It can be any word. ' If you don't use GOSUB while it's in use, you can store it in W6. 'Do other stuff here Temp = BIT0 * 510 + 280 ' Bit-0 pulse PULSOUT 9, Temp Temp = BIT1 * 510 + 280 ' Bit-1 pulse PULSOUT 9, Temp Temp = BIT2 * 510 + 280 ' Bit-2 pulse PULSOUT 9, TempAs 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