GPAGE question

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,347件の閲覧回数
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 解決策
957件の閲覧回数
crane
Contributor III

Found explanation in datapage.c

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
958件の閲覧回数
crane
Contributor III

Found explanation in datapage.c

0 件の賞賛
返信