DS1822 Temp Sensor and BS2p24
Waveman
Posts: 20
I want to interface four DS1822 temp sensors using 1-Wire to a BS2p24. I know that I need a pullup resistor and
can anyone tell me if one 4.7k Ohm will do for the all DQ lines tied together?
Thanks,
W
can anyone tell me if one 4.7k Ohm will do for the all DQ lines tied together?
Thanks,
W
Comments
Plan how you are going to write your program before you wire them all up. Do you want the program to be shorter and easier? If so, then attach the individual DS1822s, one at a time and out its address in advance, before you wire them all up in parallel.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Shorter and easier is the way I want to go. Thank you and any code examples you may have for reading more than one DS1822? The BS2 reference manual only has example for one DS1822.
Tnx,
W
Each onewire device has a unique serial number. When you request data from a DS1822, the command will start by sending out a serial number. It does not matter how many onewire devices are attached, only the one with that serial number will respond. So the first thing for you to do is to catalog, one at a time, the serial numbers of all the 1822s you have. Then when you connect them all to the single bus, you will already know what is there, and you can easily modify the program to address them one at a time. You will store the addresses of the 1822s as DATA or as CONstants, or simply hard code them in the program.
The program you have probably includes something like the following to read out the serial number:
That kind of routine works only when one onewire device at a time is connected. Those are the numbers you need to write down, then you can use them when several are on the line.
There is a procedure of enumeration for figuring out blind the serial numbers of devices when several are on the line, but it is a much more complicated.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com