LarryBud
LarryBud

Reputation: 1071

AVR Interrupts, Setting port values while in the interrupt

I'm using a tiny2313 microcontroller in AVR assembly. I have an external interrupt controlled by a momentary switch. The interrupt is working correctly, and jumps to the routine when the button is pressed.

However, I want to set a bit ON in port D while "in" the interrupt routine (an LED indicator) and then turn it off when exiting the routine.

All "seems" to be working, but the pin never goes high. I'm guessing that the port won't be updated while in the interrupt, so I set it high, do some stuff (which takes a few seconds) then set it low, and nothing seems to happen.

I tried finding some documentation to confirm this is the issue but don't see anything. Am I on the right road, and if so, is there a workaround for this?

Upvotes: 0

Views: 259

Answers (1)

LarryBud
LarryBud

Reputation: 1071

Looks like it was a hardware issue. The interrupt pin was being shorted accidentally by a bad switch which was causing all sort of other issues.

Upvotes: 1

Related Questions