cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with enabling interrupt

us2
Associate II
Posted on June 04, 2003 at 04:39

Problems with enabling interrupt

5 REPLIES 5
us2
Associate II
Posted on June 02, 2003 at 09:02

Hi guys

I have a huge problem with my ST72334 mcu. In short, the problem is that the mcu crashes when I enable interrupt.

I am writing some data to the EEPROM and to insure that the process is not interrupted, I disable the interrupt before I burn. Afterwards, I enable the interrupt again and the mcu crashes. I can see that since it no longer updates my display. Here is the code:

Code:

DisableInterrupts;

EECSR = EECSR | 0x02;

a[0]= 1;

a[1]= 2;

a[2]= 3;

EECSR = EECSR | 0x01;

while (EECSR & 0x02) {}

EnableInterrupts;

The same problem arrises if I try to disable and enable interrupt somewhere else in the program, so I don't think the burning process fails since I get the correct data in the EEPROM.

However, the problem does not occur when I single step through the program in the emulator. When the mcu crashes, I can stop the emulator and then continue and the program runs fine again! Maybe the problem could be related to some timing issues?

Has anyone experienced problems with disabling/enabling interrupts? I don't get why I cannot enable/disable the interrupt as I please.

Someone, please help.

Best Regards,

Ulrich

us2
Associate II
Posted on June 02, 2003 at 10:22

Hi again

I have now worked some more with the problem and I seem to have been able to narrowed it down to being an interrupt pending problem.

If the burning process takes longer that the time between two interrupts, the mcu crashes. If I extend the time between interrupts so it is longer than time it takes to burn the EEPROM everything is fine. It seems like whenever I have a pending interrupt and enable interrupt, the mcu crashes.

Has anyone experienced anything like this?

My work around this problem is to reset the free running counters for timer A and B to buy myself enough time to burn before the next interrupt will occur.

Any comments to that work around or better suggestion? I still hope to get the disable/enable interrupt to work in the normal way.

Best Regards,

Ulrich
efstathioua
Associate II
Posted on June 03, 2003 at 14:54

If you have the watchdog enabled, it is possible that is what is expiring.

efstathioua
Associate II
Posted on June 03, 2003 at 14:56

If you have the watchdog enabled, it is possible that is what is expiring.

us2
Associate II
Posted on June 04, 2003 at 04:39

Hi again

No watchdog enabled.

Regards,

Ulrich