Arduino Uno code explanation

6 años 7 meses antes #993 por owenk04
Hello,

I just build the shield and tried the code source on my arduino and everything seems to works fine :)

I just wanted some explanation of the arduino code, especially the ISR part.
Indeed, i guessed that interrupt only occur when there is a trigger on the Pin ICP1, or when the ACSR registrer is correctly configured to be triggered via the analog comparator, but there is nothing wired to the ICP1 and the ACSR is not configured, so ... how this ISR is triggered ?

Maybe I missed something in the registers configuration ?

Thanks for your help in understanding this :)

Por favor, Identificarse para unirse a la conversación.

6 años 7 meses antes - 6 años 7 meses antes #996 por Ray
Respuesta de Ray sobre el tema Arduino Uno code explanation

Rendering Error in layout Message/Item: array_keys(): Argument #1 ($array) must be of type array, null given. Please enable debug mode for more information.

Por favor, Identificarse para unirse a la conversación.

6 años 7 meses antes #999 por owenk04
Respuesta de owenk04 sobre el tema Arduino Uno code explanation
Thanks for your reply, I dug a lot in the atmel datasheet, and I finally understand that "TIMER1_CAPT_vect" interrupt vector is launch when the ICF Flag is set, but the ICF is not only driven by the ICP1 pin, but also by the counter 1 : ICF Flag is set when the counter reaches the TOP value due to the current WGM1 configuration (ICR1 as top value).

So I fully understand this sketch now, thanks !
El siguiente usuario dijo gracias: Ray

Por favor, Identificarse para unirse a la conversación.

Tiempo de carga de la página: 0.052 segundos