SPMA057D January   2018  – June 2022 TM4C1290NCPDT , TM4C1290NCPDT , TM4C1290NCZAD , TM4C1290NCZAD , TM4C1292NCPDT , TM4C1292NCPDT , TM4C1292NCZAD , TM4C1292NCZAD , TM4C1294KCPDT , TM4C1294KCPDT , TM4C1294NCPDT , TM4C1294NCPDT , TM4C1294NCZAD , TM4C1294NCZAD , TM4C1297NCZAD , TM4C1297NCZAD , TM4C1299KCZAD , TM4C1299KCZAD , TM4C1299NCZAD , TM4C1299NCZAD , TM4C129CNCPDT , TM4C129CNCPDT , TM4C129CNCZAD , TM4C129CNCZAD , TM4C129DNCPDT , TM4C129DNCPDT , TM4C129DNCZAD , TM4C129DNCZAD , TM4C129EKCPDT , TM4C129EKCPDT , TM4C129ENCPDT , TM4C129ENCPDT , TM4C129ENCZAD , TM4C129ENCZAD , TM4C129LNCZAD , TM4C129LNCZAD , TM4C129XKCZAD , TM4C129XKCZAD , TM4C129XNCZAD , TM4C129XNCZAD , TMP1826 , TMP1826 , TMP1827 , TMP1827

 

  1.   Abstract
  2.   Trademarks
  3. 1Introduction to 1-Wire
    1. 1.1 Bus Requirements
    2. 1.2 Powering
  4. 2Functional Description
    1. 2.1 Signaling on 1-Wire
    2. 2.2 Address Format of the 1-Wire Device
    3. 2.3 Typical Communication Flow on the 1-Wire Bus
  5. 3Functions Available in TivaWare for C Series for 1-Wire Module
  6. 4Enumeration
    1. 4.1 Legacy Search Algorithm
      1. 4.1.1 Steps of the 3-Bit Search Algorithm
    2. 4.2 Fast Search Algorithm
  7. 5Summary
  8. 6References
  9. 7Revision History

Legacy Search Algorithm

The Search algorithm uses a binary search tree. At every node, the algorithm can take the path dictated by either a “0” or “1.” The relationship between the two bits obtained in step 1 and the path to be taken in step 2 are given in Table 4-1.

Table 4-1 Search Algorithm
Actual Bit Read ValueComplement Bit Read ValueConclusionsPath to be taken
00Multiple devices have a corresponding 0 bit and a corresponding 1 bitThis is a conflict situation and requires a decision on which path to take
10Only one device has a 1 in the corresponding bit locationThe 1 path is taken
01Only one device has a 0 in the corresponding bit locationThe 0 path is taken
11No devices are on the busEnd the search

The only time that a decision must be made is when there is a conflict. In the other three cases, the path to be taken is already defined. Figure 4-1 shows the algorithm flow for a 4-bit search. The following variables in software are key to the search.

  • The variable i32LastConflictZeroBitNumber stores the iteration number of the last conflict node where the path taken is “0” while finding the current ROM number.
  • The variable li32ConflictBitNumber stores the value of last_conflict_zero for the last ROM number.
  • The variable ui32BitNumber gives the position of the bit under consideration in the ROM number.
Figure 4-1 Enumeration using binary search tree