Basic understanding of interrupt
Clint
Posts: 95
Can you·please confirm that if I have an interupt with no prescaler or rate defined in SX/B and my frequency is 50mHz, does that interrupt occur every 5.12us? I have OPTION =·$88.
256/50,000,000 = 0.00000512
Thank you.
256/50,000,000 = 0.00000512
Thank you.
Comments
Using a slower crystal/resonator conserves power consumption while changing the ISR counter will to some degree speed up and find tune the interrupt period.
There are more complex schemes of adjustment, but I omit discussion of those.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ain't gadetry a wonderful thing?
aka G. Herzog [noparse][[/noparse] 黃鶴 ] in Taiwan
I would also like to reduce the power consumption, but I can't risk a miscount on the encoder for this application so dropping the frequency may not be an option.
INTERRUPT NOPRESERVE 195_313
That way, if you change the clock frequency you'll still have the same rate without worrying about recalculating the OPTION register value.