-
Notifications
You must be signed in to change notification settings - Fork 486
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
Location for MAX31825 #250
Comments
Sounds interesting, I do not recall seeing this in the datasheet (which page?) |
See page 13 on attached data sheet |
Is there an example how to use? bool DallasTemperature::getLocation(const uint8_t* deviceAddress)
{
int b = _wire->reset();
if (b == 0)
return false;
_wire->select(deviceAddress);
_wire->write(DETECTADD);
b = _wire->reset();
return (b == 1);
} Where / how does it read the location ? OK, lets first read the datasheet |
Yes here is an arduino script running on an arduino mini pro .. but that should not matter. This outputs the temperatures from 5 sensors: I only had one sensor attached here A 10k resistor attached to ADD0 listed as having an address 0x3a :3b ,0 , ,13.94,3a, ,-127.00,3a, ,-127.00,3a, ,-127.00,3a, ,-127.00,3a |
Datasheet P13 AddressAlthough the 64-bit ROM code allows each 1-Wire device on a bus to be identified for communication purposes, it does
|
@pmr1 I would propose something like this int DallasTemperature::getLocation(const uint8_t* deviceAddress)
{
if (_wire->reset() == 0) return -1;
_wire->select(deviceAddress);
_wire->write(DETECTADD); // 0x88
if (_wire->reset() == 0) return -1;
readScratchPad(deviceAddress, ScratchPad);
return ScratchPad[2];
} |
Should add a test for model in the function #define DS1825MODEL 0x3B // also MAX31825 |
Ok but the existing api does recognise the 31825 and it does have a get address function so no need ro define an extra constant.
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Rob Tillaart ***@***.***>
Sent: Friday, February 9, 2024 12:45:16 PM
To: milesburton/Arduino-Temperature-Control-Library ***@***.***>
Cc: pmr1 ***@***.***>; Mention ***@***.***>
Subject: Re: [milesburton/Arduino-Temperature-Control-Library] Location for MAX31825 (Issue #250)
@pmr1<https://github.com/pmr1>
OK, I understand from the prototype code how one gets a location from the MAX31825.
The implementation has to be engineered, with a more clear API as a DS18B20 does not support this call
I would propose something like this
int DallasTemperature::getLocation(const uint8_t* deviceAddress)
{
if (_wire->reset() == 0) return -1; // not supported
_wire->select(deviceAddress);
_wire->write(DETECTADD);
if (_wire->reset() == 0) return -1;
readScratchPad(deviceAddress, ScratchPad);
return ScratchPad[2];
}
—
Reply to this email directly, view it on GitHub<#250 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABCPD2ZGMYPS36NGWMU7OHDYSYK5ZAVCNFSM6AAAAABDBLQUL6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZVHA3DMOBSGA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
That model I mentioned is already defined in the .h file (did not invent it) What I do not know if the original DS1825, which has the same model byte as the MAX31825, does support location. Another question is what happens if the 2 lines are not connected / floating? |
1. No the Max 31825 has a different scratchpad to the DS1825.
2. if Add0, 1 are left connected temperature still reads.
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Rob Tillaart ***@***.***>
Sent: Friday, February 9, 2024 1:01:27 PM
To: milesburton/Arduino-Temperature-Control-Library ***@***.***>
Cc: pmr1 ***@***.***>; Mention ***@***.***>
Subject: Re: [milesburton/Arduino-Temperature-Control-Library] Location for MAX31825 (Issue #250)
That model I mentioned is already defined in the .h file (did not invent it)
What I do not know if the original DS1825, which has the same model byte as the MAX31825, does support location.
Another question is what happens if the 2 lines are not connected / floating?
What does getLocation() return?
Can you test?
—
Reply to this email directly, view it on GitHub<#250 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABCPD2Y4POXOW6MSKNQI5QLYSYM2PAVCNFSM6AAAAABDBLQUL6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZVHA4TAMJRGU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Oh right, I see your point the DS1825 does have an address function but operates via external pins and the address is seen in the configuration register. The Max31825 comes in a solder bump package measuring 0.
8mm x 1mm and is a bugger to solder. So using a resistor is a convenient way of fixing an address.
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Rob Tillaart ***@***.***>
Sent: Friday, February 9, 2024 1:01:27 PM
To: milesburton/Arduino-Temperature-Control-Library ***@***.***>
Cc: pmr1 ***@***.***>; Mention ***@***.***>
Subject: Re: [milesburton/Arduino-Temperature-Control-Library] Location for MAX31825 (Issue #250)
That model I mentioned is already defined in the .h file (did not invent it)
What I do not know if the original DS1825, which has the same model byte as the MAX31825, does support location.
Another question is what happens if the 2 lines are not connected / floating?
What does getLocation() return?
Can you test?
—
Reply to this email directly, view it on GitHub<#250 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABCPD2Y4POXOW6MSKNQI5QLYSYM2PAVCNFSM6AAAAABDBLQUL6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZVHA4TAMJRGU>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This version of 1-wire temperature sensors has an address function allowing up to 64 addresses. Each address specifies the temperature sensor can be location. It does this by sampling the value of a resistor connected to ADD0 and ground .. see the data sheet for specific values.
I have updated library files to include a getLocation function. It samples the resistor value and writes the address to the 6 lsb bits in the status register. To access this you have to read the scratchpad .. the address located at scratchpad[2]
DallasTemperature.zip
The text was updated successfully, but these errors were encountered: