AnsweredAssumed Answered

MPXY8300 REIMS_CHECKSUM_XOR doesn't work properly

Question asked by Nemanja Savic on Jul 14, 2015

Hi all guys,

 

I am working with MPXY8300 TPMS chip. I have very simple example where I make a 11 bytes long packet and transmit it. The last byte of the packet is checksum. I calculate it using already implemented Firmware function REIMS_CHECKSUM_XOR, but I simply don't get correct value. I stepped execution and realized that correct value is indeed at the end of the function stored in Accumulator, but it is not transfered in the memory location.

Here is the main function:

 

void main(void)
{
  /* This code continously transmit TPMS packets of type BERU RDE012 */
  
  UINT8   u8Status;
  UINT16  au16Array1[3];
  UINT16  au16Array2[4];
  UINT16  au16Array3[7];
  UINT8 i;
  volatile UINT8 tmp;
  volatile UINT8 RFRD_data[11];
  
  /* Set up MCU and set STOP mode. */
  __RESET_WATCHDOG();
  vfnSetupMCU();
  vfnSetSTOPMode(4); 
  vfnSetupRFX();                   
    
  PTADD |= BIT3;  // set pin A3 output
  PTAD ^= BIT3;   // A3=1
  
  RFRD_data[0]=0x00;
  RFRD_data[1]=0x01;
  RFRD_data[2]='N';
  RFRD_data[3]='m';
  RFRD_data[4]='v';
  RFRD_data[5]='M';
  
  i=0;
  for (;;)
  { 
    i++;       
    RFRD_data[6]=i;
    RFRD_data[7]=1;
    RFRD_data[8]=1;
    RFRD_data[9]=0xFF;
    RFRD_data[10]=REIMS_CHECKSUM_XOR(&RFRD_data[2], 8, 0);   
    REIMS_RF_WRITE_DATA_REVERSE(12,&RFRD_data[0],0);
    REIMS_RF_SET_TX(0b11011000);   //240 for 14 bytes sent      
  } /* for (;;) */  
} /* main */

 

 

In the line 37 I never get correct checksum value. Volatile qualifier for the array is put recently, even before it didn't work.

 

Any similar issues?

 

Many thanks,

Nemanja Savic

Outcomes