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 11:36f82087066e, committed 2019-01-28
- Comitter:
- phonemacro
- Date:
- Mon Jan 28 00:42:29 2019 +0000
- Parent:
- 10:e315ecdb7bcd
- Child:
- 12:f2ef711f40ef
- Commit message:
- Use 1.8V for VDD. Updated the interface for reading registers.
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 07:26:59 2019 +0000 +++ b/MAX31723_Digital_Temperature_Sensor.lib Mon Jan 28 00:42:29 2019 +0000 @@ -1,1 +1,1 @@ -https://os.mbed.com/teams/MaximIntegrated/code/MAX31723_Digital_Temperature_Sensor/#7a20e65da621 +https://os.mbed.com/teams/MaximIntegrated/code/MAX31723_Digital_Temperature_Sensor/#f39791139435
--- a/main.cpp Sun Jan 27 07:26:59 2019 +0000
+++ b/main.cpp Mon Jan 28 00:42:29 2019 +0000
@@ -35,7 +35,7 @@
#include "max31723.h"
#include "USBSerial.h"
-MAX32630FTHR pegasus(MAX32630FTHR::VIO_3V3);
+MAX32630FTHR pegasus(MAX32630FTHR::VIO_1V8); /* Pegasus, MAX31723: use 1.8V */
DigitalOut rLED(LED1);
DigitalOut gLED(LED2);
@@ -49,7 +49,7 @@
/** (note the calls to Thread::wait below for delays) */
/**
* @brief Sample main program for Maxim Integrated MAX31723
- * @version 1.0000.0001
+ * @version 1.0000.0002
*
* @details Sample main program for MAX31723/MAX31722
* The prints are sent to the terminal window (9600, 8n1).
@@ -86,15 +86,15 @@
for (i = 0; i < 5; i++) {
ret = max31723_temp.perform_one_shot_int(MAX31723_CFG_RESOLUTION_12BIT);
wait(MAX31723_CONV_TIME_MSEC_12BIT);
- temperature = max31723_temp.read_temp();
+ temperature = max31723_temp.read_reg_as_temperature(MAX31723_REG_TEMP_LSB);
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("Configuration Register = 0x%02Xh \r\n", max31723_temp.read_cfg());
printf("\r\n");
+
while (true) { // Blink the green LED
gLED = !gLED;
wait(1.0);