Stack Push Control for ISR

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by JoshSherman on Tue Jul 12 10:56:48 MST 2011
I am currently writing a time dependent routine wherein my code is watching a 32 bit timer capture input and measuring pulse values up to 500KHz. Everything works properly at  48MHz processor speed but this is a little higher than the desired clock speed for the application. I have optimized my capture interrupt so that it takes very little time, but I can see that my stack pointer changes by a value of 28 from my main loop to the interrupt routine and back. My interrupt certainly doesn't need all of those values pushed onto the stack just so they can be popped back off when my tiny interrupt is over. How can I control what is put onto the stack (and what is not) when my ISR is activated by my capture input?