I happened to an issue. I used the ADC interrupt in my 9S12Xep100 CPU. I disable the ADC interrupt in the course of running. Because the main loop and the ADC interrupt function will access a same varible, so in the main loop, before accessing the variable, I must disable the ADC interrupt. I can see that sometime the ADC interrupt is disabled indeed. The result is that sometime the program will collapse. I don't know why. Can someone answer my question? Thanks.
I don't disable all interrupts. I just disable the ADC interrupt, and not all the time, just when the main loop access the virable which the ADC interrupt also access.
I asked you disable all interrupt to verify if the problem is caused by other interrupt. Thus we can narrow download the trouble shooting to the right track.