How to genearate a pulse with Variable ON-Time and OFF-Time using 8253(4) ?

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Dear All,

I need to generate a pulse trains which on-time and off-time can be
adjusted by user individually.

Pls help to provides your valuable advise.
Thanks.
regards,
lamb
(I like lamb)

Re: How to genearate a pulse with Variable ON-Time and OFF-Time using 8253(4) ?

Quoted text here. Click to load it

A better description would be helpful.  What you've described leaves open far
too many possibilities for a meaningful reply.

Jon

Re: How to genearate a pulse with Variable ON-Time and OFF-Time using 8253(4) ?
Quoted text here. Click to load it

But we can still do the bulk of the work :-)

PROGRAM pulser(input)

  CONST
    on = TRUE; off = FALSE;

  VAR
     ontime, offtime : 0..maxint;

  PROCEDURE setbit(onoff : boolean);

    BEGIN
    (* system specific code *)
    END;

  PROCEDURE delay(time : integer);

    BEGIN
    (* system specific code *)
    END;

  FUNCTION interrupted : boolean;

    BEGIN
    (* system specific code *)
    END;

  BEGIN (* pulser *)
  REPEAT
    read(ontime);
    IF ontime > 0 THEN BEGIN
      read(offtime);
      IF offtime > 0 THEN BEGIN
         REPEAT
           setbit(on);
           delay(ontime);
           setbit(off);
           delay(offtime)
         UNTIL interrupted;
         END;
      END;
  UNTIL (ontime <= 0) or (offtime <= 0);
  END.

--
Chuck F ( snipped-for-privacy@yahoo.com) ( snipped-for-privacy@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
We've slightly trimmed the long signature. Click to see the full one.
Re: How to genearate a pulse with Variable ON-Time and OFF-Time using 8253(4) ?

Quoted text here. Click to load it

hehe.  But I'd rather wait a little until I know more about what's desired to
even recommend a cpu, at all.

Perhaps the pulse trains operate over periods of 10^9 years and need to be
adjustable to the microsecond, with jitter and other errors no greater than a
nanosecond.  And the adjustments must be made by the user using telepathy.  Who
knows from the description?

Jon

Re: How to genearate a pulse with Variable ON-Time and OFF-Time using 8253(4) ?
Quoted text here. Click to load it


A simple multivibrator would do.

Re: How to genearate a pulse with Variable ON-Time and OFF-Time using 8253(4) ?
On 10 Jan 2005 03:48:42 -0800, snipped-for-privacy@yahoo.com.hk (lamb)

Quoted text here. Click to load it

The 8254 is not the best chip for that job.  The 9513 chip can do what
you ask.  If you must use the 8254 to do this job, then you will
really be using the processor to generate the pulse train and the 8254
will just be used by the processor to keep time.  The processor will
have to be actively involved with every edge.  The 9513, on the other
hand, has two registers that can be set up to alternately load two
different presets that are counted down.  Once it is set up, the
processor can go away and leave the 9513 to continue to generate the
pulse train unattended.


-Robert Scott
 Ypsilanti, Michigan
(Reply through this forum, not by direct e-mail to me, as automatic reply
address is fake.)

Re: How to genearate a pulse with Variable ON-Time and OFF-Time using 8253(4) ?
Dear all,

The requirement details -
On Time - 1 us ~ 9999 us.
off Time - 1us ~ 9999 us.
After user enter the on-time and off-time value, the pulse-training
will be generated according to the setting.

The timing need to relative precise, +/- 0.5us. No jitter is allowed
if possible. Does it possible to implement with 8253 ? or using9513 ?
Does it easy to obtain ?
thanks all.
regards,
lamb.

Re: How to genearate a pulse with Variable ON-Time and OFF-Time using 8253(4) ?
On 12 Jan 2005 09:27:32 -0800, snipped-for-privacy@yahoo.com.hk (lamb)

Quoted text here. Click to load it

It is easy to do with a 9513.  Use a 1 MHz clock.  The pre-load
registers are 16-bits.  So 1 - 9999 is covered well.


-Robert Scott
 Ypsilanti, Michigan
(Reply through this forum, not by direct e-mail to me, as automatic reply
address is fake.)

Re: How to genearate a pulse with Variable ON-Time and OFF-Time using 8253(4) ?
Quoted text here. Click to load it


Hi, what you need is a micro with an 16bit capture compare module. You just
setup the module and it produces the waveform without any processor
intervention. There are plenty of suitable processors with this periferal,
chosse the one you like.

Re: How to genearate a pulse with Variable ON-Time and OFF-Time using 8253(4) ?

Quoted text here. Click to load it

Most capture/compare units that I am familiar with (i.e. PICs) cannot
handle the OP's problem.  He want two separate widths - one for on and
one for off.  The processor could alternate between these two, but not
for extremely small pulse widths.  There is no time to set up the next
compare event if the pulse is only 1 usec. long.  But the 9513 can do
this.


-Robert Scott
 Ypsilanti, Michigan
(Reply through this forum, not by direct e-mail to me, as automatic reply
address is fake.)

Re: How to genearate a pulse with Variable ON-Time and OFF-Time using 8253(4) ?
On Wednesday, in article

Quoted text here. Click to load it

Lots of others do (H8xxx series for a start) in some cases it is a
matter of changing two values even if it has been set to PWM mode and
effectively change the frequency as well if you like. That's how I setup
simple panel dimming controls, a PWM that the on/off ratios are changed
from software from 'switchs', external commands or reading of pot.

The H8 series tend to have several of them as well, so you could probably
check your jitter if that worried :-^

I am sure the AVR, Z8 and others have one or more that can do this as well.

--
Paul Carpenter          | snipped-for-privacy@pcserviceselectronics.co.uk
<http://www.pcserviceselectronics.co.uk/ PC Services
We've slightly trimmed the long signature. Click to see the full one.
Re: How to genearate a pulse with Variable ON-Time and OFF-Time using 8253(4) ?
says...
Quoted text here. Click to load it
I think the timer on the MSP430 can handle that chore.  You set up
one of the PWM modes and  use the CCR0 register to set the total
interval (time on + time off).  Then CCR1 is set to the time on.   I
used that method to generate a 500Hz clock with a variable duty cycle.


The PWM modes are set up so that everything is done in the
processor--- you would have to have the processor monitor
the output to stop the time if you wanted only one pulse,
and not a continouous pulse train. I think it would meet the specs with
a 8MHz clock, though.

Mark Borgerson


Re: How to genearate a pulse with Variable ON-Time and OFF-Time using 8253(4) ?

Quoted text here. Click to load it

  Those are very old devices - what you need is a 16 bit PWM module,
that allows 16 bit define of timebase, and 16 bit define of duty
cycle.
  Not all uC think like that, but the z8 encore is one that does,
it calls the timebase reload value. I think it can run to the
CLK freq, of 20MHz on the PWM, or us a prescaler.
  You will need HW, as SW will not easily cope with
the 1us ON 1us OFF times.

  Just choose the smallest z8Fxx that has the PWM - some
come in DIP8, so you may be able to make a tiny Serial-PWM
block. If you include the Prescale setting, you can create
one that does 100ns-419ms with 1 part in 2^16 resolve.

-jg


Site Timeline