DT Instant Interrupts


Closed Thread
Results 1 to 39 of 39

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    Hi Darrel,
    could you please explain DutyVars(LoopCount) = 50 ; 50% (0-100), I understand the counter loop but do not understand the operation here. Thank You
    JS
    Anybody ???
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    Anybody ???
    Nothing more than an index'd variable.

    DutyVars(LoopCount) = 50

    (not code below...)
    If loopcount = 1 then the following two lines are equivalent

    -DutyVars(1) = 50

    -loopcount = 1 : DutyVars(loopcount) = 50

    At least I think that's what you were asking about.
    If that's what you were asking, the book explanation is in Chapter 4.5 of the manual...if not...whoops! My bad

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    OK, so dutyvars is an array holding the changing value loopcount and that = 50 ? This really is Fuzzy . . .
    Code:
     label VAR size[number of elements]
    label = DutyVar
    size = Loopcount
    what does = 50 do exactly?
    Does it give you a 16 byte array all having the value of 50?
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4
    Join Date
    Sep 2007
    Posts
    50


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    what does = 50 do exactly?
    Does it give you a 16 byte array all having the value of 50?

    Hi Joe,

    50 would be the duty cycle of the PWM. In this example the SPWM_INT duty cycle was setup to be 0 - 100 so 50 would be roughly 50% at 100 Hz. See Below

    DEFINE SPWM_FREQ 100 ; SPWM Frequency = 100 Hz
    DEFINE SPWM_RES 101 ; SPWM Resolution = 0-100
    Best Regards,

    Kurt A. Kroh
    KrohTech

    “Goodbye and thanks for all the fish”

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by krohtech View Post
    Hi Joe,

    50 would be the duty cycle of the PWM. In this example the SPWM_INT duty cycle was setup to be 0 - 100 so 50 would be roughly 50% at 100 Hz. See Below
    Hi Kurt,
    I understood what the 50 stands for, but not what the array does or how it does it, does it set all PWM outputs to 50 % ? I am thinking that is what it does.
    Thanks
    JS
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6
    Join Date
    Sep 2007
    Posts
    50


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    Hi Kurt,
    I understood what the 50 stands for, but not what the array does or how it does it, does it set all PWM outputs to 50 % ? I am thinking that is what it does.
    Thanks
    JS
    Hi Joe,

    Yse in this example it does set all 16 channels to 50.
    Best Regards,

    Kurt A. Kroh
    KrohTech

    “Goodbye and thanks for all the fish”

  7. #7
    Join Date
    Feb 2008
    Location
    Michigan, USA
    Posts
    231


    Did you find this post helpful? Yes | No

    Default Why res of 101?

    Hi Kurt, (and all)

    In post #10, you mentioned that you used a different PWM resolution of 101 instead of 100. Can you expand on that a bit? I'm working on something similar and would like to understand why that helps.


    "here is my current code, changed to 101 PWM resolution to reduce overhead"

    Thanks
    Mark

Similar Threads

  1. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 20:02
  2. DT Instant Interrupts help
    By perides in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 26th November 2008, 18:41
  3. 12F683 and DT Instant Interrupts
    By jderson in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 22nd November 2008, 12:47
  4. 18F1220 and DT Instant Interrupts
    By jderson in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th June 2008, 05:37
  5. Replies: 1
    Last Post: - 1st November 2006, 03: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