user21445: How can I generate this pulse with an Arduino Micro?
Is it necessary an external component?


user2881: 
If both inputs are 0V, the output will be 0V.
If both inputs are 5V, the output will be 5V.
If one input is 0V and one 5V the output will be 2.5V.
However, if the device attached to the output doesn't have a high input impedance, the voltage will drop some. You could add an opamp to prevent this.
I think you can generate the 2 pins outputs using one of the timers in phase correct pwm mode. Freeing up the cpu and giving a very clean output signal, as using software "pwm" could be slightly of due to interrupts occuring.

user10024: Take two 10K or so resistors:
    +5V
     |
    10K
     | 
Pin2-+---> output
     |
    10K
     |
    GND

The following program does the trick:
const uint8_t kPin = 2;
const uint32_t kDelay = 10;  // 100Hz

void setup() {
}

void loop() {
  pinMode(kPin, OUTPUT);
  digitalWrite(kPin, HIGH);
  delay(kDelay);

  pinMode(kPin, INPUT);
  delay(kDelay);

  pinMode(kPin, OUTPUT);
  digitalWrite(kPin, LOW);
  delay(kDelay);

  pinMode(kPin, INPUT);
  delay(kDelay);
}

When Pin2 (or any other pin for that matter) is set as INPUT, it is in high-impedance state (theoretically), so effectively you have a voltage divider giving you 1/2 Vcc. When it is set as OUTPUT, and now assuming that its output impedance is << 10KΩ, it drives the output to either +5V or 0V.


21445: <p>How can I generate this pulse with an Arduino Micro?</p>

<p>Is it necessary an external component?</p>

<p><a href="https://i.stack.imgur.com/AlJUI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AlJUI.png" alt="enter image description here"></a></p>
 2881: <p><a href="https://i.stack.imgur.com/BOSdt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BOSdt.png" alt="enter image description here"></a></p>

<p>If both inputs are 0V, the output will be 0V.</p>

<p>If both inputs are 5V, the output will be 5V.</p>

<p>If one input is 0V and one 5V the output will be 2.5V.</p>

<p>However, if the device attached to the output doesn't have a high input impedance, the voltage will drop some. You could add an opamp to prevent this.</p>

<p>I think you can generate the 2 pins outputs using one of the timers in phase correct pwm mode. Freeing up the cpu and giving a very clean output signal, as using software "pwm" could be slightly of due to interrupts occuring.</p>
 10024: <p>Take two 10K or so resistors:</p>

<pre><code>    +5V
     |
    10K
     | 
Pin2-+---&gt; output
     |
    10K
     |
    GND
</code></pre>

<p>The following program does the trick:</p>

<pre><code>const uint8_t kPin = 2;
const uint32_t kDelay = 10;  // 100Hz

void setup() {
}

void loop() {
  pinMode(kPin, OUTPUT);
  digitalWrite(kPin, HIGH);
  delay(kDelay);

  pinMode(kPin, INPUT);
  delay(kDelay);

  pinMode(kPin, OUTPUT);
  digitalWrite(kPin, LOW);
  delay(kDelay);

  pinMode(kPin, INPUT);
  delay(kDelay);
}
</code></pre>

<p>When Pin2 (or any other pin for that matter) is set as <code>INPUT</code>, it is in high-impedance state (theoretically), so effectively you have a voltage divider giving you 1/2 Vcc. When it is set as <code>OUTPUT</code>, and now assuming that its output impedance is &lt;&lt; 10KΩ, it drives the output to either +5V or 0V.</p>

<p><a href="https://i.stack.imgur.com/b6HB4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b6HB4.jpg" alt="enter image description here"></a></p>
