infineon4engineers Facebook

infineon@google+ Google+

infineon@linkedin linkedin

infineon4engi@twitter twitter

infineon@youtube youtube

+ Reply to Thread
Results 1 to 6 of 6

Thread: XMC very slow interrupts

  1. #1
    enigmaldc
    Guest

    XMC very slow interrupts

    Hi All,

    I have now made many tests with the PWM and digital input to exhort influence on the PWM output.

    My findings so far,
    1) Directly connecting inputs to the PWM and making use of either external start, stop etc. has the fastest time to response on the PWM output. To start around 100ns, to stop, around 50ns. This is good.
    2) Using TRAP PWM, I get around 50ns, as the fastest time to response on PWM output. This is good.
    3) Using an input together with a event detection and event generation followed by an intterupt, the best you can get is around 1.3us as the fastest time to response on the PWM output. Here I have used direct register control within the interrupt to switch off the PWM. This is bad.

    What fails so far for me is that if I would like to use multiple digital inputs, I am forced to either use a maximum of 3 (direct to PWM) or I have to accept that I will be slowed down by using interrupts.

    Is there any way in which I can increase the response time using interrupts in the XMC micro-controller? The clock is supposed to run at 32MHz, how is it that I have to wait for 1.3us before the cpu does what I want it to do via an interrupt?I have attached code for demonstrating point (3).

    Regards
    Enigma

  2. #2
    Beginner Beginner smays will become famous soon enough
    Join Date
    Dec 2015
    Posts
    34
    Points
    56.171875
    To what level do you have optimization set? Have you checked the disassembly listing to see how those two 'direct' lines are interpreted?

  3. #3
    enigmaldc
    Guest
    Hi smays,

    I have set the optimization to "Optimize most (-O3)", this is what has been suggested in the past. I did not through the assembly instructions, since I do not have a method to write directly in assembly for this microprocessor and since I am working with direct register control, I can not see which commands would lead me to faster response times. Do you see my dilemma?

    Regards
    Enigma

  4. #4
    Olli_K
    Guest
    Hi,

    i think, that the 1,3µs response time is due to the Interrupt latency of 21 MCLK cycles. (See Reference Manual Chapter 5.1.7)

    Click image for larger version

Name:	Unbenannt.PNG
Views:	6
Size:	33.2 KB
ID:	1990

    Maybe you can improve the response time, if you execute the Interrupt from SRAM instead from Flash (because of the wait states).

    Best regards
    Olli

  5. #5
    enigmaldc
    Guest
    Hi Olli,

    Thanks for the reply, it was useful. I will have to give your idea a try.

    Regards
    Enigma

  6. #6
    Beginner Beginner smays will become famous soon enough
    Join Date
    Dec 2015
    Posts
    34
    Points
    56.171875
    Even though I have not had an opportunity to try it, apparently one simply adds to the end of the function prototype:
    Code:
    __attribute__ ((section (".ram_code")))
    Code:
    void VADC0_C0_1_IRQHandler(void)
    {
          Current_LoopHandler();
    }
    void Current_LoopHandler(void) __attribute__ ((section (".ram_code")))
    {
           // Implement control loop, etc…
    }
    In my example, the function Current_LoopHandler(void) should be run out of RAM.

+ Reply to Thread

Tags for this Thread

Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.