Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Generating Synced Pulses

Status
Not open for further replies.

xmen_xwk

Full Member level 3
Joined
Sep 12, 2014
Messages
172
Helped
2
Reputation
4
Reaction score
2
Trophy points
18
Activity points
1,373
I have arduino to create PWM on 3 channels pins for a timer. But they are like this
current.png

But how can I make them like this ?
required.png
 

The basic idea is to assign three different pins for each output and write a sketch to make them put out a pulse at different times, with a delay between each pin.

Many pieces of information are missing in your question. To start with: Are the pulses to run with fixed widths at fixed intervals? Or are they to be controlled by an external input?
 

The basic idea is to assign three different pins for each output and write a sketch to make them put out a pulse at different times, with a delay between each pin.
Do not want to use software to generate PWM.

To start with: Are the pulses to run with fixed widths at fixed intervals? Or are they to be controlled by an external input?
Pulse width can be change by software, like pwmWrite(). No they are not controlled by any external. Its uC generating the PWM.
 

Your statements seem to contradict each other. The first sentence says you don't want software to generate the pulses, but the second sentence says you want software to control it and that the uC should generate it. The uC is controlled by software.

It makes no sense to me. Please try to make it clearer than this. There are other details you'll have to provide but please clarify this first.
 

Hi,

A lot of informations missing:
* frequency range
* duty cycle range and resolution
* delay range

What exact microcontroller and what clock frequency? What pulse generation periferals are available?

In simplest case you have three timers or independent PWM modules where you can adjust start of counting.
The next is to use a "toggle pin" feature, but then you need to adjust the timeouts in an ISR...

Klaus
 

Your statements seem to contradict each other. The first sentence says you don't want software to generate the pulses, but the second sentence says you want software to control it and that the uC should generate it. The uC is controlled by software.

It makes no sense to me. Please try to make it clearer than this. There are other details you'll have to provide but please clarify this first.
Please google "arduino hardware timer", also "arduino software pwm"


Hi,

A lot of informations missing:
* frequency range
* duty cycle range and resolution
* delay range

What exact microcontroller and what clock frequency? What pulse generation periferals are available?

In simplest case you have three timers or independent PWM modules where you can adjust start of counting.
The next is to use a "toggle pin" feature, but then you need to adjust the timeouts in an ISR...

Klaus

Hi there,
The frequency range is 2Hz to 50Hz,
Pulse Width 200uS to 20000uS
delay between different channel pulses can be fixed, around 1ms.

The microcontroller is atmega328P with 16Mhz crystal. And I only have one timer left, is there any dedicated IC that can generate 3 pulses with a delay when they get 1 pulse input?
 

The OP mentioned Arduino and he probably has an Arduino Uno R3 as this is very popular with beginners. It uses an ATmega328P running at 16MHz. I'm no expert myself with Arduino or MCUs in general but what he seems to want to do is very simple. But, as you said, a lot of information is missing.

Edit: I was replying to KlausST but the OP made his post while I was typing my own.
 
Last edited:

The waveforms can be generated with a single timer by programming the timer interrupt incrementally. Some inaccuracy due to interrupt latency must be expected.
 

Hi,

Thanks Pjdd to provide some additional information.
But it is the OP that needs to do this. Otherwise we have a lot of effort and still we can not be sure if our assumptions are true.
"Probably", "maybe", "it seems".... means that we need to wait for the OP's next little piece of information.

For sure we can tell him to use three different timers.
-- then he tells that only one timer is available, but doesn't tell which one.
We can tell to use timer X
-- then maybe he tells only timer Y is available
We can tell to use three OCxx out puts
-- then he tells only two are available, but doesn't tell which one
And so on.... it's just a huge effort. That takes unnecessary time...
******

Back to the thread...
We don't know if all pulses have the same width or individual.
But now we know that the pulses may overlap - in the picture they don't overlap.

How I'd do it:
The microcontroller has 6 PWM outputs. Each can be programmed to 'toggle on compare match". Hopefully there are at least three of them available.
On "TOP" one could set all three values for the rising edges.
On "compare match" within the ISR of each one could set the "compare values" for the falling edges.
This gives precise timing without jitter.

But for sure programming an ISR is a software solution. The OP said he doesn't want to use....

Alternative solution: PLD

Klaus
 

Chaser (or sequencer) circuit made from transistors. An incoming pulse creates two additional pulses. Experiment with values to change pulse lengths. To get gaps between pulses, add stages as needed. It may or may not be possible to overlap pulses.

chaser 2 NPN provide 2 echoes after incoming pos pulse.png
 

The problem with that as a solution is that the OP wants to work with a wide range of frequencies and pulse widths, but he's reticent about details. With some posters asking for help, those who are trying to help have to drag out the details bit by bit. I'm giving up.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top