zhangyimb zhangyimb

How to set XGISP31 and XGISP74

Discussion created by zhangyimb zhangyimb on Nov 8, 2011
Latest reply on Nov 10, 2011 by zhangyimb zhangyimb

   In document MC9S12XEP100, I learned when initial XGATE ,I must initial XGISP31, XGISP74, and XGVBR registers. About  XGISP31 and  XGISP74, I don't understand if I must allocate two stacks for each channel thread? like that

      

//in .prm file

SEGMENTS
STACKRAM31  =READ_WRITE   0x3FC0 TO 0x3FDF ALIGN 2[1;1];
STACKRAM74  = READ_WRITE  0x3FE0 TO 0x3FFF ALIGN 2[1;1];

END

PLACEMENT
STACK31 INTO STACKRAM31;
STACK74 INTO STACKRAM74;

END
//in .c file
#pragma DATA_SEG STACK31
byte stackPoint31[32];
#pragma DATA_SEG STACK74
byte stackPoint74[32];

 

XGISPSEL=0x01;
XGISP31=(word)&stackPoint31;
XGISPSEL=0x02;
XGISP74=(word)&stackPoint74;
XGISPSEL=0x00;
XGVBR= (unsigned int)(void*__far)(XGATE_VectorTable - XGATE_VECTOR_OFFSET);

 

I understand, right?

Outcomes