Topic : Warning: external interrupts and AT89C5131 !!!

Forum : 8051

Original Post
Post Information Post
April 22, 2011 - 4:25pm
Guest

who the heck had the idea of renaming the interrupt-enable-registers from IEN0 / IEN1 to IE0 / IE1
and renaming the external flags from IE0 / IE1 to IE0_ / IE1_ ??????

What happens: interrupt-enable is done by setting the bits in IEN0 with their names EX0, EA and so on. When dealing with 0-level-sensitive external interrupts, you have to clear the flag manually. So the code (which worked perfectly on the AT89C51RC2 that i'm also using) looks like this:

init(){
EX0 = 1;
IT0 = 0;
EA = 1;
}
Ex0_ISR(){
do_something();
IE0 = 0; // clear the flag
}

so, what happens is, that the compiler does recognize IE0 (so no warning concerning IE0_) and the enable-register is set to zeros => end of all interrupts.....

Please change the at89c5131.h-file (and other, where this was done) for the next releases. I manually changed the h-file (IE0 an IE0_ both point to the flag, IEN0 is the register), but others might stuble over this issue also.

regards
Bernhard

Replies
Post Information Post
+1
0
-1
April 26, 2011 - 2:40pm
Raisonance Support Team

Hi,

Thanks for this report.
We corrected our header files to match this modification, and the fix will be available in the next RKit-51 release (due in few weeks).

Best Regards,