1

I'm creating a LCD frequency generator.

When TIMER1 reaches a set value, it's set to toggle Pin 9 (via OC1A).

Accidentally, I left the TIMER1 "interrupt on compare match A" enabled, but never defined the TIMER1_COMPA_vect interrupt vector.

This made the Uno reset itself - but not running through the bootloader, just the program part - whenever TIMER1_COMPA_vect would've been called.

Once I defined the ISR, even without it having any content, it would run as expected.

Is there a default content for ISRs, which resets the device / starts just after the bootloader? Shouldn't the compiler detect a completely missing ISR?

asked Jul 2, 2019 at 11:16

1 Answer 1

3

The compiler cannot detect a missing ISR since it is very difficult, in the general case, to tell whether any particular interrupt-enable bit has been set by the program.

The avr-libc library does indeed provide a "catch-all" ISR and, as stated by the manual,

the default action is to reset the device by jumping to the reset vector.

If you don't like this behavior, you can override this catch-all with your own, as explained in the manual (search for "Catch-all interrupt vector").

answered Jul 2, 2019 at 12:03
1
  • Very interesting, that solves my confusion - thank you. Commented Jul 2, 2019 at 13:13

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.