Hello!
I'm using FXLC95000 and several sensors with ISF1 (CodeWarrior) and customised example project AccelMag_Project. Everything works perfect. In my source I make setup of settings for accelerometer:
isf_status_t app_fxlc95000_int(void)
{
isf_status_t status;
gFxcl95000AccelProxy.regConfig.ctrl.reg = 0;
gFxcl95000AccelProxy.regConfig.settings.nSettingsToUse = SM_GIVEN_SETTINGS;
gFxcl95000AccelProxy.regConfig.settings.nFifoDepth = 1;
gFxcl95000AccelProxy.regConfig.settings.nCurrentReportRate = 10000;
gFxcl95000AccelProxy.regConfig.settings.nCurrentResolution = AFE_ACCEL_RESOLUTION_16_BIT;
gFxcl95000AccelProxy.regConfig.settings.nRange = AFE_ACCEL_G_RANGE_8G;
status = (isf_status_t)_lwsem_create(&gFxcl95000AccelProxy.lock, 1);
return status;
}
And it works! But now I have issue to change some settings from my MCU host during my device is working. For example I want to set nRange = AFE_ACCEL_G_RANGE_2G.
I send command to FXLC95000:
0x02 (APP_ID_FXLC95000_ACCEL) 0x02 (CI_CMD_WRITE_CONFIG) 0x08 (FXLC95000_ACCEL_APP_RANGE) 0x01 (count of bytes) 0x40 (AFE_ACCEL_G_RANGE_2G)
Than I get answer
0x02 0x80
As I understand It meens that everything is OK!
Then I try to read settings with command:
0x02 (APP_ID_FXLC95000_ACCEL) 0x01 (CI_CMD_READ_CONFIG) 0x00 (offset) 0x0A (count of bytes)
and I get answer:
0x02 0x80 0x0A 0x0A 0x03 0x02 0x01 0x00 0x00 0x27 0x10 0x00 0x40 0x00
As I understand there are my new settings inside FXLC95000.
But then I read data from accelerometer I still get data with range AFE_ACCEL_G_RANGE_8G!!!!! So new settings of nRange doesn't have effect!!!
My question is:
How to change any settings during sensor is working and get effect immediately? Maybe I should send some special command to work with new settings?
已解决! 转到解答。
Hi Vitaliy,
I tried to reproduce your settings and noticed the following behavior.
I succesfully changed g-range to +/-2g before actually starting the measurement, i.e. before sending the 0x02 0x02 0x00 0x01 0x0F command (which subscribes sensor + starts data).
Then I couldn't revert to the +/-8g range, unless I send a "stop+unsubscribe" command before:
0x02 0x02 0x00 0x01 0x00
0x02 0x02 0x08 0x01 0xC0
Did you already tried such sequence ?
I'm going to quickly check the documentation to confirmm restrictions or specific conditions when to change to Accelerometer settings (as it looks like the sensor has to be unsubscribed for that) and will let you know soon.
Regards, Jacques.
Hi Vitaliy,
I tried to reproduce your settings and noticed the following behavior.
I succesfully changed g-range to +/-2g before actually starting the measurement, i.e. before sending the 0x02 0x02 0x00 0x01 0x0F command (which subscribes sensor + starts data).
Then I couldn't revert to the +/-8g range, unless I send a "stop+unsubscribe" command before:
0x02 0x02 0x00 0x01 0x00
0x02 0x02 0x08 0x01 0xC0
Did you already tried such sequence ?
I'm going to quickly check the documentation to confirmm restrictions or specific conditions when to change to Accelerometer settings (as it looks like the sensor has to be unsubscribed for that) and will let you know soon.
Regards, Jacques.
Hello Jacques!
I didn't try sequence "stop+unsubscribe" - "start+subscribe". You know, maybe you are right. It's a good idea. I will try it tomorrow. But if you find some more information about that in documantation I will be glad to read you adviсe. )))
Regards, Vitaliy.