Author Topic: Is there a design pattern for a multichannel pulse stretcher?  (Read 739 times)

0 Members and 1 Guest are viewing this topic.

Offline e100Topic starter

  • Frequent Contributor
  • **
  • Posts: 605
Is there a design pattern for a multichannel pulse stretcher?
« on: September 06, 2019, 04:25:32 pm »
For a single channel you can set a timer interrupt that uses a callback to end the stretching of the pulse.
What if you have more channels than timer interrupts.

My Google searches haven't found anything. Is there a particular phrase I should be searching for?
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Is there a design pattern for a multichannel pulse stretcher?
« Reply #1 on: September 06, 2019, 04:35:32 pm »
For a single channel you can set a timer interrupt that uses a callback to end the stretching of the pulse.
What if you have more channels than timer interrupts.

My Google searches haven't found anything. Is there a particular phrase I should be searching for?

You probably need to have a timer of your desired pulse-width granularity, and table with pulse widths. When the timer expires, increment a count, and check all of the pulse width tables to know when to toggle outputs. But this is ugly and there will be skew between pulses which might not be acceptable.

Consider connecting a small FPGA to the micro and building as many pulse generators as you need in it. A simple SPI port can be used to set pulse widths and maybe a trigger too.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf