This documentation is out of date.
The new version of the documentation is here: https://cannylogic.com/docs |
Difference between revisions of "CANNY 7, Dallas 1-Wire Driver"
[unchecked revision] | [unchecked revision] |
(→Registers 1-Wire driver) |
(→Dallas 1-Wire® driver) |
||
Line 26: | Line 26: | ||
{| | {| | ||
|valign="top" style="padding-left:0.5em;"|''Note:'' | |valign="top" style="padding-left:0.5em;"|''Note:'' | ||
− | |valign="top" style="padding-left:0.5em;"|''To avoid | + | |valign="top" style="padding-left:0.5em;"|''To avoid data loss, when working with several Dallas buses, perform switching between them only after receiving responses from the slaves requested by the controller and processing or saving the data.'' |
|} | |} | ||
− | Example of channel #5 | + | Example of channel #5 configured to work with a temperature sensor DS18X20. |
[[File:6_12_2_1.png|center|300px]] | [[File:6_12_2_1.png|center|300px]] | ||
Line 64: | Line 64: | ||
− | + | Channel configuration to operate in this mode is set by the following named constants: | |
{|border="1" style="border-collapse:collapse;" align="left" width="100%" | {|border="1" style="border-collapse:collapse;" align="left" width="100%" | ||
|- align="center" valign="top" | |- align="center" valign="top" | ||
Line 75: | Line 75: | ||
− | 1- | + | Dallas 1-Wire® Request Registers. |
− | With the help of 1- | + | With the help of Dallas 1-Wire® driver request registers , the user can specify the address of respondent slave node and send a request for data transfer. |
{|border="1" style="border-collapse:collapse;" align="left" width="100%" | {|border="1" style="border-collapse:collapse;" align="left" width="100%" | ||
Line 84: | Line 84: | ||
!Expected values | !Expected values | ||
|- valign="top" | |- valign="top" | ||
− | |Dallas | + | |Dallas 1-Wire® Request To Send Register |
|valign="top"| | |valign="top"| | ||
{|border="0" align="left" | {|border="0" align="left" | ||
Line 97: | Line 97: | ||
|} | |} | ||
|- valign="top" | |- valign="top" | ||
− | | | + | |Dallas 1-Wire® Requested Device ID RAW Data Register SN0:FC |
| | | | ||
{|border="0" align="left" | {|border="0" align="left" | ||
Line 106: | Line 106: | ||
|} | |} | ||
|- valign="top" | |- valign="top" | ||
− | | | + | |Dallas 1-Wire® Requested Device ID RAW Data Register SN2:SN1 |
| | | | ||
{|border="0" align="left" | {|border="0" align="left" | ||
Line 115: | Line 115: | ||
|} | |} | ||
|- valign="top" | |- valign="top" | ||
− | | | + | |Dallas 1-Wire® Requested Device ID RAW Data Register SN4:SN3 |
| | | | ||
{|border="0" align="left" | {|border="0" align="left" | ||
Line 124: | Line 124: | ||
|} | |} | ||
|- valign="top" | |- valign="top" | ||
− | | | + | |Dallas 1-Wire® Requested Device ID RAW Data Register CRC:SN5 |
| | | | ||
{|border="0" align="left" | {|border="0" align="left" | ||
Line 136: | Line 136: | ||
{| | {| | ||
|valign="top" style="padding-left:0.5em;"|''Note:'' | |valign="top" style="padding-left:0.5em;"|''Note:'' | ||
− | |valign="top" style="padding-left:0.5em;"|''The setup registers of Dallas 64-bit transmission destination ROM-code is only used to select a device on the 1- | + | |valign="top" style="padding-left:0.5em;"|''The setup registers of Dallas 1-Wire® 64-bit transmission destination ROM-code is only used to select a device on the Dallas 1-Wire® bus by its unique number (ROM-code), in case of multiple devices connected to the same bus. During operation with a single device on the bus, when its ROM- code unknown, set "0" value into all registers of Dallas transmission destination ROM-code.'' |
|} | |} | ||
− | Dallas 1- | + | Dallas 1-Wire® Receive Registers . |
− | + | During its operation, upon reception of responses from the slave devices to the controller data requests, according to Dallas 1-Wire® driver configuration, stored in its corresponding receiving registers. | |
− | General | + | General receive registers. |
{|border="1" style="border-collapse:collapse;" align="left" width="100%" | {|border="1" style="border-collapse:collapse;" align="left" width="100%" | ||
Line 151: | Line 151: | ||
!Return values | !Return values | ||
|- valign="top" | |- valign="top" | ||
− | | | + | |Dallas 1-Wire® Data Set Ready Register |
|valign="top"| | |valign="top"| | ||
{|border="0" align="left" | {|border="0" align="left" | ||
Line 157: | Line 157: | ||
|width="70px" style="padding-left:0.5em;"|1 | |width="70px" style="padding-left:0.5em;"|1 | ||
|style="padding-left:0.5em;"|= | |style="padding-left:0.5em;"|= | ||
− | |style="padding-left:0.5em;"|successfully received data from the slave node and it is available in Dallas driver read registers; | + | |style="padding-left:0.5em;"|successfully received data from the slave node and it is available in Dallas 1-Wire® driver read registers; |
|- valign="top" | |- valign="top" | ||
|width="70px" style="padding-left:0.5em;"|0 | |width="70px" style="padding-left:0.5em;"|0 | ||
Line 166: | Line 166: | ||
− | + | iButton® DS1990A Receive Mode Registers. | |
{|border="1" style="border-collapse:collapse;" align="left" width="100%" | {|border="1" style="border-collapse:collapse;" align="left" width="100%" | ||
Line 173: | Line 173: | ||
!Return values | !Return values | ||
|- valign="top" | |- valign="top" | ||
− | | | + | |Dallas 1-Wire® Received Raw Data Register D0:FC |
| | | | ||
{|border="0" align="left" | {|border="0" align="left" | ||
Line 182: | Line 182: | ||
|} | |} | ||
|- valign="top" | |- valign="top" | ||
− | | | + | |Dallas 1-Wire® Received Raw Data Register D2:D1 |
| | | | ||
{|border="0" align="left" | {|border="0" align="left" | ||
Line 191: | Line 191: | ||
|} | |} | ||
|- valign="top" | |- valign="top" | ||
− | | | + | |Dallas 1-Wire® Received Raw Data Register D4:D3 |
| | | | ||
{|border="0" align="left" | {|border="0" align="left" | ||
Line 200: | Line 200: | ||
|} | |} | ||
|- valign="top" | |- valign="top" | ||
− | | | + | |Dallas 1-Wire® Received Raw Data Register CRC:D5 |
| | | | ||
{|border="0" align="left" | {|border="0" align="left" | ||
Line 211: | Line 211: | ||
− | + | DS18X20 Receive Mode Registers. | |
{|border="1" style="border-collapse:collapse;" align="left" width="100%" | {|border="1" style="border-collapse:collapse;" align="left" width="100%" | ||
|- align="center" valign="top" | |- align="center" valign="top" | ||
!width="250px"|Адрес | !width="250px"|Адрес | ||
− | ! | + | !Returning values |
|- valign="top" | |- valign="top" | ||
|Регистр чтения показаний температуры: целые градусы Цельсия | |Регистр чтения показаний температуры: целые градусы Цельсия |
Revision as of 03:42, 27 August 2016
General Description
Controller CANNY 7 can be used as a master node in a single-wire data network Dallas® 1-Wire®, while it has the ability to only send requests for data from slave devices.
Any of CANNY 7 input-output channels can be used to connect the controller to 1-Wire bus. At the same time, that channel must be externally pulled-up to 5V with resistor 3-7k Ohm. Consistently reassigning driver channels, it's possible to arrange up to 11 independent connections 1-Wire. Wherein device addressing and device handling by address is not available, therefore, in 1-Wire mode it is possible to connect only one SLAVE node at a time to controllers' channel.
Driver Dallas 1-Wire in its operation uses controller channels' resources, but has a higher priority than discrete input-output driver.Thus, upon activation Dallas 1-Wire driver, for channels involved in to its operation, change values in associated registers of discrete input-output driver will be ignored.
The slave must have a permanent, rather than parasitic power.
Dallas 1-Wire® driver
Below is a description of the Dallas 1-Wire® driver registers.
Dallas 1-Wire® driver configuration registers.
To activate Dallas 1-Wire® driver, you need to select the controller channel number connected to Dallas 1-Wire® bus, in the appropriate driver register.
Note: | At any given time, the driver can work with only one of the connected Dallas 1-Wire® bus, when it is allowed to dynamically switch between buses in the implementation of the functional diagram. |
Sent requests management to get information from the slaves and control receiving of their responses (sensors poll) is performed by appropriate registers of 1-Wire driver.
Note: | To avoid data loss, when working with several Dallas buses, perform switching between them only after receiving responses from the slaves requested by the controller and processing or saving the data. |
Example of channel #5 configured to work with a temperature sensor DS18X20.
Dallas 1-Wire® Setup Registers.
Address | Expected values | ||||||
---|---|---|---|---|---|---|---|
Dallas 1-Wire® configuration register |
| ||||||
Dallas 1-Wire® IO Channel Select register |
|
Channel configuration to operate in this mode is set by the following named constants:
Parameter | List of expected values |
---|---|
Dallas 1-Wire® device type | DS18X20 temperature sensor, CP-Z reader in the DS1990A emulation mode, DS1990A reader |
Dallas 1-Wire® Request Registers.
With the help of Dallas 1-Wire® driver request registers , the user can specify the address of respondent slave node and send a request for data transfer.
Address | Expected values | ||||||
---|---|---|---|---|---|---|---|
Dallas 1-Wire® Request To Send Register |
| ||||||
Dallas 1-Wire® Requested Device ID RAW Data Register SN0:FC |
| ||||||
Dallas 1-Wire® Requested Device ID RAW Data Register SN2:SN1 |
| ||||||
Dallas 1-Wire® Requested Device ID RAW Data Register SN4:SN3 |
| ||||||
Dallas 1-Wire® Requested Device ID RAW Data Register CRC:SN5 |
|
Note: | The setup registers of Dallas 1-Wire® 64-bit transmission destination ROM-code is only used to select a device on the Dallas 1-Wire® bus by its unique number (ROM-code), in case of multiple devices connected to the same bus. During operation with a single device on the bus, when its ROM- code unknown, set "0" value into all registers of Dallas transmission destination ROM-code. |
Dallas 1-Wire® Receive Registers .
During its operation, upon reception of responses from the slave devices to the controller data requests, according to Dallas 1-Wire® driver configuration, stored in its corresponding receiving registers.
General receive registers.
Address | Return values | ||||||
---|---|---|---|---|---|---|---|
Dallas 1-Wire® Data Set Ready Register |
|
iButton® DS1990A Receive Mode Registers.
Address | Return values | |||
---|---|---|---|---|
Dallas 1-Wire® Received Raw Data Register D0:FC |
| |||
Dallas 1-Wire® Received Raw Data Register D2:D1 |
| |||
Dallas 1-Wire® Received Raw Data Register D4:D3 |
| |||
Dallas 1-Wire® Received Raw Data Register CRC:D5 |
|
DS18X20 Receive Mode Registers.
Адрес | Returning values | ||||||
---|---|---|---|---|---|---|---|
Регистр чтения показаний температуры: целые градусы Цельсия |
| ||||||
Регистр чтения показаний температуры: десятитысячные доли градуса Цельсия |
| ||||||
Регистр чтения показаний температуры: sign (0 = above zero; 1 = below zero) |
|
Note: | When receiving in DS18X20 mode, temperature sensor duty cycle, those send requests via Dallas transmission start register, should not be less than 750ms. |
Example of a functional diagram to work with temperature sensor DS18X20.
temperature sensor poll, connected to the channel #5, carried out 1 time per second. При получении данных от DS18X20, в регистре наличия принятых данных драйвера Dallas появляется значение «1» и данные из регистров чтения показаний температуры, с помощью D-триггеров, сохраняются в соответствующие именованные сети для дальнейшей обработки.