Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Location
    DFW area of Texas
    Posts
    24


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited


    My code had
    INT_Create
    instead of
    INT_CREATE
    I suppose I should wear my glasses more often.
    DTaylor's instant interrupt works great now in my application.
    thanks for your patience,
    -ray
    "Imagination is more important than knowledge", Albert.E.

  2. #2
    Join Date
    Aug 2011
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Sorry if I'm in the wrong thread but this is the only one that came up when I searched for PWPS.

    This question is for Darrel, but if anyone else can answer I would appreciate the response just as much.

    The PWPS servo code is almost ideal for what I need........I only want 0.5us resolution instead of 1us. Am I able to get 0.5us resolution by simply defining my code to use an 8 MHz OSC and then changing the 4 value in the code snippet below to 8?

    GetOsc: ' Retreive defined OSC value on Reset
    asm
    ifdef OSC
    MOVE?CB OSC, _PicOSC
    else
    MOVE?CB 4, _PicOSC
    endif
    endasm

    Sorry if my terminology isn't 100% correct....I'm a bit of a NOOB to picbasic.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    DEFINE OSC 8 will do but also alter everything based on timing such as HSEROUT/HSERIN/PAUSE etc etc.

    OSC is always defined anyways, even if you don't type the DEFINE OSC line. If you don't type the DEFINE OSC, PBP assume 4MHz.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Yes, use DEFINE OSC 8 just like you always should.
    But if you change PicOSC, it will change all parts of PWPS including the 50Hz pulse frequency.

    If you only want to change the resolution, you can modify one line in the .inc file ...

    ; W1 = TicksPeruSx100 * Position ; original line
    W1 = TicksPeruSx100 * Position / 2

    Then instead of 0-900, the position variable will be 0 - 1800

    1uS resolution (0.1 degrees) was already better than the maximum performance of hobby servo motors.
    A resolution of 0.5uS will not have any affect if that's what you are doing.
    DT

  5. #5
    Join Date
    Aug 2011
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Thank you for the quick reply.

    I'm actually working with an ESC that has 11 bit resolution so that is why I was looking for 0.5us steps. I'm not sure how much difference it will make but I wanted to try it out anyway.

    I really appreciate the help!

  6. #6
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Really? Who makes the ESC? On the other hand, I doubt you will notice a difference, but hey go for it!!
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  7. #7
    Join Date
    Aug 2011
    Posts
    8


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Quote Originally Posted by cncmachineguy View Post
    Really? Who makes the ESC? On the other hand, I doubt you will notice a difference, but hey go for it!!
    It is a Castle Creations ESC........when I spoke to one of their engineers they said all of their ESCs have 2048+ speed steps. I know I can get away with the 8 bit resolution of a standard ESC......but as an engineer I need to get the best (i.e. overkill!) solution!

Similar Threads

  1. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 22:43
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 21:02
  3. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 21:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 07:32
  5. Replies: 1
    Last Post: - 1st November 2006, 04:11

Members who have read this thread : 6

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

Tags for this Thread

Posting Permissions

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