I'm witnessing something odd and was wondering if I'm doing something incorrectly. I'm just trying to blink an LED at some rate for debug on my board. I'm new to MSP430's compiler. So in debug mode I step through this snippet of code:
Really? I use that intrinsic function a lot. The "thousand" value is a constant, right?
Let me simulate it and I'll get back...
<added>
Wow! That's wierd. I get the same thing. If I change the variable name to "x" it works. Also, using variable "j", if I "single step" through the assembler code it increments correctly from 0x0F to 0x10. This might be worth reporting to TI...
<added>
Wait! Just changed the variable name back to "j" and now it's working. I'm using CCS (Code Composer Studio) v4.2.4.00033 and now I'm wondering if it isn't a bug in the simulator???
Assuming you are initializing j to 0 or 1 before this loop.
Full Code? Did you disable the watchdog timer? You'll see on all MSP430 code a small bit of code to either turn off or properly setup the watchdog timer.
ugh. somehow I put the disable WDT in one of my functions instead of ontop of main. I feel like a box of hammers. thx for the help though I should have figured that out myself.....works great now hahah. Makes me want to kick the dog....
ugh. somehow I put the disable WDT in one of my functions instead of ontop of main. I feel like a box of hammers. thx for the help though I should have figured that out myself.....works great now hahah. Makes me want to kick the dog....
Darn, I'm embarrassed too. I had simply added your code into an existing program, compiled, then moved the program counter to a "j = 0" instruction. So I pretty much skipped the instructions to disable the WDT too. Sorry!!!