Thanks Joe! :)
You are right, you "can only" put ulong numbers(written in the
reference) into __delay_cycles(), but if you write in huge numbers,
like 2 million cycles, it still works(and messes up the debugger).
I've tried with some smaller numbers, from ulong numbers, and the
biggest number which let the debugger work right is around 30.... Yes,
30 cycles... it's a shame... it can be a compiler optimisation-CCS
related bug. I've updated to CCS 4.2.4, the problem still there.
I've made a code to test the uC's memory to see if it's corrupting the
variables, or not.
int main()
{
WDTCTL = WDTPW + WDTHOLD;
P1DIR |= 0x1;
P1OUT &= ~0x1;
char str[]="1010";
char a[]="0";
char b[]="0";
char c[]="0";
char d[]="0";
for(;;)
{
__delay_cycles(500000);
a[0]=str[0];
b[0]=str[1];
c[0]=str[2];
d[0]=str[3];
if(a[0]=='1'&&b[0]=='0'&&c[0]=='1'&&d[0]=='0')
{
P1OUT |= 0x1;
}
__delay_cycles(500000);
P1OUT &= ~0x1;
}
return 0;
}
Yes, I know it's still not rocket science... :D But the red LED
happily blinks, shows my variables are correct! :)
CCS debug still bad...