What's a good way to convert an 8.2 usec Propeller pulse into a 1 usec pulse?
ElectricAye
Posts: 4,561
I would like to take the 8.2 usec pulse produced by the Propeller chip (generated by the PWM object) and convert it into a shorter pulse of about 1 usec (or maybe even less) to serve as a trigger for another circuit. My first thought is to differentiate the pulse from the Propeller by placing a capacitor on the line(???) and then feed that to a one-shot, monostable circuit made from a high speed 555 chip.
Does this approach make sense? Or would I need to build it from discrete components?
Also, I would like to be able to vary the short pulse width, even if done manually.
Any way I could get the pulse width down to 100 nsec while I'm at it?
Thanks!
Does this approach make sense? Or would I need to build it from discrete components?
Also, I would like to be able to vary the short pulse width, even if done manually.
Any way I could get the pulse width down to 100 nsec while I'm at it?
Thanks!
Comments
I see what you're saying, but in my case I need to space the 100 nsec pulses by time intervals ranging from about 100 msec to about 10 msec. Is that possible by straight bit banging? Or maybe some combination of bit banging and other delays?
Thanks!
This should give you 1us pulses. 1us high and 1us low.
EDIT: That's not what you wanted is it?
I remember reading somethiong about the counters where you can get some unbelievably high pulse rate. I think it was in PE Fundamentals under counters
Bruce, that's correct. I guess I should have said something about that early on. That irritating need for spacing out the very short pulses is what's confounding me. I basically need a pulse generator with delays that are long relative to the ~100 nsec width of the pulses. Thanks for giving it a shot, though. There are so many ways to skin the cat on the test and I keep churning all of this around in my head trying to figure out a strategy that I, personally, can do. Sorry for not being clear on the requirements. For me, the problem still isn't well define.
With a software delay and a counter in NCO mode you can generate pulses as short as 12.5ns (10ns with 100MHz) or any multiple of that.
Andy
and with a second cog doing the longterm timing triggering the waitpeq / waitpne?
Indeed if you would tell what you want to do in the end more or better solutions can be found.
keep the questions coming
best regards
Stefan
Bruce
EDIT: Or something to that effect. I did not read the whole discussion
I was guessing that the pulses would be triggered by the Propeller but restricted to a narrow pulse width by probably some other external circuit. But, certainly, if the Prop can output a 12.5 nsec pulse and I can get a long 10msec delay between those pulses, then I think I would be in good shape. The pulses are meant to trigger a mosfet that controls 10 amps or so of DC current, which fires a bank of IR LEDs.
Andy, I will have to go back and read all the stuff about what counters can do. I know I rarely use even a fraction of their capability. If you are correct about this, and it's that easy, then we will be erecting stone monuments in your honor. Thanks so much for the suggestion.
Stefan,
the purpose of this device is to control the output of a bank of IR LEDs. The concept is to keep the average light output per 10 msec time frame the same, but the width of the pulses and their height will change. In other words, as the pulses get shorter, they will get higher, and the total (integrated) area of the (pulse width)x(pulse height)x(total number of pulses per 10 msec) stays the same. So, integrated over time, the same number of photons will hit the target (which is a photosynthetic bacteria) but the behavior of the bacterial photosynthetic complex will be challenged due to the ever-shrinking pulse width. The intensity of the pulses will be governed by a circuit totally separate from the one governing the pulse width.
You guys have helped me out a lot here. I need to do some homework and explore your suggestions. Thanks again!
I believe I said something very similar before he did, I just did not know how high. I want a stone monument also
Reading all about the counters may take too long and you will not have enough time for the monument(s), therefore here a Spin code that shows the use of the counters for short pulses: The delay time and pulswidth are hold in variables and are calculated first, so it should be easy to modify it for your needs.
How the pulse generation works:
A counter in NCO mode outputs the state of the highest bit of phsX to the output pin. If you set frqX to 1 then phsX is incremented with 80MHz. As long as phsX is positive the pin is Low, when it overflows to negative the pin is High.
The code above just writes a little negative value (-8) to phsa so the pin gets high, then after 8 clock pulses phsa overflows to a positive value and the pin goes low. The counter still counts, but it takes over 27 seconds until the pin will go high again. More than enough time to write new values in phsa.
Andy
You got it. Carving begins tomorrow, pending Congressional approval. You guys are awesome! You deserve much bigger, I know, but this is the best I could do on such short notice:
For stable operation, it is recommended that the VCO frequency be kept within 64 MHz to
128 MHz. This translates to an NCO frequency of 4 MHz to 8 MHz.
I interpreted that as 8MHz max pin toggling rate. My CTRx world had been turned upside down!
I don't have any way to test the code, but one thing I learned through the PulseTheStepPin function is that you should keep the loop as small as possible when trying to get small pulses. Andy's code may work perfectly fine, but may I suggest altering it to this, just in case: