Help with SRLatch or one microsecond pulse

picguate

New Member
Dear friends:

I'm trying to produce a pulse of one micro second (1 us), with any of the PICAXE Chips because I have all of them, but specially with the 40X2 parts. I already tried with differents commands like pulsout, pauseus and also change the crystal resonator to increase the speed also tried to use toggle command twice continuosly to generate the pulse, but now I'm trying to use the SRLatch command because on the table of the page 196 of the Command Manual are listed some clock frecuencies and there appear the 1 us at 4 Mhz.

Could somebody explain me how to use the SRLatch function, and specially with and example, because, for example I don't know have to set the pin for the SRQ or SRNQ, or the most important how to use this command to create a 555 timer as the manual mention, that says "The latch can also
be used to generate a 555 timer style pulsing output".

basically, I need to do the next routine.

Generate_a_pulse:
1. comparate a bit XX.
2. if the bit XX is high
make output YY high and generate a one microsecond pulse.
3. if the bit es low
make output YY low and generate a one microsecond pulse.
4. return the
return

Or maybe somebody, could give me another idea to generate this pulse, and one day somebody will do the same for you.


Thanks in advance.

PicGuate from Guatemala City, country of the eternal spring.
 

westaust55

Moderator
You state " . . . . but specially with the 40X2 parts. "
however, the SRLatch command is only available with the 20X2 - see the PICAXE diagrams at the left side of the manual pages.

For the Pulseout command, from manual 2:
Affect of Increased Clock Speed:
4MHz 10us unit
8MHz 5us unit
16MHz 2.5us unit

So to achieve a 1us duration you would need to operate a 28X2 or 40X2 at 40MHz.
That reuires use of the Setfreq command as:
SETFREQ em40

which requires a 10MHz external resonator (see page 185)

then the PULSOUT command would be PUSLEOUT pin, 1 where pin is the pin you wish to use
 
Last edited:

picguate

New Member
Thanks, for your help, I tried with this but got the same result, in the past I was tried with 32 Mhz too, but I couldn't observed any change, all looks like after 16 Mhz the time period doesn't change and remains in 2.5 us.

But maybe, somebody can helps us with this doubt, our maybe some body could help me to get the 1 us pulse.

Or, explain about the Srlatch command.

Best regards,

Picguate
 

inglewoodpete

Senior Member
Or, explain about the Srlatch command
As WA55 said: The SR Latch can only run on the 20X2. The 20X2 is not available yet.

There are no experts on the SR Latch function yet, since no one has a 20X2 to play with.

The SR Latch is a 1-bit 'memory'. There are a number of different ways to set or clear the SR Latch.
 

hippy

Ex-Staff (retired)
Or maybe somebody, could give me another idea to generate this pulse
I'd consider using HSEROUT at 1_000_000 baud. Send $FF and the active output on the line should just be the single start bit which will be of 1us duration.
 

BeanieBots

Moderator
Do you require the ability to produce a pulse of 1uS or do you require the full fucntionality of pulsout with 1uS resolution?
If it's just a fixed 1uS pulse, then consider a hardware solution triggered by the PICAXE.
Very easy with a single XOR gate and RC, or extremely accurate down to nano-seconds by replacing the RC with a D-type latch and xtal oscillator.
 
Top