AnsweredHot!Is it possible to stretch a pulse signal using only microcontroller?

Page: 12 > Showing page 1 of 2
Author
seyyah
Super Member
  • Total Posts : 598
  • Reward points : 0
  • Joined: 2004/05/14 12:49:28
  • Status: offline
2018/11/07 03:01:15 (permalink)
0

Is it possible to stretch a pulse signal using only microcontroller?

Is it possible to stretch a signal of 1µs pulse width to a degree at least 10(100 would be better) times the original signal width, only using a dspic (can be any dspic or pic)?  Or can we do it precisely(%1-2 error max) by an ic or curcuit ? I need your opinions. Thank you.
#1
RISC
Super Member
  • Total Posts : 5355
  • Reward points : 0
  • Status: offline
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/07 04:36:00 (permalink)
5 (1)
Hi,
Did you check the Input Capture and Output Compare units ?
Another powerful unit is the PTG unit (only in some dsPIC)
Which exact dsPIC do you use...there are hundreds o them...
Regards
 
#2
qhb
Superb Member
  • Total Posts : 7869
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: online
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/07 04:36:25 (permalink)
5 (2)
Yes
#3
du00000001
Just Some Member
  • Total Posts : 2234
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: offline
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/07 04:38:59 (permalink)
5 (1)
Yes.
Precisely if you can afford some signal delay.

PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
#4
seyyah
Super Member
  • Total Posts : 598
  • Reward points : 0
  • Joined: 2004/05/14 12:49:28
  • Status: offline
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/07 06:35:43 (permalink)
0
The dspic is not decided yet, it can be anyone. Currently I'm considering to use dsPIC33CK64MP505. I did not use PTG before. I'm not familiar with it but I have used IC and OC many times before. The signal may have a phase delay at the output but signal width should be precisely accurate. Because I have two signals and I'll apply this on both of them and their pulse duration ratio should be precisely kept. For example assume that I have a 1.1µs signal and a 2.2µs signal. The ratio is 2 exactly. When I stretch the first signal e.g. to 11µs, the other must be exactly 22µs. So, how can this be done?
#5
mbrowning
Just a Member
  • Total Posts : 1147
  • Reward points : 0
  • Joined: 2005/03/16 14:32:56
  • Location: Melbourne, FL
  • Status: online
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/07 06:39:27 (permalink)
5 (3)
Feature creep!

Oh well - there's always next year
#6
du00000001
Just Some Member
  • Total Posts : 2234
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: offline
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/07 06:39:42 (permalink)
5 (1)
   ... how can this be done

  1. Use input capture to acquire the incoming signals
  2. Calculate the pulse durations (time difference between pos. and neg. edge)
  3. Multiply the pulse durations by whatever factor you like.
  4. "Replay" the stretched pulses - e.g. via OC.

PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
#7
seyyah
Super Member
  • Total Posts : 598
  • Reward points : 0
  • Joined: 2004/05/14 12:49:28
  • Status: offline
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/07 09:48:11 (permalink)
0
du00000001
   ... how can this be done

  1. Use input capture to acquire the incoming signals
  2. Calculate the pulse durations (time difference between pos. and neg. edge)
  3. Multiply the pulse durations by whatever factor you like.
  4. "Replay" the stretched pulses - e.g. via OC.


The problem is the resolution with this method. I'd hoped a more harware'd way. E.g. incoming signal triggers some other hardware and directly manipulates output to achieve better resolution and does not suffer rounding errors.
#8
du00000001
Just Some Member
  • Total Posts : 2234
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: offline
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/07 10:00:43 (permalink)
5 (1)
If you do not use float, there will be no rounding error.
 
But you may continue wishful thinking ...

PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
#9
crosland
Super Member
  • Total Posts : 1314
  • Reward points : 0
  • Joined: 2005/05/10 10:55:05
  • Location: Bucks, UK
  • Status: online
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/07 10:32:17 (permalink)
5 (5)
seyyah
The problem is 



... you keep adding new requirements every time someone tries to help you.
 
State the exact problem you wish to solve including all the requirements
#10
Aussie Susan
Super Member
  • Total Posts : 3363
  • Reward points : 0
  • Joined: 2008/08/18 22:20:40
  • Location: Melbourne, Australia
  • Status: offline
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/07 18:39:00 (permalink)
5 (1)
Firstly, you will *always* have a phase delay, even if you use hardware. It really comes down to how much delay can you tolerate.
Second, what resolution do you want? You have talked about a 1uSec pulse (which I assume is the width - the repetition rate will be longer than the longest period you want to stretch to)  that you want to stretch. If you want that to be stretched from 1uSec to 10uSec in 1uSec steps then you probably need something that is working at least in 0.5uSec periods (sampling theory and all that!).
If you want this in hardware only then you are probably in the wrong forum - although I'm sure there are many here that are more than capable of helping you.
Susan
#11
NorthGuy
Super Member
  • Total Posts : 5100
  • Reward points : 0
  • Joined: 2014/02/23 14:23:23
  • Location: Northern Canada
  • Status: offline
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/07 21:11:39 (permalink)
5 (1)
seyyah
The problem is the resolution with this method.



If you run at 100 MHz, then the resolution of input capture is 10 ns - 1% for 1 us pulse. You said before that 2% error would be Ok.
#12
JPortici
Super Member
  • Total Posts : 453
  • Reward points : 0
  • Joined: 2012/11/17 06:27:45
  • Location: Grappaland
  • Status: offline
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/07 23:37:03 (permalink)
0
I skimmed over the dsPIC33CK64MP505 datasheet but i couldn't find the maximum frequency for the SCCP module clock. Sometimes it's written, sometimes it's not.
However you can clock it with FOSC so it's possible you can run it at 200MHz. Theoretically faster if you use the Reference clock module with the VCO/4 clock source, but again i don't know what the maximum clock is
#13
seyyah
Super Member
  • Total Posts : 598
  • Reward points : 0
  • Joined: 2004/05/14 12:49:28
  • Status: offline
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/08 01:38:39 (permalink)
0
Sorry, I miscalculated the error. It should be %0.1. I'll look into ctmu. I did not use it either but it seems promising. Thank you all.
#14
Aussie Susan
Super Member
  • Total Posts : 3363
  • Reward points : 0
  • Joined: 2008/08/18 22:20:40
  • Location: Melbourne, Australia
  • Status: offline
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/08 18:58:06 (permalink) ☼ Best Answerby seyyah 2018/11/09 05:59:03
5 (1)
An error of 0.1% means 1 part in 1000. That means you have to control the pulse at least 1000 times better than the input. If you say you have a 1uSec pulse (again, I assume that is the width) then you need to have something that runs at least 1000 times faster - and that is getting into the 1nSec range which is probably well beyond the capability of PIC MCUs. (Truth be told, you may need to go FPGA as even Intel and ARM type devices would be pushing their limits at that speed.)
Susan
#15
qhb
Superb Member
  • Total Posts : 7869
  • Reward points : 0
  • Joined: 2016/06/05 14:55:32
  • Location: One step ahead...
  • Status: online
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/08 19:03:40 (permalink)
5 (2)
I don't think this OP really knows what their requirements are. They change with every reply.
It would be easier to help if we were told what it is they are actually trying to achieve.
#16
seyyah
Super Member
  • Total Posts : 598
  • Reward points : 0
  • Joined: 2004/05/14 12:49:28
  • Status: offline
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/09 06:07:29 (permalink)
0
Yes 1 ns is required. I was not sure about the requirement at the beginning, I tried to assume approximately, but as I progress, I realized the assumption was wrong/not enough. Since the CTMU edge detection is async to the pic clock and has various options to detect edges and has capability to use comparator instead of adc, I believe I can achieve some results. The delay is not very important for me. The accuracy of the width is important. 
#17
JPortici
Super Member
  • Total Posts : 453
  • Reward points : 0
  • Joined: 2012/11/17 06:27:45
  • Location: Grappaland
  • Status: offline
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/09 07:49:13 (permalink)
0
seyyah
Yes 1 ns is required.



I would look into a CPLD/small FPGA
#18
Jim Nickerson
User 452
  • Total Posts : 5559
  • Reward points : 0
  • Joined: 2003/11/07 12:35:10
  • Location: San Diego, CA
  • Status: offline
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/09 07:53:10 (permalink)
5 (2)
crosland
seyyah
The problem is 



... you keep adding new requirements every time someone tries to help you.
 
State the exact problem you wish to solve including all the requirements


I wonder why you have yet to answer this question ?
#19
du00000001
Just Some Member
  • Total Posts : 2234
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: offline
Re: Is it possible to stretch a pulse signal using only microcontroller? 2018/11/09 08:42:05 (permalink)
4 (1)
1 ns is even hard for FPGAs (in the "general fabric").
If you have more capabilities in the analog domain, I'd go to a dual-slope analog concept.

PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
#20
Page: 12 > Showing page 1 of 2
Jump to:
© 2018 APG vNext Commercial Version 4.5