How to get the deadband between 2 PWM signals using Arduino Uno. The code below is how
Question:
How to get the deadband between 2 PWM signals using Arduino Uno. The code below is how I generated 2 PWM signals.
// Synchronize PWM on channels outputs OC1A, OC1B at 20Hz and OC3A at 40Hz
void setup() {
pinMode(10, OUTPUT); // Set digital pin 11 as an output
pinMode(9, OUTPUT); // Set digital pin 12 as an output
pinMode(5, OUTPUT); // Set digital pin 5 as an output
GTCCR = _BV(TSM) | _BV(PSRSYNC); // Halt and synchronize the timers
TCCR1A = _BV(WGM11) | _BV(COM1A1) | _BV(COM1B1); // Enable the PWM outputs OC1A, OC1B on digital pins 11 and 12
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS11) | _BV(CS10); // Set fast PWM and prescaler of 64 on timer 1
ICR1 = 12499; // Set the timer 1 frequency to 20Hz
OCR1A = 6250; // Set the timer 1, channel A duty-cycle to 50%
OCR1B = 6250; // Set the timer 1, channel B duty-cycle to 50%
TCNT1 = 0; // Set the timer 1 count to 0
GTCCR = 0; // Let the timers free run simultaneously...
}
void loop() {}
Statistics The Art And Science Of Learning From Data
ISBN: 9780321997838
4th Edition
Authors: Alan Agresti, Christine A. Franklin, Bernhard Klingenberg