Skip to content

Commit

Permalink
Playing around with delay times for pulser. No delay results in ~20 n…
Browse files Browse the repository at this point in the history
…s pulse width.
  • Loading branch information
wlmeng11 committed Aug 17, 2018
1 parent 80a0cae commit dc59f6a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions firmware/src/simplerick.ino
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@
#define LED_ACQUISITION 13
#define BUTTON_TRIG 4

#define NOP3 "nop\n\t""nop\n\t""nop\n\t" // ~ 50 ns delay
#define NOP4 "nop\n\t""nop\n\t""nop\n\t""nop\n\t"
#define NOP6 "nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t" // ~ 100 ns delay

void setup() {
// Initialize inputs & outputs
pinMode(SERVO_PWM, OUTPUT);
Expand Down Expand Up @@ -58,10 +62,8 @@ void loop() {
digitalWrite(TGC_RESET, LOW);

digitalWriteFast(PULSE_INA, HIGH);
digitalWriteFast(PULSE_INB, HIGH);
//delayMicroseconds(1);
//__asm__(NOP3);
digitalWriteFast(PULSE_INA, LOW);
digitalWriteFast(PULSE_INB, LOW);
delayMicroseconds(5);
}
}

0 comments on commit dc59f6a

Please sign in to comment.