Synchronous pulses


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Brussels, Belgium
    Posts
    104

    Default Synchronous pulses

    .. not sure if that is the correct title but want I want to do is output a pulse in parallel on three different pins. The pulses will be of different lengths (1msec down to a few usecs) and the leading edges need to be aligned.

    I can think of one way of doing it - put all 3 o/p's high together then pause incrementally as I bring them back down one at a time - but I was wondering if there was a more elegant way of doing it ?

    Thanks,

    Andrew

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    967


    Did you find this post helpful? Yes | No

    Default

    Are you thinking of a software PWM? Quite easy to do really.

    http://darreltaylor.com/DT_INTS-14/SPWM.html

  3. #3
    Join Date
    Feb 2006
    Location
    Brussels, Belgium
    Posts
    104


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Jerson View Post
    Are you thinking of a software PWM? Quite easy to do really.

    http://darreltaylor.com/DT_INTS-14/SPWM.html
    No, not a software PWM.
    Actually for controlling some photographic strobes.
    Three command lines, need to fire simultaneously but then shut off after different times and wait for the next trigger.

    Andrew

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Add a little to your idea... Assuming the pins in question are on the same port...
    Code:
    TRIS? = %00000000
    X VAR BYTE
    Y VAR BYTE
    Z VAR BYTE
    
    STROBE:
    PORT? = %00000111
    PAUSE X  ' Or use PAUSEUS
    PORT? = %00000011
    PAUSE Y
    PORT? = %00000001
    PAUSE Z
    PORT? = %00000000
    RETURN
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Hi, Andew

    It's in French ... Yes.

    But just close to what you look for ...

    http://mathieu.agopian.free.fr/prog_pic/servobis/

    http://mathieu.agopian.free.fr/prog_pic/servoter/

    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 " !!!
    *****************************************

  6. #6
    Join Date
    Feb 2006
    Location
    Brussels, Belgium
    Posts
    104


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi, Andew

    It's in French ... Yes.

    But just close to what you look for ...

    http://mathieu.agopian.free.fr/prog_pic/servobis/

    http://mathieu.agopian.free.fr/prog_pic/servoter/

    Alain
    Hi alain,

    Yes, seems to be pretty much what I'm describing. Thanks for the link.

    Andrew

  7. #7
    Join Date
    Feb 2006
    Location
    Brussels, Belgium
    Posts
    104


    Did you find this post helpful? Yes | No

    Default

    Reply to Dave:

    Yup, that's what described.

    The issue is that the three outputs will not always be ordered longest to shortest from bit 0 to bit 2 (or bit 2 to 0 as you ordered them). Not difficult to get around - just need to sort the pulse lengths, calculate the incremental time between sequential trailing edges and use a bunch of IF statements to pull them back down in the right order.

    But woudn't it be nice if there was single command that could output parallel pulses

    Andrew
    Last edited by AndrewC; - 14th October 2009 at 09:59.

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    How are you going to input the parameters to the PIC?
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. I Need Help.. I want to generate controlled pulses
    By alabbadi in forum PBP Wish List
    Replies: 7
    Last Post: - 18th November 2007, 10:42
  2. Count pulses between VARIABLE TIME
    By RodSTAR in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th October 2007, 12:44
  3. Timing input pulses and re-outputting them
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 28th February 2007, 01:50
  4. Timed pulses on 2 pins
    By Danie Joubert in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 15th March 2004, 07:38
  5. Counting pulses
    By srspinho in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 19th November 2003, 00:54

Members who have read this thread : 0

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