Skip to content

Interfacing multiple DS18b20 #55743

Answered by CodingGhost
CodingGhost asked this question in Q&A
Discussion options

You must be logged in to vote

I just got it working.
just some infos for the next guy who stumbles across this:
make sure to have at least 2 devices in the devicetree like this:

w1_0: w1-zephyr-serial-0 {
		 compatible = "zephyr,w1-serial";
		 #address-cells = <1>;
		 #size-cells = <0>;
		 status = "okay";
 
		 testlabel: ds18b20 {
			 compatible = "maxim,ds18b20";
			 family-code = <0x28>;
			 resolution = <12>;
			 status = "okay";
		 };
		 testlabel2: ds18b202 {
			compatible = "maxim,ds18b20";
			family-code = <0x28>;
			resolution = <12>;
			status = "okay";
		};
	 };

then you can specify the rom for a given device like so:

struct sensor_value romval;
struct w1_rom w1rom;
w1_uint64_to_rom(2954138715793261711,&w1…

Replies: 8 comments 10 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@dolence
Comment options

@CodingGhost
Comment options

@dolence
Comment options

@CodingGhost
Comment options

@dolence
Comment options

Answer selected by CodingGhost
Comment options

You must be logged in to vote
5 replies
@Martdur
Comment options

@str4t0m
Comment options

str4t0m Apr 17, 2024
Collaborator

@Martdur
Comment options

@dolence
Comment options

@Martdur
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area: W1 1-Wire
4 participants
Converted from issue

This discussion was converted from issue #55283 on March 14, 2023 05:00.