different software times, impossible?


Closed Thread
Results 1 to 39 of 39

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,610


    Did you find this post helpful? Yes | No

    Default Re: different software times, impossible?

    So the PIC is what's going to generate the pulses for two step motor drivers and you're trying to implement linear interpolation in the PIC?
    Generally what you're looking for is Breshenhams algorithm but your case seems rather specific with one axis always moving the same distance so I don't know.

    /Henrik.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: different software times, impossible?

    if i choose the two pic serially connected solution the two separate quartz can produce an error in time or it will be negligible?

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,632


    Did you find this post helpful? Yes | No

    Default Re: different software times, impossible?

    it would be relatively easy to to emit 400 cycles of a 50% pw 600uS period wave [x] using a ccp module while toggling another pin at 2 to 12 mS intervals (100-600 pulses) . the pin toggle isr would count down the desired number of [y ] pulses (the period being predetermined) and terminate the ccp output and itself at that point . if a 16 bit timer is used for the isr then the resoution would be reasonable with a 20mhz clk.
    you could also look at a PoKeys57 module or an arduino running GRBL.
    your description of the problem at hand lacks sufficient detail for me to progress beyond this point , a classic xy problem http://xyproblem.info/

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: different software times, impossible?

    hello richard so its possible to stop the pwm after a fixed time? Maybe its a solution, cause the 400 steps (or always multiply of 400) are fixed, i need only to stop the pwm output after the same time of y, its possible to stop the pwm at the exact point from the software?

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,632


    Did you find this post helpful? Yes | No

    Default Re: different software times, impossible?

    CPRxCON=12 PWM ON
    CPRxCON=0 PWM OFF

    You may need to set the CCPx output pin to 0 if the pin idle state is critical

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: different software times, impossible?

    the lowest possible hpwm frequency is 245 hz (for a 4mhz quartz) and 1221hz for a 20mhz quartz, now i have to calculate the frequency of 400 pulses.....

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,632


    Did you find this post helpful? Yes | No

    Default Re: different software times, impossible?

    try thisName:  Untitled.jpg
Views: 903
Size:  54.3 KB

Similar Threads

  1. WDT times not as expected 18f46k80
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 18th July 2015, 04:22
  2. MCSP, PBP260, Win7 - is it impossible?
    By HenrikOlsson in forum General
    Replies: 18
    Last Post: - 26th January 2010, 17:08
  3. Drive relay between two times
    By Pedro Pinto in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th December 2009, 09:19
  4. Instruction times
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 5th June 2009, 09:16
  5. Calling Subroutines Multiple Times
    By Forkosh in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th March 2008, 07:11

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