I am looking for some guidance on creating four simultaneous and independent variable length output pulses on separate pins on the T3 without any blocking code to create the delays determining the pulse width. This is not PWM - but individual pulses.
I have this functionally working now, but I'm using a loop to comparing the clock to elapsed times for each output pin. This doesn't block like delay(), but I would like to use timers/interrupts to accomplish this if possible and stop relying on polling the clock.
Possible approach:
* calculate necessary pulse width
* set a pin high
* start a timer counting (the pulse width time of between 100uS and 700uS)
* move on to other code processing
* when timer reaches the set value - interrupt processing and perform function of setting pin low (completing the pulse)
* continue processing....
This would appear to require 4 timers and the ability to associate them with 4 output pins.
Is this the right approach? Are there better ways to solve this?
I am seeking any advice on ways to accomplish this on the T3.
Thanks!
I have this functionally working now, but I'm using a loop to comparing the clock to elapsed times for each output pin. This doesn't block like delay(), but I would like to use timers/interrupts to accomplish this if possible and stop relying on polling the clock.
Possible approach:
* calculate necessary pulse width
* set a pin high
* start a timer counting (the pulse width time of between 100uS and 700uS)
* move on to other code processing
* when timer reaches the set value - interrupt processing and perform function of setting pin low (completing the pulse)
* continue processing....
This would appear to require 4 timers and the ability to associate them with 4 output pins.
Is this the right approach? Are there better ways to solve this?
I am seeking any advice on ways to accomplish this on the T3.
Thanks!