Lithanial

I am looking to control a gate two switch a HV supply to a transducer/receiver.

I need to control the gate with very short 5V pulses. Approximately 1.2microseconds. I hooked my arduino to a scope using the microsecond command, but the shortest pulse duration I can get is about 4 microseconds.

Does anyone know how to reduce this pulse duration down to 1.2 microseconds.

It's almost the same as the code from RIDDICK but without affecting all other pins of the same port (pins 0-7).

Both code snippets just tries to switch on and off a single pin as fast as possible, probably faster than you want. That's why you may have to insert the NOP assembler statements to wait some time before toggling the pin back.

Lithanial

What did you expect? Rectangular pulses? That would mean you have absolutely no capacity on the line. How much of that is coming from your measurement equipment (a scope I guess)? Do you have the resolution to even see a rectangular signal if it was there?

Try it out - I tested it with 100MHz scope and get 1.19us pulses. Am using the Arduino 1.0 software and avr-gcc 4.3.5The code for delayMicroseconds has a comment saying that it is close to 1us when called with an argument of 1.

What version gives 4us then?

[edit: Arduino 1.0.1 and arduino-0022 give me 1.19us as well]

[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]