Re: Timing pulses



On Aug 17, 10:22 am, Jamie
<jamie_ka1lpa_not_valid_after_ka1l...@xxxxxxxxxxx> wrote:
BobS wrote:
On Aug 16, 5:01 pm, Joerg <inva...@xxxxxxxxxxxxxxx> wrote:

BobS wrote:

On Aug 14, 12:14 am, Nobody <nob...@xxxxxxxxxxx> wrote:

On Thu, 13 Aug 2009 08:40:16 +0100, Martin Brown wrote:

8 bit accuracy is adequate.  A micro has not been selected pending
arriving at a scheme for this task, preferably the smallest micro
possible for cost and space.  The micro does have to manage a 25 Hz
PWM out in addition to the input pulses.

8 bit resolution of a 12.5ms period is 50us steps? That is huge - almost
anything should be able to do that adequately. Most of the discussion so
far has been about obtaining sub us timing precision with a micro. You
might even manage 16bit accuracy with a free running 5MHz clocked timer
register that you read whenever an edge triggered event occurs.
The cheapest PIC with a dedicated PWM output would be my choice.

At 25Hz PWM frequency, I wouldn't even bother with the "dedicated PWM"
bit. A PIC10F200 would be more than adequate, and I'm not sure I'd even
bother using the timer.

From just the external I/O stand point the PIC10 series is appealing,
since could handle this as a digital task.  Since there is a dearth of
internal peripherals, the initial thought for firmware is a single
loop continuously cycling through input, calculation, and output
code.  The loop time would be the time base, and would be empirically
determined with constants and variables set accordingly.  Is there a
possibility this would work?  What else should be considered?

I wouldn't use loop times as time bases. Can blow you out of the water
if something happens in the background, like a WDT handler. Take a look
at the one I suggested in anotehr post in this thread. Contains a nice
timer plus a PWM.

--
Regards, Joerg

http://www.analogconsultants.com/

"gmail" domain blocked because of excessive spam.
Use another domain or send PM.- Hide quoted text -

- Show quoted text -

Thanks Joerg,  Would you consider running with the WDT disabled?
Also, it appears that the PIC's mentioned above, and others, can not
run a PWM out at 25Hz. with common settings.  How can 25Hz PWM be
obtained without running the clock insanely slow?

For that kind of slow speed, you perform the PWM in a software loop,
using the timers to calibrate your loop.

  An interrupt can be used generated via a timer reg that can thus,
decrement a count down value. When the value reaches 0, you can then
  perform what you need and reset the software counter.. This will give
you a nice accurate slow PWM output..

   For that kind of operation, you don't even need a uC with a PWM output
  option.- Hide quoted text -

- Show quoted text -

You have it right, my programming is rather elementary, think PicAxe.
Anything else is like a foreign language. Looks like outside help
will be needed to pull this project together, or its going to be a
long time climbing a curve.

The PWM out frequency does not have to be that accurate, + - 10%,
without much jitter (< 1 %) or shifting about. Main thing is the
output is proportional to the input delta T.

Running the output at 1/3 the frequency of the input would be ok. For
the best response to a rapidly changing input the output must be
updated with every input pulse pair. This could cause multiple pulses
per output period, a condition that would have to be evaluated and
possibly worked around??

It looks like there is a case for using a PIC 10F series, with
strictly software conversion. I'm leaning towards a compiled Basic
for this task to try to minimize the learning curve for a retiree, is
that reasonable? Or is this a software task that can be handled by an
accomplished programmer in a reasonably short time?
.



Relevant Pages

  • Re: Timing pulses
    ... The micro does have to manage a 25 Hz ... The cheapest PIC with a dedicated PWM output would be my choice. ... bother using the timer. ... The loop time would be the time base, ...
    (sci.electronics.design)
  • Re: PWM -> Audio Output
    ... What is important in using a timer for pwm is the interrupt/reset value. ... In this case the timer resolution may be 16 bit, the pwm resolution is 8 bit. ... Why use a buffer when the audio You want to play is sitting around in memory? ...
    (comp.arch.embedded)
  • Re: Timing pulses
    ... The micro does have to manage a 25 Hz ... The cheapest PIC with a dedicated PWM output would be my choice. ... bother using the timer. ... The loop time would be the time base, ...
    (sci.electronics.design)
  • Re: Timing pulses
    ... The micro does have to manage a 25 Hz ... The cheapest PIC with a dedicated PWM output would be my choice. ... bother using the timer. ... "gmail" domain blocked because of excessive spam. ...
    (sci.electronics.design)
  • Schaltung von at90s2313 auf atmega8 portieren, PWM Ausgang gesucht
    ... In der alten Schaltung benutze ich den Timer 1 als PWM ... Konfiguration im BASCOM-File: ... Down, Compare B Pwm = Clear Down ... Nun stehe ich etwas auf dem Schlauch, denn der mega8 hat gleich 3 Timer. ...
    (de.sci.electronics)