DS18B20 and LPC21XX
-
Upload
hypernuclide -
Category
Documents
-
view
111 -
download
0
description
Transcript of DS18B20 and LPC21XX
![Page 1: DS18B20 and LPC21XX](https://reader035.fdocuments.in/reader035/viewer/2022081805/546a9567b4af9fe9268b46fa/html5/thumbnails/1.jpg)
���������������������������������������� ���� ���� ���� ����
�����������
The DS18B20 digital thermometer provides 9-bit to 12-bit Celsius temperature measurements and has an
alarm function with nonvolatile user-programmable upper and lower trigger points. The DS18B20
communicates over a 1-Wire bus that by definition requires only one data line (and ground) for
communication with a central microprocessor. It has an operating temperature range of -55°C to +125°C
and is accurate to ±0.5°C over the range of -10°C to +85°C. In addition, the DS18B20 can derive power
directly from the data line (“parasite power”), eliminating the need for an external power supply.
Each DS18B20 has a unique 64-bit serial code, which allows multiple DS18B20s to function on the same
1-Wire bus. Thus, it is simple to use one microprocessor to control many DS18B20s distributed over a
large area. Applications that can benefit from this feature include HVAC environmental controls,
temperature monitoring systems inside buildings, equipment, or machinery, and process monitoring and
control systems.
�
������������������
��������������� ����������������������������������������
������������������������
��������� !�"�##��$�%�������$�&'���'��� ����$�$�����(�����)��
�����*����������+�������"�##��$�%�������$�&'���'��� ����$�$�����(�����)��
�����,��'��#����������������������� ������,��'���#�������������������$-�������������������������
�����$������'������������� ���������#�����������������$�����
��
�
![Page 2: DS18B20 and LPC21XX](https://reader035.fdocuments.in/reader035/viewer/2022081805/546a9567b4af9fe9268b46fa/html5/thumbnails/2.jpg)
�
������ ��������
.���������������������/0����&��&������������������������������ �������������������������� ������
������������������������#����$�&'�����&��#������������$�&'������������%)�����#����$�&'������
��,�%)��������������������������&��#�����1�����������,��$�,���%����������������)�������������
&����$��������$'����������������&�������#����$�����#��������������������
�
" �2�����������������
void dq_reset ()
{
char presence = 1;
while (presence)
{
while (presence)
{
dq_dir(1);
dq_set;
delay_1us (2);
dq_clr;
delay_5us (100);
dq_set;
delay_5us (12);
dq_dir(0);
presence = dq_rd;
presence = presence & dq;
![Page 3: DS18B20 and LPC21XX](https://reader035.fdocuments.in/reader035/viewer/2022081805/546a9567b4af9fe9268b46fa/html5/thumbnails/3.jpg)
}
delay_5us (100);
dq_dir(0);
presence = dq_rd;
presence = ~ presence;
presence = presence & dq;
}
}
� !�"�##��$�������� ��������
����#����������������##��$�����$$�������$�,����������&���#���������'�����������$���������
��'�� !��$�������#�������+����(�#���-�����#��������#�1���������������������&��������#��
�#�����������#�����������,������&'����������1���� !��##��$��������$�&'���"��,������344�5��
�##��$����
6����������������$��������$�3�2�5��##��$�����������������1���� !��##��$����'���������������
��������,��$�,����������&������������-���#�����,�$�&'��������������#������������$����#�������,���
����������$��������$�,��7�84/&���� !��$���.��1���� !��##��$��������$�&'������$��������$��
�##��$������������$�������������������&�������������#���������������,������#��������$�,���������
����#����������#���$�����#���������'��
���������������
�����##��$��������������������#�����������,�������+���������������,�����-������������������#����
$����������$���������/&'�����#������������������������������$�#�#��'���$���������������������������
���/�������$����������������$�,�����&�������$������������������#�$�-����������9�%#�()������������
�##��$������$�����#�����#������&��������������������������/0����&����������$����������������
��,������%�" 6:)���$���&�$��������;��������������������������������������������������$�&'�����
�(�����������'-�����#���������������$���#����������������"��,�������##��$���$�������������������
�����$�&'�����#�����������������������#�����������,��������������������$����������������,�������
��$����������������������#�$����������������������� ���������&����$���������&���������$������&'��
�����������������$������������,�������
�
![Page 4: DS18B20 and LPC21XX](https://reader035.fdocuments.in/reader035/viewer/2022081805/546a9567b4af9fe9268b46fa/html5/thumbnails/4.jpg)
�
�����������������������
�����##��$�����������#�����������$�������������������������$������$���������������������������
���������������&������&'�������$����������������������������$�����������<���&'���%&'�����=�"�")����
���$������#�����#�'������������������#���������$���������'���#��������'�������������������$�$�������
���$�$��
������������� ��������
����&��#�����������$�������������������$��������������#��������$����$�$�������#��������������
$���������$���#������� ���&������$����������#����$��,��������/0����&��������#��������
��
�������� ��������
���������������'��������������#�������>0������?���#��������$�>0������?���#�����������&��#������
�����0���������#�����������������������������������������$���0���������#��������������������������������
���������.�����������#������#���&����#���#�#����8�9����$���������������#���#�#�������9����,��'��
��#��&���������$�,�$���������������������'��������������#������������������$�&'�����#������������������
�/0����&������%���+�������4)���
��������������0���������#�����-��������������������/0����&�����-�����&��#�����#���������������/0�����
&����������@9��0��������&����������$-�����@1A�����������������������������&�����������������������
0���������#�����-��������������������/0����&�����-�����&��#�����#�����������������$�����&�����������
����$�����������������#������%��������8�9)��
�������������#���������/0����&��$�����������$���������������#��@9����8�9�����������#������
���������������������#��������������&���������$�����������#���������$��-��������������������������������
�����������������-�������������������������������
�
�
�
�
�
�
�
![Page 5: DS18B20 and LPC21XX](https://reader035.fdocuments.in/reader035/viewer/2022081805/546a9567b4af9fe9268b46fa/html5/thumbnails/5.jpg)
�
���������������� !���"�#����$"��%!$��&�
�
�
������� ��������
������������������'�����#���$�����������#��������������#������������$���#����������������-������
#�����#���������������$���#�������##�$�����'������������������$��������$�3�2�5�������$�;������
�����'�3�4�5��##��$-��������������������������,�$�������� ����$�$���������$$�����-�����#���������
������������$���#������������������"��,������344�5����������2��
�3���5��##��$�������$���������������
��������������������(������$����������������+�������"�##��$���������
��
.������$���#������#���&����#���#�#����8�9����$���������������#���#�#�������9����,��'���#���
![Page 6: DS18B20 and LPC21XX](https://reader035.fdocuments.in/reader035/viewer/2022081805/546a9567b4af9fe9268b46fa/html5/thumbnails/6.jpg)
&������������.����$���#����������������$�&'������#�����$�,����������������/0����&�������������
#���#�#�����9���$�������������������&��%���+�������4)��.���������#���������������������$���#�����-��
�����������������&���������#�������������������&�������������������#�������&'����,��������&��������
��$�����#�������&'�������������&�������0��������#����������-�����������������������������&��&'������
��$����������#�����-���$�����&�������&�������$�&�1�������������$��������&'�������������������� ������
$�������#���������������,���$������@9��������������������$����������������$��������$���#����������������-��
����#�����#��������������&����$�������#��������&���������������@9����#�����������������������
+�������@���������������������#������6��-���"-���$���.!;B2�#���&�����������@9����������$���#��������
+�������8����������'��#���#����#��������#�(�#���$�&'�1���������6������$���"��������������&����
��$�&'�������������#������#������#��$���������$���#�����������$�������$���������@9������$��
�������#������� !���"�#&�
�
�
�
�
�
![Page 7: DS18B20 and LPC21XX](https://reader035.fdocuments.in/reader035/viewer/2022081805/546a9567b4af9fe9268b46fa/html5/thumbnails/7.jpg)
�
+����"�$���
C����$�D����*(��E�
C$������$ ��DD�8�
C$������$ F$��%()�%()G%� ����HI$ )�%� ����JIK$ )�
C$������$ F���� �2��HI$ �
C$������$ F���� "B��HI$ �
C$������$ F�$�� ;�6��
������$���������-�2!;L�
,��$�$���'F@��%������$�����)L��
,��$�$���'F���%������$����������)L�
,��$�$ F����%)L��
������$�����$ F���$%)L�
,��$��#������%������$�����)L�
,��$�����F��,%)L�
������$������#��%)L��
������$������#����$%)L�
�
,��$�$���'F@��%������$���������)��
M�
��������$������L�
��������%����)�
��M�
������I�*�L�
���������%�E��)��//L�
��������//L�
����N�
N�
�������������������������������������
,��$�$���'F���%������$�����������)��
![Page 8: DS18B20 and LPC21XX](https://reader035.fdocuments.in/reader035/viewer/2022081805/546a9567b4af9fe9268b46fa/html5/thumbnails/8.jpg)
M���
����������$�����������L�
����������$����������OL�
����O�I����@<���P��������Q��L�
��������%�I�L��DOL���RR)L�
N�
�
,��$�$ F�����%)��
M�
�������������I��L�
��������%������)�
��M�
���������%������)�
���M�
���$ F$��%�)L��
���$ F��L�
���$���'F���%�)L��
���$ F��L�
���$���'F@��%���)L��
���$ F��L�
���$���'F@��%��)L��
���$ F$��%�)L��
����������I�$ F�$L�
����������I��������J�$ L��
���N�
���$���'F@��%���)L��
���$ F$��%�)L��
����������I�$ F�$L�
����������I�K�������L�
����������I��������J�$ L��
![Page 9: DS18B20 and LPC21XX](https://reader035.fdocuments.in/reader035/viewer/2022081805/546a9567b4af9fe9268b46fa/html5/thumbnails/9.jpg)
���N�
���
N�
�
,��$��#������%������$�����$��)�����
M���
��������$�����OL�
���������&L�
��$ F$��%�)L��������������������������
������%OI�LODI�LORR)�
���M���
��������&�I�$���J��(��L�
�����$���I�$���EE��L��
��������%���&)�
������M��
���������$ F��L�����
���������$���'F��%�)L�����������
���������$ F��L�
���������$���'F��%4)L�����������
���������$ F��L����
���������$���'F@�%�4)L����������
������N�
�������������
����������M�
�����������$ F��L�����
�����������$���'F��%�)L���������
�����������$ F��L�
�����������$���'F��%4)L���������
�����������$ F��L����
�����������$���'F@�%�4)L���������
![Page 10: DS18B20 and LPC21XX](https://reader035.fdocuments.in/reader035/viewer/2022081805/546a9567b4af9fe9268b46fa/html5/thumbnails/10.jpg)
����������N�
������N�
������$ F��L��
������$���'F��%�)L��������������
N�
�
������$�����$ F���$%)�
M�
� ������$�����$��L�
� $ F$��%�)L�
� $ F��L�
� $���'F��%�)L�
� $ F��L�
� $���'F��%*)L�
� $ F��L�
� $ F$��%�)L�
� $���'F@�%��)L�
� $��I$ F�$L�
� ������%$��)L�
N�
�
������$������#����$%)�������
M�
��������$������-$��L�
������OI�L��
��$���I��L��
������%�I�L�DI�L�RR)�
��M�
����O�I�$ F���$%)L��
����O�I�%OEE�@)J�(��L���������������������
![Page 11: DS18B20 and LPC21XX](https://reader035.fdocuments.in/reader035/viewer/2022081805/546a9567b4af9fe9268b46fa/html5/thumbnails/11.jpg)
����$���I�%ODDS)�H�%$���EE��)L�
��N�
��$ F$��%�)L�������������������������
��$ F��L�
���������%$��)L�
N��
�
������$������#��%)��������
M�
��������$������-&L�
��$ F����%)L��������
���#������%�()L��������
���#������%�(&�)L��������
����I��#����$%)L�������
��&�I��#����$%)L�����������
����%&E��S)�
��M�
������I�@8/�L�
����&�I�@8/&L�
���������I�L������������������������
��N�
������
��M�
���������I�L�����������������������
��N�
���2!;I%%�EE4)J��(��)H%%&�J��(�S)DD4)L��
��������%�2!;)L�
N�����
�
�
![Page 12: DS18B20 and LPC21XX](https://reader035.fdocuments.in/reader035/viewer/2022081805/546a9567b4af9fe9268b46fa/html5/thumbnails/12.jpg)
�
,��$�����F��,%)�������
M��
��$ F����%)L��������
���#�������%�()L������
���#�������%�(44)L��������
N�
�
�
� �
#���%)�
M�
������$�����#&-$��345L� �
�������%�)�
��M��
��� ���$F����%)L�
� ���$F����%)L�
� ���$F����('%�-�)L� �
����������F��,%)L�������
������$���'F@�%���)L�
������$���'F@�%���)L�
������$���'F@�%���)L�
������$���'F@�%���)L���
������$���'F@�%���)L�
������$���'F@�%���)L������������
������#&I�#�%)L�
� ����%����)�
� ��$��3�5I4*L�
� ������
� ��$��3�5I4@L�
![Page 13: DS18B20 and LPC21XX](https://reader035.fdocuments.in/reader035/viewer/2022081805/546a9567b4af9fe9268b46fa/html5/thumbnails/13.jpg)
� ��$��3�5I#&P����R�(*�L�
� ��$��3�5I#&P���T����R��(*�L�
� ��$��3*5I#&T��L�
� ���$F�����%$��)L����������
���N�
N�
U�������O������&��$������$�$������/������PP�����'�������$���#P&&P,�����������G�I*�J�I��SC���S�
.�$��$������,����&��������/�������PP������&$��#P$�P�4848�@*P����������/�$/��/4&��/#�$�/����/����*��
�
+���#���������,����������������������� ������
�