1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

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

Discussion in 'Embedded' started by lamb, Jan 10, 2005.

  1. lamb

    lamb Guest

    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)
     
    lamb, Jan 10, 2005
    #1
    1. Advertisements

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

    Jon
     
    Jonathan Kirwan, Jan 10, 2005
    #2
    1. Advertisements

  3. lamb

    Robert Scott Guest

    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.)
     
    Robert Scott, Jan 10, 2005
    #3
  4. lamb

    CBFalconer Guest

    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.
     
    CBFalconer, Jan 10, 2005
    #4
  5. 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
     
    Jonathan Kirwan, Jan 10, 2005
    #5
  6. lamb

    CBarn24050 Guest

    Subject: Re: How to genearate a pulse with Variable ON-Time and OFF-Time
    A simple multivibrator would do.
     
    CBarn24050, Jan 10, 2005
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.