Hi, Comte Vlad of the X (lol)
this kind of work might be achieved through assembler including ... where a 4 Mhz Xtal will be more than enough. 
PBP ( and generally high level languages ) is ... ahum ... let's say not so good, for this kind of work !
Now ... 40 pulses of 2µs is rather fuzzy, as a signal shape description...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks