Content originally posted in LPCWare by jonotree on Mon Oct 27 09:03:03 MST 2014
Thanks for your replies, and sorry for the lack of response (i've been away).
The code suggestion isn't too dissimilar to what I have now, its especially handy to use a circular buffer. I've settled on just lowering the clock frequency a lot because its not too important in this application.
I know I can just do things in the ISR but am also wanting to keep the isr size to a minumum.
Also, apologies for my ignorance but how do I know that it takes 12 cycles to enter/leave an isr? or probably better, could you point me to the document/chapter - ive tried looking in the user manual briefly just now with no luck.
And would I be right in thinking that I wouldnt be able to work out a 'worst case' number of clock cycles from a given bit of c code, because just from the c itself, you can't really tell how the compilers putting it together?
...and/but therefore to work out how many clock cycles it would take, I could look at the disassembly? (something I haven't really done before but seems like I should try and learn about) .