Hi,
Thanks for reply. I do want to modify that array of char not to
prevent changing them. Basicaly each time interrupt occurs it should
read the array and output values, and I will change values often. I
know delay inside interrupt is not a good tactic but I just didn't
have time to compute the right low-to-high transaction time in CPU
clocks to match the 74hc161 4-bit counter logical diagaram I clock
from interrupt; hence I used a delay. I don't think this really
completely stops execution of the program so the value never change.
Cornel
----- Original Message ----
From: Philipp Burch <address@hidden>
To: address@hidden
Sent: Tuesday, January 15, 2008 8:24:17 PM
Subject: Re: [avr-gcc-list] altering array variable and interrupts
Hi,
I guess, your ISR takes too long. Delayloops in ISRs are very, very bad
style, because they block the whole CPU. I suppose, the Interrupt comes
more often than every 3ms, so there is no way for the AVR to execute any
code outside the ISR. You should rewrite the complete program, there are
many unnecessary things, such as character generation at runtime. Just
declare a PROGMEM array with all your digits and read from it with
pgm_read_byte() (From avr/pgmspace.h, check the manual of avr-libc),
that saves RAM and initialization work. And it prevents the characters
from getting modified (Or do you really need this "feature"?).
Philipp
> sorry I forgot to put url: http://rafb.net/p/fxrljj42.html
>
>