This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI C/C++ Compiler
I tried to test the TSET instruction using the following code. I do not see VarA being changed at all. Can someone please help?
Thanks,
Dhammika
-----------------
Uint16 VarA, VarB;
int main(void)
{
asm(" NOP ");
asm(" TSET @_VarA,#4 ");
asm(" SB $10,NTC ");
asm(" TSET @_VarB,#6 ");
asm(" SB $20,UNC ");
asm("$10: ");
asm(" TCLR @_VarB,#6 ");
asm(" NOP ");
asm("$20: ");
return 0;
}
Hi Dhammika,
Can you check the value of VarA before execution of TSET instruction and after execution of TSET instruction in CCS watch window?
Regards,
Vivek Singh
Dhammika,
You have not set the data page pointer. You are using direct addressing to access variables so you will need to add this before the TSET instruction for VarA:
asm(" MOVW DP, #_VarA");
If VarB is on a different data page, you will need to precede those TSET & TCLR operations with a similar instruction.
Regards,
Richard