Example host software for the Maxim Integrated MAX31723/MAX31722 Device Temperature Sensor. Hosted on the MAX32630FTHR. The MAX31723 may be used in thermostats, thermometers, and hardware temperature supervisors.
Dependencies: MAX31723_Digital_Temperature_Sensor max32630fthr USBDevice
Revision 10:e315ecdb7bcd, committed 2019-01-27
- Comitter:
- phonemacro
- Date:
- Sun Jan 27 07:26:59 2019 +0000
- Parent:
- 9:63068af9a17c
- Child:
- 11:36f82087066e
- Commit message:
- Correct configuration register not being updating.
Changed in this revision
| MAX31723_Digital_Temperature_Sensor.lib | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/MAX31723_Digital_Temperature_Sensor.lib Sun Jan 27 02:56:19 2019 +0000 +++ b/MAX31723_Digital_Temperature_Sensor.lib Sun Jan 27 07:26:59 2019 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/teams/MaximIntegrated/code/MAX31723_Digital_Temperature_Sensor/#bb6f11be119f +https://os.mbed.com/teams/MaximIntegrated/code/MAX31723_Digital_Temperature_Sensor/#7a20e65da621
--- a/main.cpp Sun Jan 27 02:56:19 2019 +0000
+++ b/main.cpp Sun Jan 27 07:26:59 2019 +0000
@@ -49,7 +49,7 @@
/** (note the calls to Thread::wait below for delays) */
/**
* @brief Sample main program for Maxim Integrated MAX31723
- * @version 1.0000.0000
+ * @version 1.0000.0001
*
* @details Sample main program for MAX31723/MAX31722
* The prints are sent to the terminal window (9600, 8n1).
@@ -68,6 +68,7 @@
{
int ret, i;
float temperature;
+ uint8_t value;
DigitalOut rLED(LED1, LED_OFF);
DigitalOut gLED(LED2, LED_OFF);
DigitalOut bLED(LED3, LED_OFF);
@@ -80,15 +81,19 @@
/* Jumpers (JP1) on MAX31723PMB should be set to SPI mode configuration
* or SERMODE pin should be set to VDD for SPI mode
*/
-
+ ret = max31723_temp.perform_one_shot_int(MAX31723_CFG_RESOLUTION_12BIT);
+
for (i = 0; i < 5; i++) {
- ret = max31723_temp.perform_one_shot(MAX31723_CONV_TIME_MSEC_12BIT);
+ ret = max31723_temp.perform_one_shot_int(MAX31723_CFG_RESOLUTION_12BIT);
wait(MAX31723_CONV_TIME_MSEC_12BIT);
temperature = max31723_temp.read_temp();
printf("Temperature = %4.4f Celsius, %4.4f Fahrenheit\r\n",
temperature, max31723_temp.celsius_to_fahrenheit(temperature));
wait(2);
}
+ max31723_temp.read_reg(value, MAX31723_REG_CFG);
+ printf("Configuration Register = 0x%02Xh \r\n", value);
+
printf("\r\n");
while (true) { // Blink the green LED
gLED = !gLED;