-
Notifications
You must be signed in to change notification settings - Fork 845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for MAX31875 #2635
Open
jemfgeronimo
wants to merge
3
commits into
analogdevicesinc:main
Choose a base branch
from
jemfgeronimo:dev/max31875-v2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+410
−122
Open
Add support for MAX31875 #2635
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,9 +29,18 @@ Supported chips: | |
|
||
Datasheet: Publicly available at the Analog Devices website | ||
|
||
* Maxim MAX31875 | ||
|
||
Prefix: 'max31875' | ||
|
||
Addresses scanned: I2C 0x48 - 0x4f | ||
|
||
Datasheet: Publicly available at the Analog Devices website | ||
|
||
|
||
Authors: | ||
- Daniel Matyas <[email protected]> | ||
- John Erasmus Mari Geronimo <[email protected]> | ||
|
||
Description | ||
----------- | ||
|
@@ -45,13 +54,20 @@ configured to operate in the same manner with 1 write operation to the | |
configuration register. From here on, we will refer to all these chips as | ||
MAX31827. | ||
|
||
MAX31827 implements a temperature sensor with a 6 WLP packaging scheme. This | ||
sensor measures the temperature of the chip itself. | ||
This driver also supports the MAX31875. Its fault queue is set to 1 and it has | ||
no alarm polarity. | ||
|
||
MAX31827 implements a temperature sensor with a 6 WLP packaging scheme while | ||
MAX31875 has a 4 WLP packaging scheme. This sensor measures the temperature of | ||
the chip itself. | ||
|
||
MAX31827 has low and over temperature alarms with an effective value and a | ||
hysteresis value: -40 and -30 degrees for under temperature alarm and +100 and | ||
+90 degrees for over temperature alarm. | ||
|
||
MAX31875 has only an over temperature alarm with an effective value and a | ||
hysteresis value: +80 and +75 degrees. | ||
|
||
The alarm can be configured in comparator and interrupt mode from the | ||
devicetree. In Comparator mode, the OT/UT status bits have a value of 1 when the | ||
temperature rises above the TH value or falls below TL, which is also subject to | ||
|
@@ -75,19 +91,22 @@ it is recommended to perform a read of the configuration/status register to | |
clear the status bits before changing the operating mode. | ||
|
||
The conversions can be manual with the one-shot functionality and automatic with | ||
a set frequency. When powered on, the chip measures temperatures with 1 conv/s. | ||
a set frequency. When powered on, the MAX31827 measures temperatures with 1 | ||
conv/s while the MAX31875 measures temperatures with 0.25 conv/s or 1 conv/4s. | ||
The conversion rate can be modified with update_interval attribute of the chip. | ||
Conversion/second = 1/update_interval. Thus, the available options according to | ||
the data sheet are: | ||
|
||
- 64000 (ms) = 1 conv/64 sec | ||
- 32000 (ms) = 1 conv/32 sec | ||
- 16000 (ms) = 1 conv/16 sec | ||
- 4000 (ms) = 1 conv/4 sec | ||
- 1000 (ms) = 1 conv/sec (default) | ||
- 4000 (ms) = 1 conv/4 sec (MAX31875 default) | ||
- 1000 (ms) = 1 conv/sec (MAX31827 default) | ||
- 250 (ms) = 4 conv/sec | ||
- 125 (ms) = 8 conv/sec | ||
|
||
The MAX31875 only supports the last four values above. | ||
|
||
Enabling the device when it is already enabled has the side effect of setting | ||
the conversion frequency to 1 conv/s. The conversion time varies depending on | ||
the resolution. | ||
|
@@ -97,16 +116,16 @@ available resolutions are: | |
|
||
- 8 bit -> 8.75 ms conversion time | ||
- 9 bit -> 17.5 ms conversion time | ||
- 10 bit -> 35 ms conversion time | ||
- 12 bit (default) -> 140 ms conversion time | ||
- 10 bit (MAX31875 default) -> 35 ms conversion time | ||
- 12 bit (MAX31827 default) -> 140 ms conversion time | ||
|
||
There is a temp1_resolution attribute which indicates the unit change in the | ||
input temperature in milli-degrees C. | ||
|
||
- 1000 mC -> 8 bit | ||
- 500 mC -> 9 bit | ||
- 250 mC -> 10 bit | ||
- 62 mC -> 12 bit (default) - actually this is 62.5, but the fil returns 62 | ||
- 250 mC -> 10 bit (MAX31875 default) | ||
- 62 mC -> 12 bit (MAX31827 default) - actually this is 62.5, but the fil returns 62 | ||
|
||
When chip is in shutdown mode and a read operation is requested, one-shot is | ||
triggered, the device waits for <conversion time> ms, and only after that is | ||
|
@@ -125,7 +144,8 @@ Bus timeout resets the I2C-compatible interface when SCL is low for more than | |
|
||
Alarm polarity determines if the active state of the alarm is low or high. The | ||
behavior for both settings is dependent on the Fault Queue setting. The ALARM | ||
pin is an open-drain output and requires a pullup resistor to operate. | ||
pin is an open-drain output and requires a pullup resistor to operate. The | ||
MAX31875 does not have this feature. | ||
|
||
The Fault Queue bits select how many consecutive temperature faults must occur | ||
before overtemperature or undertemperature faults are indicated in the | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should mention this change in the commit message. You'll likely be asked why if we can have a fallback device for this one (one of the devices that the driver already supports). So you should also mention in the commit message why that is not possible.
Also speaking about the commit message, you're only stating the obvious there :). Give a small description of the HW.