Series of µsec pulse generation using Arduino Due

I’m working on a project in which I need a series of very accurate pulses containing 2 shots in every pulse. The pulse should have 100µsec on time followed by 300ms off time. But when I’m programming the Arduino Due I’m getting random pulses of non-uniform width.But when I’m trying the same code in microsecond range I’m getting perfect wave. Here is the code that I’m using

#define LED 8 // Pin designated to give out the pulse
int cycles = 2;  // No. of times you want it to give pulse
int high = 100; // High time in microseconds
int low = 300;  // Low time in milliseconds
int i = 0;
int univ_cycle = 10;

void setup() {
  // put your setup code here, to run once:
 pinMode(LED, OUTPUT); 

void loop(){
  for (i ; i < univ_cycle; i ++){
void pulse() {

  // put your main code here, to run repeatedly:
  for(int counter = 0;counter < cycles;counter++){
  digitalWrite(LED, HIGH);
  digitalWrite(13, LOW);


I would like to know how can I get the similar wave in microsecond also.

you are not using correctly delaymicroseconds() and delay() !