sinusoidal PWM


Closed Thread
Results 1 to 40 of 84

Thread: sinusoidal PWM

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: sinusoidal PWM

    Hi Henrik! As always, great post!
    I've done some work with DT_INTS, and in ASM mode, they are fairly fast, as they only copy a few registers, vs the PBP type, which copies then restores about 70 registers with each interrupt. So I don't understand your warning about going above 4 Mhz? I've run it at 40 Mhz on a different chip and it worked pretty well using ASM type DT_INTS.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default Re: sinusoidal PWM

    Hi,
    I missed the fact that the interrupt was declared as ASM. In that case, as you say, there's not that much overhead but it's also risky business since the actual handler IS written in PBP - if you don't know what you're doing here you're likely to run into trouble.

    And, with the above in mind, perhaps adding the "extra" reload code for accuracy isn't a good idea (and not needed since there's much less overhead) since it might use some PBP system variables and then the whole thing is a mess.

    I wasn't trying to say that it couldn't run at a higher oscillator speed than 4Mhz. I was trying to say that I don't think it'll be able to interrupt much faster when running AT 4Mhz, in fact that IS what I said ;-) But that was before you enlightned me of the fact that he has the ISR declared as ASM.

    bwaxing,
    You do realise the difference of declaring the interrupt as type ASM as oppesed to type PBP and what impact it might have on your code if you declare it as ASM but write the handler in PBP?

    /Henrik.

Members who have read this thread : 1

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