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 21: | Line 21: | ||
{|border="0" align="left" | {|border="0" align="left" | ||
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"|IRRC Mode | + | |style="padding-left:0.5em;"|IRRC Mode Setup Register |
|} | |} | ||
|valign="top"| | |valign="top"| | ||
Line 38: | Line 38: | ||
{|border="0" align="left" | {|border="0" align="left" | ||
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"|IRRC | + | |style="padding-left:0.5em;"|IRRC Receive IO Channel Select Register |
|} | |} | ||
|valign="top"| | |valign="top"| | ||
Line 51: | Line 51: | ||
{|border="0" align="left" | {|border="0" align="left" | ||
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"|IRRC | + | |style="padding-left:0.5em;"|IRRC Transmit IO Channel Select Register |
|} | |} | ||
|valign="top"| | |valign="top"| | ||
Line 100: | Line 100: | ||
{|border="0" align="left" | {|border="0" align="left" | ||
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"| | + | |style="padding-left:0.5em;"|IRRC Idle Register |
|} | |} | ||
|valign="top"| | |valign="top"| | ||
Line 117: | Line 117: | ||
{|border="0" align="left" | {|border="0" align="left" | ||
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"|IRRC | + | |style="padding-left:0.5em;"|IRRC Overflow Register |
|} | |} | ||
|valign="top"| | |valign="top"| | ||
Line 134: | Line 134: | ||
{|border="0" align="left" | {|border="0" align="left" | ||
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"| | + | |style="padding-left:0.5em;"|IRRC Ready To Send Register |
|} | |} | ||
|valign="top"| | |valign="top"| | ||
Line 141: | Line 141: | ||
|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;"|IRRC driver data | + | |style="padding-left:0.5em;"|IRRC driver data transmission buffer is empty and ready to go; |
|- 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;"|IRRC driver data | + | |style="padding-left:0.5em;"|IRRC driver data transmission buffer is busy. |
|} | |} | ||
|} | |} | ||
Line 158: | Line 158: | ||
{|border="0" align="left" | {|border="0" align="left" | ||
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"|IRRC Data | + | |style="padding-left:0.5em;"|IRRC Data Set Ready Register |
|} | |} | ||
|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;"|IRRC | + | |style="padding-left:0.5em;"|IRRC Received Data Register D1:D0 |
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"|IRRC | + | |style="padding-left:0.5em;"|IRRC Received Data Register D3:D2 |
|} | |} | ||
|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;"|IRRC | + | |style="padding-left:0.5em;"|IRRC Transmit Data Register D1:D0 |
|- valign="top" | |- valign="top" | ||
− | |style="padding-left:0.5em;"|IRRC | + | |style="padding-left:0.5em;"|IRRC Transmit Data Register D3:D2 |
|} | |} | ||
|valign="top"| | |valign="top"| |
Latest revision as of 15:13, 11 September 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. |