Searching \ for '[PIC] Generating and measureing a waveform' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Generating and measureing a waveform'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Generating and measureing a waveform'
2010\07\24@231048 by Steve Smith

flavicon
face

Guys:
I have a conundrum that is proving a little difficult to solve.

I need to generate a waveform and then measure the resultant wave after its
been through the unit its testing. It's a stream of 6 x 1.5mS pulses with
50Us gaps that repeats every 20mS.

That then feeds a widget that stretches the 50Us gaps to 200Us and adds a
trailing edge 200Us period. And inverts the whole thing. This is the unit
being tested.

Generating the pulse stream is easy. A simple timer loop is called every
20mS from an interrupt driven loop. The capture module is then enabled
before each sequential pulse or gap to measure and compare with a windowed
reference value. The good results stored in a couple of flags and converted
into go / no go lamps after 13 consecutive loops.
This shows up the latency in the ISR as the periods get stretched by
differing amounts according to which interrupt was called. There are three
Tmr1 for the 1Us clock for the capture module, Tmr2 for the 20Ms tick to
drive the main calling loop these are both the same length and then there is
the capture module.... That is a lot longer and variable as the leading and
trailing edge take differing times....
This is stretching the 50Us periods by as much as 50Us.
Does anybody have any suggestions to combat this latency ???

It's a F648A with internal 4mhz Osc

Thanks in advance

Steve

2010\07\25@073739 by Olin Lathrop

face picon face
Steve Smith wrote:
> Tmr2 for the
> 20Ms tick to drive the main calling loop

You'd have to run the PIC from a **very** slow clock to get timer 2 down to
that period.  Then you'd have to wait a few weeks to verify it's working.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2010\07\25@080327 by Barry Walsh

flavicon
face

It is difficult to give specific advice without seeing the code or
knowing what stage of development your project is at.

Obvious points are :

1. This device supports up to 20Mhz. Do you have pins available to do
this with your hardware setup ?
This would run the code faster and shorten the time in your ISR. Perhaps
not enough to achieve the tolerance you require.

2. Use only essential code in the ISR functions. You may already have
this approach but many people don't. Don't forget that on a chip with a
single ISR, the maximum time to process the interrupt code is the sum of
all of your ISR code. Your fastest interrupt (timer) can be held off by
the time to process all of your various interrupts.

3. Some of the other PIC devices have multiple interrupt levels that are
prioritised. Perhaps one of those may be more suitable.

4. bit of a drastic solution but you could use one pic for signal
generation and another for validation.


Barry.




{Original Message removed}

2010\07\25@145708 by Charles Rogers

flavicon
face

----- Original Message ----- From: "Olin Lathrop" <spam_OUTolin_piclistTakeThisOuTspamembedinc.com
>
> You'd have to run the PIC from a **very** slow clock to get timer 2 down
> to
> that period.  Then you'd have to wait a few weeks to verify it's working.
>
>

Olin:
Are you saying it is  possible to accomplish what the OP is looking for
but just isn't feasible.

CR

2010\07\25@150210 by Bob Blick

face
flavicon
face

On Sun, 25 Jul 2010 13:57:04 -0500, "Charles Rogers" said:
>
> ----- Original Message -----
> From: "Olin Lathrop"
> > You'd have to run the PIC from a **very** slow clock to get timer 2 down
> > to
> > that period.  Then you'd have to wait a few weeks to verify it's working.
> >
> >
>
> Olin:
> Are you saying it is  possible to accomplish what the OP is looking for
> but just isn't feasible.

I think he was saying that timer 2 will overflow if you want a 20
Megasecond period unless you run the PIC at a very slow oscillator
frequency.

Cheers,

Bob

-- http://www.fastmail.fm - The professional email service

2010\07\25@150812 by Steve Smith

flavicon
face
OK.... Typo should have read mS...

Steve

-----Original Message-----
From: .....piclist-bouncesKILLspamspam@spam@mit.edu [piclist-bouncesspamKILLspammit.edu] On Behalf Of
Bob Blick
Sent: 25 July 2010 20:02
To: Microcontroller discussion list - Public.
Subject: Re: [PIC] Generating and measureing a waveform


On Sun, 25 Jul 2010 13:57:04 -0500, "Charles Rogers" said:
>
> ----- Original Message -----
> From: "Olin Lathrop"
> > You'd have to run the PIC from a **very** slow clock to get timer 2 down

> > to
> > that period.  Then you'd have to wait a few weeks to verify it's
working.
> >
> >
>
> Olin:
> Are you saying it is  possible to accomplish what the OP is looking for
> but just isn't feasible.

I think he was saying that timer 2 will overflow if you want a 20
Megasecond period unless you run the PIC at a very slow oscillator
frequency.

Cheers,

Bob

-- http://www.fastmail.fm - The professional email service

2010\07\25@154205 by Olin Lathrop

face picon face
Charles Rogers wrote:
>> You'd have to run the PIC from a **very** slow clock to get timer 2
>> down to
>> that period.  Then you'd have to wait a few weeks to verify it's
>> working.
>
> Olin:
> Are you saying it is  possible to accomplish what the OP is looking
> for but just isn't feasible.

My comment makes little sense without the snippet of the OP's post I was
replying to and that I quoted.  Yes, I think it would be unrealistic to make
timer 2 produce a 2Ms period (I think that was the OP's value) on its own.
This can easily be done in firmware, however.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2010\07\26@042934 by RussellMc

face picon face
What hat?

>> Tmr2 for the
>> 20Ms tick to drive the main calling loop

> You'd have to run the PIC from a **very** slow clock to get timer 2 down to
> that period.  Then you'd have to wait a few weeks to verify it's working.

Such humor is fine enough albeit a little [tm] boring after a while
BUT if it is not followed by a clue that you are being facetious then
you run enough risk of misleading the OP and creating substantial
extra banter which floods the technical material. If they miss your
point, and it's easily done, they may mistakenly assume that you are
trying to be helpful in solving their technical problem, rather than
some other problem that you perceive but which they don't.

I suggest that when you feel that you must derive great personal
amusement or espy an educational opportunity that you add a footnote
which explains the point. This can be part of the original humor if
you must, and need not reduce the sense of high personal achievement
at having made a funny.

eg Hmmm 20 Ms = 20E6s = almost 8 months! Why do you need to time for
such a long period?

or 20 Ms! - that's almost 8 months. Wow.

or just

                20 Ms = 20,000,000 seconds
                20 ms = 0.020 second

The last is more funny than the 1st 2, IMHO


                   Russell

2010\07\26@074245 by Olin Lathrop

face picon face
RussellMc wrote:
> If they miss your
> point, and it's easily done, they may mistakenly assume that you are
> trying to be helpful in solving their technical problem, rather than
> some other problem that you perceive but which they don't.

This wasn't merely a single typo, but the OP either being sloppy or possibly
thinking important details like this don't matter.  In other words, it
wasn't just a oops (despite the OP's protestations later), but a
irresponsibility.  That sort of thing must not be let pass here, especially
in cases like this where the subject is well within the domain of the list.

I was expecting that if the OP didn't notice the mistake from my comment
that he'd come back with "why do you say weeks" or some such.  Eventually he
would have realized he said 20e6 seconds instead of 20e-3 seconds as he
apparently meant.  The more drawn out this process, the more forcefully the
lesson would be learned.  Of course around here some third party apologist
always steps in and short circuits the process before it can run to
completion, so you get what you asked for sooner rather than later at the
expense of the educational value.

Units matter.  And no, I'm not going to let things like this slide in cases
where I think it's more than just a one off typo.  After all, all I did was
respond correctly to exactly what was asked.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000

2010\07\26@083515 by RussellMc

face picon face
I changed the tag to OT when I wrote this but have changed it back and
added the loud part.

Hat: Loud

*** EVERYONE:
*** AS PREVIOUSLY FREQUENTLY ADVISED.
*** PLEASE DO NOT START THIS SORT OF PROCEEDINGS IN [PIC], [EE] OR [TECH].
*** PLEASE MOVE ANY NON PIC MATTERS ON THIS OR OTHER THREADS OUT OF
PIC IMMEDIATELY

*** Polite informative technical correcting or informing in PIC/EE/TECH is fine.
*** Please carry out educating, pedantically informing, hectoring or
incipient bullying in [OT].

Hat: ... considers, admin slouch hat, informal, ...

> RussellMc wrote:
>> If they miss your
>> point, and it's easily done, they may mistakenly assume that you are
>> trying to be helpful in solving their technical problem, rather than
>> some other problem that you perceive but which they don't.

> This wasn't merely a single typo,

I noted that.
I was aware of that when I responded

> but the OP either being sloppy or possibly
> thinking important details like this don't matter.

Moot. You miss my point, possibly purposefully, possibly not.

> In other words, it
> wasn't just a oops (despite the OP's protestations later), but a
> irresponsibility.  That sort of thing must not be let pass here, especially
> in cases like this where the subject is well within the domain of the list.

That's essentially orthogonal to my point.
There are various ways to 'not let things pass'.
Your way on this and on several recent occasions is to purposefully
noise up a technical subject area.
If you'd either had your fun and also made it clear what the problem
was OR responded in OT, the total non PIC noise that has since
followed, would not have occurred in PIC. IF the OP subscribes to OT,
as is probably the case, then he'd get your funny. If not it would
take just a wee bit longer tyo sort out.

> I was expecting that if the OP didn't notice the mistake from my comment
> that he'd come back with "why do you say weeks" or some such.

Yes. That is precisely my point.
You CHOSE to PURPOSEFULLY noise up the PIC tag.
Again. Still. Despite 'quite a few' requests not to.

> Eventually he
> would have realized he said 20e6 seconds instead of 20e-3 seconds as he
> apparently meant.  The more drawn out this process, the more forcefully the
> lesson would be learned.

PotKettleBlack mode: It is here demonstrable that long drawn out
lessons can be extremely ineffective and that, therefore, maybe
shorter ones may work better.

> Of course around here some third party apologist
> always steps in and short circuits the process before it can run to
> completion,

As "completion" is defined by you as maximum noise then some stepping
in is in order.
But do note that NO apologist has stepped in here - just a denoiser.
ie I offered ways for you to have your funny ha ha moment without then
adding great noise.

If you want to behave towards people in a manner which a number of
people have offlist to me called bullying and some onlist as well,
please start it in OT. Whether its acceptable there depends what is
said, but its completely unacceptable here as explained above, and in
numerous prior posts when the same thing has arisen.

> so you get what you asked for sooner rather than later at the
> expense of the educational value.

.... noise ... see above.

> Units matter.

Of course.

> And no, I'm not going to let things like this slide in cases
> where I think it's more than just a one off typo.

Nobody asked you to, Sir, she said ... :-)
ie nobody has suggested that its not something that isn't useful to
address. Just that if that's your mission in life (and it's not a
totally uncommendable one by any means) then it needs to be, and can
easily be,  carried out without prejudice to the main technical flow

> After all, all I did was
> respond correctly to exactly what was asked.

There are people who are expert at going into bars and picking fights
that are able to be shown to have been the other fellow's fault and
not started by them. That doesn't mean it's actually true - just
"demonstrably true". In fact "all you did" was purposefully (by your
above admission) start a process which was aimed at creating to and
fro badinage which was not PIC related and with the ideal outcome
(your concept) being that it went on as long as possible.

It's time for this to stop.
If anywhere, [OT] is the place for such goings on.


              R mCmAHON

More... (looser matching)
- Last day of these posts
- In 2010 , 2011 only
- Today
- New search...