Hanghae 0 Posted October 18, 2015 Share Posted October 18, 2015 I am learning MSP430 programming with the tutorial at http://mspsci.blogspot.com/2010/07/tutorial-01-getting-started.html. I had trouble getting one of the first interrupt-driven programs to work, so I debugged it by adding a write to a RAM location to the interrupt service routine. Then I could see (by printing out that location with mspdebug) whether the ISR was ever entered. Indeed, the reason that program did not seem to run at all was precisely that the ISR was not entered. Now I have progressed to CMeterG2211.c and wanted to use the same trick (if it can be called that). There are three ISR's and, correspondingly, I added three global variables at the start of the C file, like this: unsigned char mark1 = 0; unsigned char mark2 = 0; unsigned char mark3 = 0; I also added something like this mark1++; at the start of each ISR. Now, the program worked almost out of the box, and there has been no particular need to debug it. However, out of curiosity, I checked the markx variables after a successful run and found them all to be 0 (zero). How can that be? The fact that the program runs OK must indicate that all the ISR's are entered at least once, so how can the variables still be zero? Quote Link to post Share on other sites
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.