This documentation is out of date.
The new version of the documentation is here: https://cannylogic.com/docs |
Difference between revisions of "CANNY 7, IRRC Driver"
[unchecked revision] | [unchecked revision] |
(→IRRC driver registers) |
(→IRRC driver registers) |
||
Line 158: | Line 158: | ||
{|border="0" align="left" | {|border="0" align="left" | ||
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"| | + | |style="padding-left:0.5em;"|IRRC Data Received |
|} | |} | ||
|valign="top"| | |valign="top"| | ||
Line 165: | Line 165: | ||
|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;"| | + | |style="padding-left:0.5em;"|the message was successfully received and is available in IRRC driver receiving registers buffer; |
|- valign="top" | |- valign="top" | ||
|width="70px" style="padding-left:0.5em;"|0 | |width="70px" style="padding-left:0.5em;"|0 | ||
|style="padding-left:0.5em;"|= | |style="padding-left:0.5em;"|= | ||
− | |style="padding-left:0.5em;"| | + | |style="padding-left:0.5em;"|there is no actual data in the IRRC driver receive buffer. |
|} | |} | ||
|- valign="top" | |- valign="top" | ||
Line 175: | Line 175: | ||
{|border="0" align="left" | {|border="0" align="left" | ||
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"| | + | |style="padding-left:0.5em;"|IRRC RX D1:D0 |
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"| | + | |style="padding-left:0.5em;"|IRRC RX D3:D2 |
|} | |} | ||
|valign="top"| | |valign="top"| | ||
Line 184: | Line 184: | ||
|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;"|the values of the corresponding data bytes in the IRRC driver receive buffer, two bytes by the register. |
|} | |} | ||
|} | |} | ||
− | + | IRRC driver transmit 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"|Address |
− | ! | + | !Expected values |
|- valign="top" | |- valign="top" | ||
| | | | ||
{|border="0" align="left" | {|border="0" align="left" | ||
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"| | + | |style="padding-left:0.5em;"|IRRC Request To Send |
|} | |} | ||
|valign="top"| | |valign="top"| | ||
Line 204: | Line 204: | ||
|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;"| | + | |style="padding-left:0.5em;"|load the data from the transfer registers to the IRRC driver transmit buffer; |
|- valign="top" | |- valign="top" | ||
|width="70px" style="padding-left:0.5em;"|0 | |width="70px" style="padding-left:0.5em;"|0 | ||
|style="padding-left:0.5em;"|= | |style="padding-left:0.5em;"|= | ||
− | |style="padding-left:0.5em;"| | + | |style="padding-left:0.5em;"|do not load the data from the transfer registers to the IRRC driver transmit buffer. |
|} | |} | ||
|- valign="top" | |- valign="top" | ||
Line 214: | Line 214: | ||
{|border="0" align="left" | {|border="0" align="left" | ||
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"| | + | |style="padding-left:0.5em;"|IRRC TX D1:D0 |
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"| | + | |style="padding-left:0.5em;"|IRRC RX D3:D2 |
|} | |} | ||
|valign="top"| | |valign="top"| | ||
Line 223: | Line 223: | ||
|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;"|the values of IRRC driver message transmit bytes, two bytes per register. |
|} | |} | ||
|} | |} | ||
− | + | Special command of the NEC Standard – «command repeat», coded by values D1:D0 = 0xFFFF and D3:D2 = 0xFFFF as for reception as well as for transmission. | |
{| | {| | ||
− | |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;"|''To send IR messages, each subsequent command should be transferred only after release of the send buffer, ie in the presence of value "1" in the IR TX set ready buffer. The command of Repeat of the previous command should be sent immediately after sending the first command, without waiting for the release of the transmit buffer. wherein sending to be performed continuously, as often as possible, as long as the transfer confirmation required.'' |
|} | |} | ||
− | + | An example of a functional diagram of the controller receiving commands from an external IR remote control. | |
[[File:6_16_2_2.png|center]] | [[File:6_16_2_2.png|center]] | ||
− | + | The controller waits to receive a message containing the address 0х00 and a command code 0х01. Checking commands, received from the IRRC to meet the expected values performed by comparing them with constants, containing in the low byte the desired value, and in the high - its inverted version. | |
− | + | An example of a functional diagram of CANNY7 controller emulating an IR remote, i.e. transmission of IR commands to the controlled device. | |
[[File:6_16_2_3.png|center]] | [[File:6_16_2_3.png|center]] | ||
− | + | During presence of value "1" on the input channel #10 (pressing the control button), controller sends an IR message to an external device. The message contains the address 0хAB and command 0хCD. With prolonged presence of the value "1" at the input channel #10 (holding down button) the controller sends a message in the NEC standard "repeat command". Special command of the NEC Standard – «command repeat», coded by values D1:D0 = 0xFFFF and D3:D2 = 0xFFFF as for reception as well as for transmission. | |
{| | {| | ||
− | |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;"|''In the example of IR message send also implemented the use of CANNY7 to generate a high-frequency carrier signal complain to the NEC Standard, based on controller's channel #1, operating in the HF PWM mode with period 26mks and filling 9mks.'' |
|} | |} | ||
== See also == | == See also == | ||
[[CANNY 7]] | [[CANNY 7]] |
Revision as of 07:12, 13 August 2016
General description
CANNY 7 controller can receive and send infrared remote controls commands (IRRC) in popular formats- NEC and extended NEC. Driver operation is possible in three modes: reception only,transmission only or reception / transmission. For transmission and reception any two channels can be used.
When transmitting infrared remote control commands, channel used for this only generates baseband signal. To generate pulse packet, controller requires a carrier frequency, the source of which can be internal high frequency PWM channel or external PWM generator. Receiving IR command requires an external demodulator, such as TSOP1736 or similar.
IRRC driver in its operation uses the resources of controller channels, but has a higher priority than discrete input-output driver. Thus, upon IRRC driver activation, for the involved channels in its operation, changing values in registers associated controllers' discrete input-output driver will be ignored.
IRRC driver registers
To work with IR signal receivers and transmitters may be used any of CANNY 7 controller IO channels, wherein a particular channel of the controller, at any given moment, can only operate either for reception or transmission only. IR remote control driver provides the possibility to organize simultaneous reception and transmission via two independent channels. Furthermore it is possible to connect several IR signal receivers / transmitters to CANNY 7 controller.
IR RC Driver Configuration Registers.
Address | Expected values | |||||||
---|---|---|---|---|---|---|---|---|
|
| |||||||
|
| |||||||
|
|
Note: | In the configuration of "reception and transmission" separate controller channels must be assigned for receiving and transmitting data. |
Driver configuration is set by named constants, representing the combination of parameters that define the type of signal that determines the electric potentials of the initial state of the channel and the channel conditions during data transmission, and the availability of internal "pull-up" potential of controller channel.
Parameter | List of expected values |
---|---|
Standart | NEC |
The data flow direction | Receive, transmit, receive and transmit |
Signal type | Direct ("1": plus, "0" minus), inverse ("1" minus "0": plus) |
Internal pull-up | No pull-up, positive pull-up, negative pull-up |
Example of configuration IR RC driver to operate as a transmitter / receiver IR signals, wherein channel #0 is used for receiving data, and channel #1 for date transmission.
IRRC driver diagnostic registers.
Address | Expected values | |||||||
---|---|---|---|---|---|---|---|---|
|
| |||||||
|
| |||||||
|
|
IRRC driver receive registers.
Address | Return values | |||||||
---|---|---|---|---|---|---|---|---|
|
| |||||||
|
|
IRRC driver transmit registers.
Address | Expected values | |||||||
---|---|---|---|---|---|---|---|---|
|
| |||||||
|
|
Special command of the NEC Standard – «command repeat», coded by values D1:D0 = 0xFFFF and D3:D2 = 0xFFFF as for reception as well as for transmission.
Note: | To send IR messages, each subsequent command should be transferred only after release of the send buffer, ie in the presence of value "1" in the IR TX set ready buffer. The command of Repeat of the previous command should be sent immediately after sending the first command, without waiting for the release of the transmit buffer. wherein sending to be performed continuously, as often as possible, as long as the transfer confirmation required. |
An example of a functional diagram of the controller receiving commands from an external IR remote control.
The controller waits to receive a message containing the address 0х00 and a command code 0х01. Checking commands, received from the IRRC to meet the expected values performed by comparing them with constants, containing in the low byte the desired value, and in the high - its inverted version.
An example of a functional diagram of CANNY7 controller emulating an IR remote, i.e. transmission of IR commands to the controlled device.
During presence of value "1" on the input channel #10 (pressing the control button), controller sends an IR message to an external device. The message contains the address 0хAB and command 0хCD. With prolonged presence of the value "1" at the input channel #10 (holding down button) the controller sends a message in the NEC standard "repeat command". Special command of the NEC Standard – «command repeat», coded by values D1:D0 = 0xFFFF and D3:D2 = 0xFFFF as for reception as well as for transmission.
Note: | In the example of IR message send also implemented the use of CANNY7 to generate a high-frequency carrier signal complain to the NEC Standard, based on controller's channel #1, operating in the HF PWM mode with period 26mks and filling 9mks. |