Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r721bd715bef050760e5c0f79044d1cba642c8354 -rde18b3784a9a5ab48d11cb6ce2c651de390ee0e9 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 721bd715bef050760e5c0f79044d1cba642c8354) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision de18b3784a9a5ab48d11cb6ce2c651de390ee0e9) @@ -102,6 +102,15 @@ #define FPGA_READ_V3_START_BYTE_NUM 256 ///< FPGA V3 read sensors start byte number. #define FPGA_READ_V3_END_BYTE_NUM 430 ///< FPGA V3 read sensors end byte number. +/* + * NOTE: in MS5839-02BA manufacturing information as well as the CRC of the mfg information is stored in the manufacturing register. + * 1. Bits 0..4 are the mfg information + * 2. Bits 5..11 are the version (not used) + * 3. Bits 12..15 are the CRC + */ +#define FPGA_BARO_SENSOR_MFG_INFO_BITS 0x001F ///< FPGA baro sensor manufacturing information first 4 bits. +#define FPGA_BARO_SENSOR_CRC_BITS 0xF000 ///< FPGA baro sensor CRC 4 bits. + /// FPGA size of V3 read bytes. #define FPGA_SIZE_OF_V3_READ_BYTES ( FPGA_READ_V3_END_BYTE_NUM - FPGA_READ_V3_START_BYTE_NUM ) @@ -236,7 +245,7 @@ U16 fpgaBaroPROMCoeff4; ///< Reg 444. Barometric sensor PROM coefficient 4 U16 fpgaBaroPROMCoeff5; ///< Reg 446. Barometric sensor PROM coefficient 5 U16 fpgaBaroPROMCoeff6; ///< Reg 448. Barometric sensor PROM coefficient 6 - U16 fpgaBaroPROMCRC; ///< Reg 450. Barometric sensor PROM CRC + U16 unused; ///< Reg 450. Unused register U32 fpgaBaroPressure; ///< Reg 452. Barometric sensor pressure value U32 fpgaBaroTemperature; ///< Reg 456. Barometric sensor temperature sensor U08 fpgaTHdRTDReadCount; ///< Reg 460. THD RTD read count @@ -2384,7 +2393,7 @@ *************************************************************************/ U16 getFPGABaroMfgInfo( void ) { - return fpgaSensorReadings.fpgaBaroManufacInfo; + return fpgaSensorReadings.fpgaBaroManufacInfo & FPGA_BARO_SENSOR_MFG_INFO_BITS; } /*********************************************************************//** @@ -2475,7 +2484,7 @@ *************************************************************************/ U16 getFPGABaroCoeffsCRC( void ) { - return fpgaSensorReadings.fpgaBaroPROMCRC; + return fpgaSensorReadings.fpgaBaroManufacInfo & FPGA_BARO_SENSOR_CRC_BITS; } /*********************************************************************//**