Disable interrupt will lead to program Collapse?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Disable interrupt will lead to program Collapse?

714 Views
赵子成
Contributor IV

Hi, All

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.

4 Replies

473 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

How it works if you disable all interrupt?

Best Regards,

Jennie Zhang

473 Views
赵子成
Contributor IV

Hi, Jennie

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.

For example:

MAIN LOOP:

Disable ADC interrupt

Access a certain virable

Enable  ADC interrupt

ADC interrupt:

Access a certain same virable of Main LOOP.

0 Kudos

473 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

I understood your procedure.

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.

Jennie Zhang

0 Kudos

473 Views
Ben
Senior Contributor I

Hi

I've never used the S12, but try to run the program not in debug mode without the programmer, and see if it happens.

I faced such problems with other chips, and the blame was the programming pod I used.

Ben

0 Kudos