Hi,
There's no direct port manipulation in Picaxe like arduino ?
No, there is no (Real-Time) "Assembler" capability with PICaxe Basic, because it would allow the PICaxe Basic software (interpreter) to be stolen.
So the fastest Basic Pulse Input and Output commands use bit-banging with a loop period of ten "Base PIC" (assembler) instructions, which take 10 us with a 4 MHz clock or 1.25 us at 32 MHz (as said in #2). However, there is plenty of Hardware on the PICaxe chips which is clocked at the raw clock frequency (i.e. up to 32 MHz or approximately 34 ns resolution), that can be accessed by Basic commands.
Untested, but I would expect an
HSERSETUP 7 , 2 with a 32 MHz clock to set up a baud rate of 2 Mbaud, with an (idle low) bit-period of 500 ns. Then an
HSEROUT 0 , (0) should deliver a single 500 ns (Start) pulse. Alternatively, at 8 MHz a
PWMOUT PWMDIV4, pin, 255, 1 should deliver 500 ns pulses spaced by just over 500 us (or use PWMDIV16 at 32 MHz). Then a sequence of
PWMOUT PWMDIV4, pin, 255, 1 : PWMOUT pin, OFF may deliver a single pulse. Alternatively, a duty cycle of 1020 (instead of 1) may deliver (one) inverted pulse(s) with a different delay time. Or a
HPWM command can use different pins with the option of inversion by the hardware.
Or a single C + R "High Pass" analogue filter (i.e. an ac coupling) will probably give an adequate pulse width when sliced by a digital input threshold level.
Cheers, Alan.