spectro and PT100
Fork of max31865 by
Revision 1:5262db31116a, committed 2017-06-20
- Comitter:
- pascalou1979
- Date:
- Tue Jun 20 12:11:24 2017 +0000
- Parent:
- 0:ae18c7b91185
- Commit message:
- ok
Changed in this revision
MAX31865.cpp | Show annotated file Show diff for this revision Revisions of this file |
MAX31865.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r ae18c7b91185 -r 5262db31116a MAX31865.cpp --- a/MAX31865.cpp Sun Aug 14 05:09:52 2016 +0000 +++ b/MAX31865.cpp Tue Jun 20 12:11:24 2017 +0000 @@ -33,7 +33,7 @@ //#include <SPI.h> #include <MAX31865.h> #include "mbed.h" - +extern Serial serial; /** * The constructor for the MAX31865_RTD class registers the CS pin and * configures it as an output. @@ -99,12 +99,16 @@ /* Store the control bits and the fault threshold limits for reconfiguration purposes. */ + + this->configuration_control_bits = control_bits; this->configuration_low_threshold = low_threshold; this->configuration_high_threshold = high_threshold; /* Perform an initial "reconfiguration." */ + reconfigure( ); + } @@ -115,23 +119,23 @@ */ void MAX31865_RTD::reconfigure( ) { - /* Write the configuration to the MAX31865. */ + nss = 0; // wait_us(100); spi.write( 0x80 ); - spi.write( this->configuration_control_bits ); + /* spi.write( this->configuration_control_bits ); nss = 1; - /* Write the threshold values. */ + nss = 0; - // wait_us(100); + spi.write( 0x83 ); spi.write( ( this->configuration_high_threshold >> 8 ) & 0x00ff ); spi.write( this->configuration_high_threshold & 0x00ff ); spi.write( ( this->configuration_low_threshold >> 8 ) & 0x00ff ); spi.write( this->configuration_low_threshold & 0x00ff ); nss = 1; - + */ }
diff -r ae18c7b91185 -r 5262db31116a MAX31865.h --- a/MAX31865.h Sun Aug 14 05:09:52 2016 +0000 +++ b/MAX31865.h Tue Jun 20 12:11:24 2017 +0000 @@ -72,7 +72,7 @@ * for details. The values 400 and 4000 Ohm are recommended values for * the PT100 and PT1000. */ -#define RTD_RREF_PT100 400 /* Ohm */ +#define RTD_RREF_PT100 430 /* Ohm */ #define RTD_RREF_PT1000 4000 /* Ohm */ /* * The RTD resistance at 0 degrees Celcius. For the PT100, this is 100 Ohm;