This documentation is out of date.

The new version of the documentation is here: https://cannylogic.com/docs

Difference between revisions of "CANNY 7, EEPROM Driver"

From CANNY Wiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
(Смотри также)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=== Общее описание ===
+
== General description ==
  
Для исключения потери критически важной информации (состояния контроллера, состояния внешних устройств и т. п.) при сбросе питания, в контроллере CANNY7 предусмотрено наличие энергонезависимой памяти. Сохраненные в ней значения будут доступны после восстановления питания контроллера в специальных регистрах.
+
To eliminate loss of critical information (state of the controller, external devices status, and so on..) I case of power reset , CANNY7 controller equipped with non-volatile memory. The values saved in EEPROM will be available in special registers after the power is restored.
  
Пользователю доступны 64 шестнадцатибитные ячейки энергонезависимой памяти, доступ к которым осуществляется с помощью соответствующих регистров чтения и записи.
+
There are 64 16-bit non-volatile memory cells, which are accessed by corresponding read and write registers.
  
 
{|
 
{|
|valign="top" style="padding-left:0.5em;"|''Примечание:''
+
|valign="top" style="padding-left:0.5em;"|''Note:''
|valign="top" style="padding-left:0.5em;"|''Работа с энергонезависимой памятью не требует какой-либо специальной предварительной конфигурации.''
+
|valign="top" style="padding-left:0.5em;"|''Working with non-volatile memory does not require any special pre-configuration. However, in order to avoid loss of information, make sure that all the time between writing new values, the value in the write register of the used non-volatile memory cell is read from the read register of the same cell. See the example.''
 
|}
 
|}
  
=== Регистры энергонезависимой памяти ===
+
{|
 +
|valign="top" style="padding-left:0.5em;"|''Note:''
 +
|valign="top" style="padding-left:0.5em;"|''Changing the value in a nonvolatile memory cell will increase the execution time of the chart cycle at which it occurred for several milliseconds.''
 +
|}
 +
 
 +
== Nonvolatile memory registers ==
  
Ниже приведено описание допустимых значений регистров установки энергонезависимой памяти контроллера. Они используются для сохранения информации в ячейках ЭНП.
+
Below is a description of permissible values of controller nonvolatile memory setup registers. They are used to store information in the NVRAM cells.
  
 
{|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"|Address
!Ожидаемые значения
+
!Expected values
 
|- valign="top"
 
|- valign="top"
 
|
 
|
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|Регистр установки энергонезависимой памяти №00
+
|style="padding-left:0.5em;"|EEPROM Set Cell 00
 
|- valign="top"
 
|- valign="top"
 
|style="padding-left:0.5em;"|...
 
|style="padding-left:0.5em;"|...
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|Регистр установки энергонезависимой памяти №63
+
|style="padding-left:0.5em;"|EEPROM Set Cell 63
 
|}
 
|}
 
|valign="top"|
 
|valign="top"|
Line 33: Line 38:
 
|width="70px" style="padding-left:0.5em;"|0...65535
 
|width="70px" style="padding-left:0.5em;"|0...65535
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|сохраняемое значение.
+
|style="padding-left:0.5em;"|stored value.
 
|}
 
|}
 
|}
 
|}
  
Ниже приведено описание допустимых значений регистров чтения энергонезависимой памяти контроллера. Они используются для сохранения информации в ячейках ЭНП.
+
Below is a description of acceptable values controller non-volatile memory read registers. They are used to restore information from the NVRAM cells.
  
 
{|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"|Address
!Возвоащаемые значения
+
!Return values
 
|- valign="top"
 
|- valign="top"
 
|
 
|
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|Регистр чтения энергонезависимой памяти №00
+
|style="padding-left:0.5em;"|EEPROM Get Cell 00
 
|- valign="top"
 
|- valign="top"
 
|style="padding-left:0.5em;"|...
 
|style="padding-left:0.5em;"|...
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|Регистр чтения энергонезависимой памяти №63
+
|style="padding-left:0.5em;"|EEPROM Get Cell 63
 
|}
 
|}
 
|valign="top"|
 
|valign="top"|
Line 58: Line 63:
 
|width="70px" style="padding-left:0.5em;"|0...65535
 
|width="70px" style="padding-left:0.5em;"|0...65535
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|хранимое значение.
+
|style="padding-left:0.5em;"|stored value.
 
|}
 
|}
 
|}
 
|}
 +
<br clear="all">
  
Пример функциональной диаграммы работы с ячейками энергонезависимой памяти.
+
== Examples ==
 +
 
 +
An example of a functional diagram with non-volatile memory cells.
  
 
[[File:6_15_2_1.png|center|900px]]
 
[[File:6_15_2_1.png|center|900px]]
  
Количество нажатий кнопки, подключенной к каналу №0 контроллера, суммируется с ранее сохраненными в именованной сети «счетчик» значениями. Значение сети «счетчик» сохраняется в энергонезависимой памяти при отпускании кнопки. После выключения и восстановления питания контроллера, сохраненное в ячейке энергонезависимой памяти значение автоматически читается и передается обратно в именованную сеть «счетчик». Таким образом удается избежать потери информации о количестве нажатий на данную кнопку при отключении питания контроллера.
+
The number of keystrokes connected to channel No. 0 of the controller is summed with the value of the "counter" previously stored in the named network. At the moment of releasing the buttons, the value of the network "counter" of memory in cell No. 0 of the controller's non-volatile memory. After the controller power is turned off and restored, the value stored in the nonvolatile memory cell reads and transfers the value back to the named network counter. Thus, in order to avoid the loss of information on the number of operations to cut off electricity.
 
+
{|
+
|valign="top" style="padding-left:0.5em;"|''Примечание:''
+
|valign="top" style="padding-left:0.5em;"|''Процесс сохранения данных в ЭНП требует времени, т. е. не происходит мгновенно.''
+
|}
+
 
+
{|
+
|valign="top" style="padding-left:0.5em;"|''Примечание:''
+
|valign="top" style="padding-left:0.5em;"|''Количество циклов перезаписи информации в энергонезависимой памяти ограничено. Драйвер работы с памятью CANNY7 организован таким образом, что ее ресурс существенно увеличен. Тем не менее, избегайте постоянного сохранения в ЭНП ненужных данных или сохранения данных на каждом цикле выполнения диаграммы, выполняйте сохранение информации по определенному условию (смотри пример выше).''
+
|}
+
  
== Смотри также ==
+
== See also ==
 
[[CANNY 7]]
 
[[CANNY 7]]
  
[[CANNY 7, User Preprogrammed Parameters|User Preprogrammed Parameters]]
+
[[CANNY 7, User Preprogrammed Parameters]]

Latest revision as of 19:34, 16 June 2017

General description

To eliminate loss of critical information (state of the controller, external devices status, and so on..) I case of power reset , CANNY7 controller equipped with non-volatile memory. The values saved in EEPROM will be available in special registers after the power is restored.

There are 64 16-bit non-volatile memory cells, which are accessed by corresponding read and write registers.

Note: Working with non-volatile memory does not require any special pre-configuration. However, in order to avoid loss of information, make sure that all the time between writing new values, the value in the write register of the used non-volatile memory cell is read from the read register of the same cell. See the example.
Note: Changing the value in a nonvolatile memory cell will increase the execution time of the chart cycle at which it occurred for several milliseconds.

Nonvolatile memory registers

Below is a description of permissible values of controller nonvolatile memory setup registers. They are used to store information in the NVRAM cells.

Address Expected values
EEPROM Set Cell 00
...
EEPROM Set Cell 63
0...65535 = stored value.

Below is a description of acceptable values controller non-volatile memory read registers. They are used to restore information from the NVRAM cells.

Address Return values
EEPROM Get Cell 00
...
EEPROM Get Cell 63
0...65535 = stored value.


Examples

An example of a functional diagram with non-volatile memory cells.

6 15 2 1.png

The number of keystrokes connected to channel No. 0 of the controller is summed with the value of the "counter" previously stored in the named network. At the moment of releasing the buttons, the value of the network "counter" of memory in cell No. 0 of the controller's non-volatile memory. After the controller power is turned off and restored, the value stored in the nonvolatile memory cell reads and transfers the value back to the named network counter. Thus, in order to avoid the loss of information on the number of operations to cut off electricity.

See also

CANNY 7

CANNY 7, User Preprogrammed Parameters