generate a train of pulses


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2010
    Posts
    13

    Default generate a train of pulses

    Hello friends!! I need to generate a train of 40 pulses of about 2us (2 micro seconds) each one.
    Does exist some type of instruction or procedure to obtain it?
    Thank you a lot

  2. #2
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Try the PauseUs command ?

    From the manual
    Pause the program for Period microseconds. Period is 16-bits, so
    delays can be up to 65,535 microseconds. Unlike the other delay
    functions (NAP and SLEEP), PAUSEUS doesn't put the microcontroller into
    low power mode. Thus, PAUSEUS consumes more power but is also
    much more accurate.
    Because PAUSEUS takes a minimum number of cycles to operate,
    depending on the frequency of the oscillator, delays of less than a
    minimum number of microseconds are not possible using PAUSEUS. To
    obtain shorter delays, use an assembly language routine.
    OSC Minimum delay
    3 (3.58) 20us
    4 24us
    8 12us
    10 8us
    12 7us
    16 5us
    20,24 3us
    25-33* 2us
    40** 2us
    * PIC17Cxxx and PIC18Xxxx only.
    ** PIC18Xxxx only.
    PAUSEUS assumes an oscillator frequency of 4MHz. If an oscillator other
    that 4MHz is used, PBP must be told using a DEFINE OSC command.
    See the section on speed for more information.
    Last edited by malc-c; - 6th January 2011 at 19:22.

  3. #3
    Join Date
    Apr 2010
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    Thank you for your answer Malc-c
    I must use a 18Xxx family PIC

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default

    Hi, Comte Vlad of the X (lol)

    this kind of work might be achieved through assembler including ... where a 4 Mhz Xtal will be more than enough.

    PBP ( and generally high level languages ) is ... ahum ... let's say not so good, for this kind of work !

    Now ... 40 pulses of 2µs is rather fuzzy, as a signal shape description...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts