GPAGE question

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

GPAGE question

跳至解决方案
1,350 次查看
crane
Contributor III

Hi,

 

I'm trying to migrate some code from S12C to S12XDT256. I have a memory read function that  takes a pointer to far pointer as argument, loads a and transmits a series of CAN messages with four bytes of data together with the address of the first byte in each message.

 

 

// Read consecutive bytes from memory on same pagestatic void ReadMem( dword *far *ppFarAddress, word len ){  _CANSTR CanTxMsg;  CanTxMsg.Byte.Idr0 = READ_MEM_ECHO_MSG;    while (len != 0)  {    *(dword *far *)&CanTxMsg.Array[CAN_DB0] = *ppFarAddress;  // copy address    *(dword *)&CanTxMsg.Array[CAN_DB3] = **ppFarAddress;      // copy 4 bytes data    if (len > 3)    // full msg?    {      CanTxMsg.Byte.Dlc.U8 = 7;      len -= 4;     // remaining bytes      *ppFarAddress += 1;         // point to next address    }    else                          // last msg   {     CanTxMsg.Byte.Dlc.U8 = len + 3;     len = 0;     // done   }   CanSendMsg( &CanTxMsg );   KickDog();   DelayXus(8000);    // 8 ms intermission between transmissions.  }}

 

Problem:

This code works fine in the S12C, but in S12XDT256, I can see from the assembly listing that GPAGE gets involved, which as far as I can tell is read only in bit 7. Anyways the messages are not transmitting the expected data, but the address reads ok. Guess I don't understand the concept of GPAGE.

 

Any help appreciated, thanks.

 

Håkan

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
960 次查看
crane
Contributor III

Found explanation in datapage.c

在原帖中查看解决方案

0 项奖励
回复
1 回复
961 次查看
crane
Contributor III

Found explanation in datapage.c

0 项奖励
回复