在线时间0 小时
UID3466355
注册时间2018-8-1
NXP金币0
该用户从未签到
新手上路

- 积分
- 7
- 最后登录
- 2018-8-2
|
正在做飞思卡尔胎压的方案,目前遇到一些困难。希望大家能够一起讨论,或者做过的大牛帮一下忙。
在采集加速度和气压、温度的时候要注意哪些问题- void Measure_P_T_V_AccZ(void)
- {
- UINT8 u8ZIndex;
-
- /* Enable Bandgap - required for V and T measurements */
- SPMSC1_BGBE = SET;
-
- delay(200);
-
- u8StatusAcq=0;
-
- /****Initial measurements for compensation ***/
- u8StatusAcq |= TPMS_READ_VOLTAGE(gu16UUMA);
- u8StatusAcq |= TPMS_READ_TEMPERATURE(gu16UUMA);
- /****Pressure data acquisition ***/
- u8StatusAcq |= TPMS_READ_PRESSURE(gu16UUMA, 4u);
- u8StatusAcq |= TPMS_COMP_PRESSURE(&u16CompPressure, gu16UUMA);
- gu8CompPressure = (UINT8)(u16CompPressure>>1);
- /****Temperature data acquisition ***/
- u8StatusAcq |= TPMS_COMP_TEMPERATURE(&gu8CompTemp, gu16UUMA);
- /****Voltage data acquisition ***/
- u8StatusAcq |= TPMS_COMP_VOLTAGE(&gu8CompVolt, gu16UUMA);
-
- /* gu8Derivative is owned by DAL. It allows us to differentiate between */
- /* a one-axis and a two-axis product. Here, we use that info to make */
- /* a smart decision of whether to read the X-axis or not. */
- if(TWO_AXIS_DERIVATIVE_INDEX == gu8Derivative)
- {
- u8StatusAcq|=TPMS_READ_ACCEL_X(gu16UUMA, 1u, CLEAR, 7u);
- u8StatusAcq|=TPMS_COMP_ACCEL_X((UINT16*)&u16CompAccelX, gu16UUMA);
- gu8CompX = (UINT8)(u16CompAccelX>>1);
-
- u8ZIndex = ((UINT8)6u);
- }
- else
- {
- u8ZIndex = ((UINT8)6u);
- }
-
- /* No matter the derivative, always take Z-axis readings */
- u8StatusAcq |= TPMS_READ_ACCEL_Z(gu16UUMA, 1u, CLEAR, u8ZIndex);
- u8StatusAcq |= TPMS_COMP_ACCEL_Z((UINT16*)&u16CompAccelZ, gu16UUMA);
- gu8CompZ = (UINT8)(u16CompAccelZ>>1);
-
- /* Disable bandgap - allows us to save some power */
- SPMSC1_BGBE = CLEAR;
-
- return;
- }
复制代码 这样获取的时候,得到的值不太准确,希望各位多多指点。
最佳答案
需要签NDA(保密协议)的器件的问题讨论,请小窗联系原厂和代理商。
不适合公开讨论。
|
|