This documentation is out of date.
The new version of the documentation is here: https://cannylogic.com/docs |
Difference between revisions of "CANNY 7.2 duo, System Registers"
[checked revision] | [checked revision] |
(Created page with "== General description == System resources are divided into an address group of read registers and an address group of write registers. Referring to the given registers from...") |
(→Hibernation) |
||
Line 96: | Line 96: | ||
<br clear="all"> | <br clear="all"> | ||
− | == | + | == Function Diagram actual run time == |
− | + | The time required for the controller to perform functional diagram in actual conditions depends on the number and type of functional blocks present in the diagram, the number of drivers involved in the system software and their activity. In practice, CANNY 7.2 duo execution cycle of a diagram contains about 450 function blocks and is actively interacting with CAN driver, lasts approximately 5 ms. | |
− | + | {| | |
+ | |valign="top" style="padding-left:0.5em;"|''Note:'' | ||
+ | |valign="top" style="padding-left:0.5em;"|''When creating a functional diagram, the effect of execution loop duration should be considered. The effect is reflected in the fact that the increment of functional blocks time counters- start/stop delays and PWM generators occurs abruptly. Thus, when the actual cycle length of 5ms, all PWM generators actual period on the diagram is a multiple of 5ms.'' | ||
+ | |} | ||
+ | Information about the length of functional diagram previous execution cycle is available at "Last Execution Loop Duration Register". | ||
{|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"|Address | !width="250px"|Address | ||
− | ! | + | !Return Values |
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"| | + | |style="padding-left:0.5em;"|Last Execution Loop Duration Register |
| | | | ||
{|border="0" align="left" | {|border="0" align="left" | ||
|- valign="top" | |- valign="top" | ||
− | |width="70px" style="padding-left:0.5em;"| | + | |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;"|length of functional diagram previous execution cycle in integer fractions of milliseconds. |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|} | |} | ||
|} | |} | ||
− | + | The most accurate way to measure the total time of the controller operation, such as the implementation of the clock is the summation with accumulation of the values obtained at "Last Execution Loop Duration Register" during each execution cycle of functional diagram. | |
− | + | ||
− | + | ||
− | + | A fragment of a functional diagram that implements a high-precision seconds counter is suitable for use in real-time clock: | |
− | + | ||
− | + | [[File:17_5_6_1.PNG]] | |
− | + | ||
+ | == Device ID == | ||
+ | |||
+ | In the manufacture of CANNY 7.2 duo controllers, each of them is assigned its own identification number, which can be used later in the development of user diagrams to further protect them from unauthorized use. | ||
− | + | Access to the device identifier is carried out via relevant special system registers. | |
{|border="1" style="border-collapse:collapse;" align="left" width="100%" | {|border="1" style="border-collapse:collapse;" align="left" width="100%" | ||
Line 138: | Line 139: | ||
!Return Values | !Return Values | ||
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"| | + | |style="padding-left:0.5em; padding-right:0.5em;"|Device ID Register D1:D0 |
− | | | + | |valign="top"| |
{|border="0" align="left" | {|border="0" align="left" | ||
|- valign="top" | |- valign="top" | ||
− | |width="70px" style="padding-left:0.5em;"| | + | |width="70px" style="padding-left:0.5em;"|0...0xFFFF |
|style="padding-left:0.5em;"|= | |style="padding-left:0.5em;"|= | ||
− | |style="padding-left:0.5em;"|controller | + | |style="padding-left:0.5em;"|Lover two bites (D1 & D0) controller ID; |
+ | |} | ||
|- valign="top" | |- valign="top" | ||
− | |width="70px" style="padding-left:0.5em;"|0 | + | |style="padding-left:0.5em; padding-right:0.5em;"|Device ID Register D3:D2 |
+ | |valign="top"| | ||
+ | {|border="0" align="left" | ||
+ | |- valign="top" | ||
+ | |width="70px" style="padding-left:0.5em;"|0...0xFFFF | ||
|style="padding-left:0.5em;"|= | |style="padding-left:0.5em;"|= | ||
− | |style="padding-left:0.5em;"|controller | + | |style="padding-left:0.5em;"|Upper two bites (D3 и D2) controller ID. |
|} | |} | ||
|} | |} | ||
+ | <br clear="all"> | ||
− | {| | + | During custom diagram development in CannyLab, the device ID, can be found by accessing device information available in the section "Device" → "Information" of main menu or by clicking the "Information" toolbar, where it is represented in 4-byte (32-bit) number, with the location of the high byte on the left. |
− | |valign="top" style="padding-left:0.5em;"| | + | |
− | |valign="top" style="padding-left:0.5em;"| | + | For example, the identifier 0x563B8693 as followed: Device ID Register D1:D0 is equal to 0x8693, Device ID register D3:D2 is 0x563B. |
+ | |||
+ | Example - functional diagram illustrating an operation with the device identifier. In the diagram a value read from device identification registers is compared with the given and if they match, the network will display "ID is correct" saved "1". | ||
+ | |||
+ | [[File:17_5_7_1.PNG]] | ||
+ | |||
+ | == Vendor ID == | ||
+ | |||
+ | In the manufacture of CANNY 7.2 duo controllers, each of them is assigned an identification number of their vendor (supplier), which can be used later in the development of user diagrams to further protect them from unauthorized use. | ||
+ | |||
+ | The device vendor identifier assigned by the controller manufacturer is the same for all controllers intended for one counterparty, or can be installed separately on a specific batch of controllers. To manufacture controllers with a specific vendor identifier, you must contact the manufacturer. | ||
+ | |||
+ | Access to the vendor identifier is carried out via relevant special system register. | ||
+ | |||
+ | {|border="1" style="border-collapse:collapse;" align="left" width="100%" | ||
+ | |- align="center" valign="top" | ||
+ | !width="250px"|Address | ||
+ | !Return Values | ||
+ | |- valign="top" | ||
+ | |style="padding-left:0.5em; padding-right:0.5em;"|Device Vendor ID Register | ||
+ | |valign="top"| | ||
+ | {|border="0" align="left" | ||
+ | |- valign="top" | ||
+ | |width="70px" style="padding-left:0.5em;"|0...0xFFFF | ||
+ | |style="padding-left:0.5em;"|= | ||
+ | |style="padding-left:0.5em;"|the value of the individual vendor identification number; | ||
+ | |} | ||
|} | |} | ||
+ | <br clear="all"> | ||
− | + | During custom diagram development in CannyLab, the device ID, can be found by accessing device information available in the section "Device" → "Information" of main menu or by clicking the "Information" toolbar, where it is represented in 2-byte (16-bit) number, with the location of the high byte on the left. | |
− | + | Example - functional diagram illustrating an operation with the device vendor identifier. In the diagram a value read from device identification vendor registers is compared with the given and if they match, the network will display "VID is correct" saved "1". | |
− | {| | + | [[File:17_5_8_1.PNG]] |
− | |valign="top" style="padding-left:0.5em;"| | + | |
− | |valign="top" style="padding-left:0.5em;"| | + | == Interfaces Activity Control Register == |
+ | |||
+ | ''"Interfaces Activity Control Register"'' - a synthetic register that show the current activity of the external interfaces of the controller present in the user diagram, or activated in the counter mode / the active input mode of the input-output channels. At those times when no signals are received or transmitted via the CAN, LIN, UART controller’s user interfaces and/or no changes in the electric potential occur on the controller contacts corresponding to the active input channels, the value ''"Interfaces Activity Control Register"'' contains "0". | ||
+ | |||
+ | The use of this register is convenient in the algorithms for controlling the [[CANNY 7.2 duo, Системные ресурсы и режимы работы#Режим пониженного энергопотребления|energy consumption]] of the controller. | ||
+ | |||
+ | {|border="1" style="border-collapse:collapse;" align="left" width="100%" | ||
+ | |- align="center" valign="top" | ||
+ | !width="250px"|Регистр | ||
+ | !Возвращаемые значения | ||
+ | |- valign="top" | ||
+ | |style="padding-left:0.5em;"|Interfaces Activity Control Register | ||
+ | | | ||
+ | {|border="0" align="left" | ||
+ | |- valign="top" | ||
+ | |width="70px" style="padding-left:0.5em;"|≥ 1 | ||
+ | |style="padding-left:0.5em;"|= | ||
+ | |style="padding-left:0.5em;"|during the previous diagram execution cycle, activity was detected on one or more interfaces or active input-output channels used on the diagram; | ||
+ | |- valign="top" | ||
+ | |width="70px" style="padding-left:0.5em;"|0 | ||
+ | |style="padding-left:0.5em;"|= | ||
+ | |style="padding-left:0.5em;"|during the previous diagram execution cycle, no activity was detected on one or more interfaces or active input-output channels used on the diagram. | ||
|} | |} | ||
+ | |} | ||
+ | <br clear="all"> | ||
+ | |||
+ | <!--NOPDF--> |
Revision as of 16:45, 19 August 2019
Contents
General description
System resources are divided into an address group of read registers and an address group of write registers. Referring to the given registers from the functional diagram, you can get demanding information for practical application about the current status of the controller, and control its operation mode. The set of system registers located in the "System Registers" directory of CannyLab IDE registers list, which is available via "Input Register" and "Output Register" context menu.
Reset controller
Controller reset occurs as a result of any of the three events: when power up the controller, soft reset from the functional diagram. The controller is initialized after reset: the entire memory contents is cleared, input-output channels are reset to a neutral state, system software drivers are transferred to the initial state, power consumption is set to normal, a functional diagram execution starts from the beginning. The non-volatile memory content does not change at reset.
Information about the reset is available by accessing the address "Power On Detect Register"
Address | Return Values | ||||||
---|---|---|---|---|---|---|---|
Power On Detect Register |
|
Forced reset of the controller is performed by writing a nonzero value to "Reset Register" address. In this case, the controller reset takes place immediately after the end of the execution cycle of functional diagram, in which there was such a record.
Address | Expected values | ||||||
---|---|---|---|---|---|---|---|
Reset Register |
|
Built-in LED
The controller has a built-in bi-color (green/red) LED. The functional diagram controls switching-on of each color by writing specific values into the appropriate registers.
Address | Expected values | ||||||
---|---|---|---|---|---|---|---|
Green LED On/Off Register |
| ||||||
Red LED On/Off Register |
|
Note: | Turning the LED simultaneously in both colors is unavailable, so if functional diagram set simultaneous switching on of Red and Green LEDs, the LED turns green only (green priority). |
A functional diagram fragment, which turns on built-in Green LED for one second after each controller reset.
Function Diagram actual run time
The time required for the controller to perform functional diagram in actual conditions depends on the number and type of functional blocks present in the diagram, the number of drivers involved in the system software and their activity. In practice, CANNY 7.2 duo execution cycle of a diagram contains about 450 function blocks and is actively interacting with CAN driver, lasts approximately 5 ms.
Note: | When creating a functional diagram, the effect of execution loop duration should be considered. The effect is reflected in the fact that the increment of functional blocks time counters- start/stop delays and PWM generators occurs abruptly. Thus, when the actual cycle length of 5ms, all PWM generators actual period on the diagram is a multiple of 5ms. |
Information about the length of functional diagram previous execution cycle is available at "Last Execution Loop Duration Register".
Address | Return Values | |||
---|---|---|---|---|
Last Execution Loop Duration Register |
|
The most accurate way to measure the total time of the controller operation, such as the implementation of the clock is the summation with accumulation of the values obtained at "Last Execution Loop Duration Register" during each execution cycle of functional diagram.
A fragment of a functional diagram that implements a high-precision seconds counter is suitable for use in real-time clock:
Device ID
In the manufacture of CANNY 7.2 duo controllers, each of them is assigned its own identification number, which can be used later in the development of user diagrams to further protect them from unauthorized use.
Access to the device identifier is carried out via relevant special system registers.
Address | Return Values | |||
---|---|---|---|---|
Device ID Register D1:D0 |
| |||
Device ID Register D3:D2 |
|
During custom diagram development in CannyLab, the device ID, can be found by accessing device information available in the section "Device" → "Information" of main menu or by clicking the "Information" toolbar, where it is represented in 4-byte (32-bit) number, with the location of the high byte on the left.
For example, the identifier 0x563B8693 as followed: Device ID Register D1:D0 is equal to 0x8693, Device ID register D3:D2 is 0x563B.
Example - functional diagram illustrating an operation with the device identifier. In the diagram a value read from device identification registers is compared with the given and if they match, the network will display "ID is correct" saved "1".
Vendor ID
In the manufacture of CANNY 7.2 duo controllers, each of them is assigned an identification number of their vendor (supplier), which can be used later in the development of user diagrams to further protect them from unauthorized use.
The device vendor identifier assigned by the controller manufacturer is the same for all controllers intended for one counterparty, or can be installed separately on a specific batch of controllers. To manufacture controllers with a specific vendor identifier, you must contact the manufacturer.
Access to the vendor identifier is carried out via relevant special system register.
Address | Return Values | |||
---|---|---|---|---|
Device Vendor ID Register |
|
During custom diagram development in CannyLab, the device ID, can be found by accessing device information available in the section "Device" → "Information" of main menu or by clicking the "Information" toolbar, where it is represented in 2-byte (16-bit) number, with the location of the high byte on the left.
Example - functional diagram illustrating an operation with the device vendor identifier. In the diagram a value read from device identification vendor registers is compared with the given and if they match, the network will display "VID is correct" saved "1".
Interfaces Activity Control Register
"Interfaces Activity Control Register" - a synthetic register that show the current activity of the external interfaces of the controller present in the user diagram, or activated in the counter mode / the active input mode of the input-output channels. At those times when no signals are received or transmitted via the CAN, LIN, UART controller’s user interfaces and/or no changes in the electric potential occur on the controller contacts corresponding to the active input channels, the value "Interfaces Activity Control Register" contains "0".
The use of this register is convenient in the algorithms for controlling the energy consumption of the controller.
Регистр | Возвращаемые значения | ||||||
---|---|---|---|---|---|---|---|
Interfaces Activity Control Register |
|