send one microsecond pulse

picguate

New Member
Dear friends:

Could somebody tell me how to send a one microsecond pulse with a 40X1, this because I tried to use the pauseus and pulsout commands but the less value is 10 us unit or 2.5 us if use a 16 Mhz, but I need 1 us pulse.

Thanks in advance.
 

vttom

Senior Member
Dear friends:

Could somebody tell me how to send a one microsecond pulse with a 40X1, this because I tried to use the pauseus and pulsout commands but the less value is 10 us unit or 2.5 us if use a 16 Mhz, but I need 1 us pulse.

Thanks in advance.
Do you need just a single pulse, or a series of pulses? The reason I ask is because I think the pwmout command can generate pulses as short as 1us, but you're going to get a lot of them between the time you start up a pwm signal and turn it back off again.
 

Dippy

Moderator
How fast is low,high,low or 0,1,0 on PICAXE flat out?
(Assuming pwm or other technique doesn't work).

If not fast enough and you want to use PICAXE then edge triggering an external monostable is my only suggestion.

But wait a while, someone may have a cunning plan.
 

jglenn

Senior Member
There is an old TTL trick used to generate a short pulse from a rising edge. It is an easy way to do it. Need an AND gate, the PICAXE output goes to one input. The other input has an inverter (fed by the same PICAXE output), or 3 sometimes, to provide a delay. When the input to this glitch generator goes high, the AND gate provides a short pulse output, for TTL I guess 50nS. All you need is an RC pulse stretcher in the inverter path, to provide 1uS.
 

womai

Senior Member
Another possibility, which is better suited to produce precise pulse durations: Load a serial shift register with a single one and otherwise all zeros. Use one of the PWM capable pins for the clock pin going to the shift register. Then make (or keep) the data pin low and turn on PWM on that pin with the desired frequency (e.g. 1 MHz for a 1us pulse). The single one will be flushed out of the shift register, producing a 1us pulse at its output, after that will come a constant stream of zeros (low). After a short time, > about 10us (for Picaxe command execution speeds, you can do this immediately after the PWM command), turn off PWM again.

Wolfgang
 
Last edited:

Jeremy Leach

Senior Member
If the picaxe output is feeding an IC input then I think you might just be able to use a capacitor and resistor (and maybe with a diode to prevent reverse polarity)...
Code:
 .---------.
 |         |
 |         |Out
 | Picaxe  o------.
 |         |      |
 |         |     ---
 |         |     --- C1
 '---------'      |
            .-----o------------> To IC Input
            |     |
            |    .-.
            -    | |
        D1  ^    | | R1
            |    '-'
            |     |
  o---------o-----o------------------------o
And then experiment so that when you raise the picaxe output high, the decay from the capacitor is just enough to keep the input to the IC detecting 'high' for 1us.
 

picguate

New Member
Thanks friends, I'll try all the options that you mentioned and let you know the result.

At this moment I already tried with the proposal of vttom using the pwmout, but as he mentioned I received a lot pulses, and I need to receive only one.

By for now,
 

Dippy

Moderator
It would help suggestions IF you told us:
A) How accurate does it need to be? 1% 10% 50%??
B) Will this 1 microsecond ever have to be changed whilst running? (i.e. 'on the fly')
B) What is it triggering as other suggestions may help?

If using a monostable then read up on it first.
When your PICAXE --> monostable trigger is longer than the pulse the monostable outputs then the type (or type of triggering e.g. edge) is important. Bad example: try triggering a 555 to give a 1uS pulse with a PICAXE pulsout.

Others can explain I'm sure. Anyway, I'm sure you'll get it going just fine. Cheers.
 
Top