SBC_DRIVER READ REGISTER.

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

SBC_DRIVER READ REGISTER.

831 次查看
franklin08
Contributor I

 I succeeded in running the example program given in the SBC driver that reads the SBC_FS26_FS_STATES_ADDR register. However, I tried to read SBC_FS26_M_REG_FLG_ADDR register that flags over current event for the converters, LDOS' and TRKS' using the below code but I keep getting FALSE. I had expected u16ReadData variable to give 0x0000, instead it gives 1101001001101111 from the expression tab. Please is there something wrong with my code? 

 

eReturnValue |= Sbc_fs26_ReadRegister(TRUE,SBC_FS26_M_REG_MSK_ADDR , &rxData);


if((eReturnValue != E_OK) || (rxData.u16ReadData != SBC_FS26_M_REG_MSK_DEFAULT ))
{
bPass = FALSE; 

 


}

0 项奖励
回复
1 回复

781 次查看
TomasVaverka
NXP TechSupport
NXP TechSupport

Hello,

The value you shared does not make sense at all.

If you have a logic analyzer, could you please share the SPI traffic illustrating the read of the M_REG_FLG?

What is the value of the eReturnValue before reading the M_REG_FLG register?

I suppose you should use either:

eReturnValue = 0;

eReturnValue |= Sbc_fs26_ReadRegister(TRUE,SBC_FS26_M_REG_MSK_ADDR , &rxData);

or:

eReturnValue = Sbc_fs26_ReadRegister(TRUE,SBC_FS26_M_REG_MSK_ADDR , &rxData);

BR, Tomas

 

0 项奖励
回复