6 Replies Latest reply on Apr 2, 2012 8:57 AM by akinori.minakawa

    AN60630, Guideline #2: Do Not Call Functions from Interrupt Handlers

    akinori.minakawa
              Hello. I have a question about AN60630, Guideline #2. I made three sample projects to evaluate the optimization. They are almost the same. A Counter block generates an interrupt every 500ms. When the interrupt occurs, an output pin connected to LED is toggled. So the LED is expected to blink at 1Hz. The three projects have some differences like below: (1) Fixed-function counter is used, and Counter_ReadStatusRegister is called in interrupt handler. (2) Fixed-function counter is used, and Counter_ReadStatusRegister is called in main function. It is more efficient way according to the application note. (3) UDB counter is used, and Counter_ReadStatusRegister is called in main function. As a result, (1) and (3) work correctly. But (2) doesn't work.(LED doesn't blink at 1Hz) I wonder why (2) doesn't work correctly. Do you have any ideas?