Microseconds Timer

Hi,
I’ve a problem, I would like to send a precise number of pulses in a digital port, with a frequency of 10Khz. With the code below I can get max 1Khz.
is there a solution?

OutputPort Puls_X = new OutputPort(FEZHydra.Pin.PD19, true);
Int32 X_Current=0;

Puls_X.Write(!Puls_X.Read());
if (Puls_X.Read())
{
X_Current = X_Current + 1;
}
Thread.Sleep(1);

Thank you.

Sorry for my bad english.

http://www.tinyclr.com/codeshare/entry/582

@ ianlee74 - sorry but I do not understand

On reflection, that code share of mine has a really bad name. It is not a function generator as in signal generator, it just parses the gcc .map file and generates the C# managed functions to call into the RLPLite code.

I am not sure if there is anything on Code Share for this, but I have a custom firmware that is based on the latest GHI firmware for the Hydra that includes a Signal Generator similar to what is available in the Premium library. If you are interested you can get more info on the following thread

http://www.tinyclr.com/forum/topic?id=10126

Alternatively, you would need to implement this using RLPLite to achieve the 10kHz frequency for a specific number of pulses.

Sorry, I sent you the wrong link. I meant the firmware that taylorza linked to.

@ ale_zenigata - You might want to take a look at the code share I put up today. It is an RLP Signal Generator for the Hydra. You can pass it pulse timings in microseconds.
http://www.tinyclr.com/codeshare/entry/638

You can achieve it by using SPI if you can use a SPI enable output pin.
Sending a pulse is equivalent to send a 0xF0 byte (or 0x80 for a shorter pulse).
Configure your SPI to 80kHz and create a buffer for the number of pulses you want to send.