Is it possible to trigger CAPT_vect and COMP_vect interrupts with TIMER1 in the same code?
I have an idea of triggering ISR(TIMER1_CAPTA_vect) every time my Arduino identifies one spike in pin8 and store this value of ICR1 inside an array.
Then, after getting this value I need to add a number to it coming from the serial communication between a Python program and Arduino and assign this sum to OCR1A.
After OCR1A is reached, I call ISR(TIMER1_COMPA_vect) to generate a squared pulse of 60us.
1-can I adjust a register inside an ISR function or I must do all the setting on setup()?
2- After my OCR1A is reached, to have my pulse width, can I update OCR1A value inside ISR(...COMPA..) and keep in it until the width is done?
3-In order to trigger ISR(...COMPA...) , can I set OCR1A values inside ISR(...CAPTA...)?