Created
November 20, 2025 13:26
-
-
Save BlvckBytes/a6e3f199bd4c614fbb1f27a9b87d5ab1 to your computer and use it in GitHub Desktop.
Simple symmetric-duty-time H-bridge with dead-time, ideal for cheap ATTinys as a substitution for the corresponding ASIC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define BRIDGE_A_PIN 3 | |
| #define BRIDGE_B_PIN 4 | |
| #define ON_TIME_US 2000 | |
| #define DEAD_TIME_US 100 | |
| void setup() { | |
| pinMode(BRIDGE_A_PIN, OUTPUT); | |
| digitalWrite(BRIDGE_A_PIN, LOW); | |
| pinMode(BRIDGE_B_PIN, OUTPUT); | |
| digitalWrite(BRIDGE_B_PIN, LOW); | |
| } | |
| void loop() { | |
| digitalWrite(BRIDGE_A_PIN, HIGH); | |
| delayMicroseconds(ON_TIME_US); | |
| digitalWrite(BRIDGE_A_PIN, LOW); | |
| delayMicroseconds(DEAD_TIME_US); | |
| digitalWrite(BRIDGE_B_PIN, HIGH); | |
| delayMicroseconds(ON_TIME_US); | |
| digitalWrite(BRIDGE_B_PIN, LOW); | |
| delayMicroseconds(DEAD_TIME_US); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment