Home > other >  Single bus control problem of multiple DS18B20
Single bus control problem of multiple DS18B20

Time:09-22

51 control two or more DS18b20, use an IO mouth how to control, are checked to match the ROM before, but make for a long time didn't succeed, which bosses, solve,,

CodePudding user response:

After the first single 18 b20 work, written to address respectively, then concatenated together, can according to the set of addresses to control

CodePudding user response:

reference 1/f, worldy response:
single 18 b20 work first, after written address respectively, then concatenated together, can according to the set of addresses to control

Can you clarify a bit? Write the address respectively? Don't have to match the ROM?

CodePudding user response:

Sorry, I've got the wrong, is a single device, first read the ID code, then use the ID code to identify each device

The 64 - BIT LASERED ROM CODE
Each DS18B20 The contains a unique 64 - bit code (see Figure 6) stored in ROM. The further significant 8 bits
Of the ROM code contain the DS18B20's 1 - Wire family code: 28 h. the next 48 bits contain a unique
Serial number. The most significant 8 bits contain a cyclic redundancy check (CRC) byte belong
Calculated from the first 56 bits of the ROM code. A detailed explanation of the CRC bits is provided in
The CRC Generation section. The 64 - bit ROM code and associated ROM function control logic allow the
DS18B20 to operate as a 1 - Wire device using the protocol detailed in the 1 - Wire Bus System section.

CodePudding user response:

DS18B20_WriteByte (ch, 0 x55);
DS18B20_WriteByte (ch, sn [0]);
DS18B20_WriteByte (ch, sn [1]);
DS18B20_WriteByte (ch, sn [2]);
DS18B20_WriteByte (ch, sn [3]);
DS18B20_WriteByte (ch, sn [4]);
DS18B20_WriteByte (ch, sn [5]);
DS18B20_WriteByte (ch, sn [6]);
DS18B20_WriteByte (ch, sn [7]);
DS18B20_WriteByte (ch, 0 xbe);



Specific see manual
  • Related