different software times, impossible?


Closed Thread
Results 1 to 39 of 39

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: different software times, impossible?

    hi richard, i understand. The 31-479 possible pulses of y for every 400 pulses of x are for me necessary, it's impossible for me to change those three parameters. i know it's a problem of "times", they are like two "digital gears" and i must find the way to match the reciprocal "teeth". The frequency of x now is 1666 hz (240.000uS) but the x motor accept other frequencies too. More difficult for me is understand interrupts, overflow, ticks, to find my way and the possible solution

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,690


    Did you find this post helpful? Yes | No

    Default Re: different software times, impossible?

    More difficult for me is understand interrupts, overflow, ticks, to find my way and the possible solution
    the forum is crammed full of examples

    search "blinky" to see some relevant ideas

    perhaps if you provide more detailed information about what you are trying to achieve preferably with some examples of the code that you have tried , more help would be offered.
    as it stands your goal is a mystery and worse still the goalposts seem to keep moving . speculation wastes everyone time and patience.
    (I'm thinking now that an electronically variable gearbox might be your target , if so this approach is not going to work) but that's just speculation

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: different software times, impossible?

    anyway the pwm (the only way to have two pulses on different ports of a pic at the same time) it's not good for me cause i work with stepper motors and i have to define closed number of steps, not frequencies. Cause i must define fix numbers, not number of pulses for second. I can't tell the pic to count until 9600 on a port and to count until 120000 on another port at the same time (the quartz of course) its impossible.

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: different software times, impossible?

    from what you have described so far, it may be easier than it seems to implement this..... maybe.
    1, you have to use timer interrupt at 50micro seconds..... the highest common value for both times
    2, you implement a while/wend loop with block of code for main X....hi/low and total run ... and block of code for Y .... with values you calculated
    3, using counters in blocks to toggle pins and exit while when pulses/count are reached
    4, outside of while blocks to get/calculate new Y's.... do other stuff then startup a new round of pulses
    5, the constraint is all the code inside blocks have to be less than 50micro seconds..... at 20 MHZ should able to do about 100 to 200 instructions in 50micro seconds

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: different software times, impossible?

    thank you amgen, i have to work with the timers for generate the correct number of pulses for two ports with the lowest possible latency.

Similar Threads

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