Code tested on CC1110F32 and CCdebugger + KEIL
Put a breakpoint on line "a++" run one time, and run again...
A this point the code will stopped at address 0xFFFF.
Make one step assembler...Ok, check now the variable "a" the value will be 0xAA.
So, the code stop at the right point of code, but PC become 0xFFFF (xram).
Which bug is this ?
void main( void ) { unsigned char a; SLEEP &= ~0x04; // power down oscillators while( !( SLEEP & 0x40 ) ); // wait for high speed crystal to become stable CLKCON = 0x00; // switch from RC oscillator to high speed crystal oscillator
WDCTL = 0x03; // set 1.92 ms for reset WDCTL |= 0x08; // start watchdog a = 0xAA; a ++;
while ( 1 ) a *= 2; // a *= 2 only to avoid compiler remove it and wait internal reset }