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"

From CANNY Wiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
(General description)
(IRRC driver registers)
 
(8 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
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 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 ===
  
Для работы контроллера CANNY7 с приемниками и передатчиками ИК-сигналов может использоваться любой из его каналов ввода-вывода, при этом тот или иной канал контроллера, в каждый отдельный момент, может работать либо только на прием, либо только на передачу.
+
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.
Драйвер пульта ИК ДУ предусматривает возможность организации одновременного приема и передачи данных по двум независимым каналам. Кроме того, возможно подключение к CANNY7 нескольких приемников/передатчиков ИК-сигналов.
+
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.
 
{|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 Mode Setup Register
 
|}
 
|}
 
|valign="top"|
 
|valign="top"|
Line 28: Line 28:
 
|width="70px" style="padding-left:0.5em;"|1...65535
 
|width="70px" style="padding-left:0.5em;"|1...65535
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|установить конфигурацию канала драйвера пульта ИК ДУ контроллера, определяющую текущий режим и параметры его работы (задается специальной константой из справочника констант);
+
|style="padding-left:0.5em;"|to set IR RC channel driver configuration that determines the current mode and the parameters of its operation (set special constant of constants reference book);
 
|- 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;"|disconnect the channel from IR RC driver, return control to IO channel driver and allow changing its status from the functional diagram.
 
|}
 
|}
 
|- 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;"|Регистр номера канала приема ИК-порта
+
|style="padding-left:0.5em;"|IRRC Receive IO Channel Select Register
 
|}
 
|}
 
|valign="top"|
 
|valign="top"|
Line 45: Line 45:
 
|width="70px" style="padding-left:0.5em;"|0...10
 
|width="70px" style="padding-left:0.5em;"|0...10
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|установить номер канала контроллера, используемый драйвером пульта ИК ДУ для приема данных.
+
|style="padding-left:0.5em;"|to set the channel number used by IR RC driver for receiving data.
 
|}
 
|}
 
|- 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;"|Регистр номера канала передачи ИК-порта
+
|style="padding-left:0.5em;"|IRRC Transmit IO Channel Select Register
 
|}
 
|}
 
|valign="top"|
 
|valign="top"|
Line 58: Line 58:
 
|width="70px" style="padding-left:0.5em;"|0...10
 
|width="70px" style="padding-left:0.5em;"|0...10
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|установить номер канала контроллера, используемый драйвером пульта ИК ДУ для передачи данных.
+
|style="padding-left:0.5em;"|to set the channel number used by IR RC driver for transmitting data.
 
|}
 
|}
 
|}
 
|}
  
 
{|
 
{|
|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 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.
  
 
{|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"|Parameter
!Перечень допустимых значений
+
!List of expected values
 
|- valign="top"
 
|- valign="top"
|Стандарт
+
|Standart
 
|NEC
 
|NEC
 
|- valign="top"
 
|- valign="top"
|Направление потока данных
+
|The data flow direction
|Прием, передача, прием и передача
+
|Receive, transmit, receive and transmit
 
|- valign="top"
 
|- valign="top"
|Тип сигнала
+
|Signal type
|Прямой («1»: плюс, «0»: минус), инверсный («1»: минус, «0»: плюс)
+
|Direct ("1": plus, "0" minus), inverse ("1" minus "0": plus)
 
|- valign="top"
 
|- valign="top"
|Внутренняя подтяжка
+
|Internal pull-up
|Без подтяжки, подтяжка плюс, подтяжка минус
+
|No pull-up, positive pull-up, negative pull-up
 
|}
 
|}
  
Пример конфигурации драйвера пульта ИК ДУ контроллера для работы в качестве приемника/передатчика ИК-сигналов, при этом для приема данных используется канал №0, а для передачи - канал №1.
+
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.
  
 
[[File:6_16_2_1.png|center]]
 
[[File:6_16_2_1.png|center]]
  
Регистры диагностики драйвера пульта ИК ДУ.
+
IRRC driver diagnostic 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 Idle Register
 
|}
 
|}
 
|valign="top"|
 
|valign="top"|
Line 107: Line 107:
 
|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;"|there is no activity on the corresponding channel of the IRRC driver;
 
|- 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;"|activity is registered on the corresponding channel of the IRRC driver.
 
|}
 
|}
 
|- 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;"|Регистр переполнения буфера драйвера ИК
+
|style="padding-left:0.5em;"|IRRC Overflow Register
 
|}
 
|}
 
|valign="top"|
 
|valign="top"|
Line 124: Line 124:
 
|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;"|IRRC driver corresponding channel buffer overflow;
 
|- 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;"|IRRC driver corresponding channel buffer overflow not registered.
 
|}
 
|}
 
|- 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;"|буфер передачи данных драйвера пульта ИК ДУ свободен и готов к работе;
+
|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;"|буфер передачи данных драйвера пульта ИК ДУ занят.
+
|style="padding-left:0.5em;"|IRRC driver data transmission buffer is busy.
 
|}
 
|}
 
|}
 
|}
  
Регистры приема драйвера пульта ИК ДУ.
+
IRRC driver receive 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
!Возвращаемые значения
+
!Return 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 Data Set Ready Register
 
|}
 
|}
 
|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;"|Регистр принятого сообщения ИК b1:b0
+
|style="padding-left:0.5em;"|IRRC Received Data Register D1:D0
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|Регистр принятого сообщения ИК b3:b2
+
|style="padding-left:0.5em;"|IRRC Received Data Register 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;"|Регистр сообщения передачи ИК b1:b0
+
|style="padding-left:0.5em;"|IRRC Transmit Data Register D1:D0
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|Регистр сообщения передачи ИК b3:b2
+
|style="padding-left:0.5em;"|IRRC Transmit Data Register 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.
 
|}
 
|}
 
|}
 
|}
  
Специальная команда стандарта NEC – «повтор команды», кодируется значениями b1:b0 = 0xFFFF  и b3:b2 = 0xFFFF как при приеме так и при передаче.
+
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;"|''При отправке ИК-сообщений, каждая последующая команда должна передаваться только после освобождения буфера передачи, т. е. при наличии в регистре готовности буфера передачи ИК-сообщения значения «1». Команда повтора предыдущей команды должна отправляться сразу после отправки основной команды, не дожидаясь освобождения буфера передачи, при этом отправка должна выполняться непрерывно, как можно чаще, все время, пока требуется передача подтверждения.''
+
|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]]
  
Контроллер ожидает получения сообщения, содержащего номер адреса 0х00 и команду с кодом 0х01. Проверка полученных от пульта ИК ДУ команд на соответствие ожидаемым выполняется путем их сравнения с константами, содержащими в младшем байте требуемое значение, а в старшем — его инверсную версию.
+
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.
  
Пример функциональной диаграммы эмуляции контроллером CANNY7 ИК-пульта ДУ, т.е. передачи ИК-команд управляемому устройству.
+
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]]
  
При появлении на входе канала №10 значения «1» (нажатия управляющей кнопки), контроллер отправляет ИК-сообщение внешнему устройству. В сообщении содержится адрес 0хAB и команда 0хCD. При длительном сохранении значения «1» на входе канала №10 (удержании кнопки) контроллер отправляет сообщение стандарта NEC «повтор команды». Специальная команда стандарта NEC – «повтор команды», кодируется значениями b1:b0 = 0xFFFF  и b3:b2 = 0xFFFF как при приеме так и при передаче.
+
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;"|''В примере отправки ИК-сообщения также реализовано использование CANNY7 для формирования несущего высокочастотного сигнала установленного стандартом NEC, с помощью канала №1 контроллера работающего в режиме ВЧ ШИМ с периодом 26мкс и заполнением 9мкс.''
+
|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 ==
 
[[CANNY 7]]
 
[[CANNY 7]]

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
IRRC Mode Setup Register
1...65535 = to set IR RC channel driver configuration that determines the current mode and the parameters of its operation (set special constant of constants reference book);
0 = disconnect the channel from IR RC driver, return control to IO channel driver and allow changing its status from the functional diagram.
IRRC Receive IO Channel Select Register
0...10 = to set the channel number used by IR RC driver for receiving data.
IRRC Transmit IO Channel Select Register
0...10 = to set the channel number used by IR RC driver for transmitting data.
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.

6 16 2 1.png

IRRC driver diagnostic registers.

Address Expected values
IRRC Idle Register
1 = there is no activity on the corresponding channel of the IRRC driver;
0 = activity is registered on the corresponding channel of the IRRC driver.
IRRC Overflow Register
1 = IRRC driver corresponding channel buffer overflow;
0 = IRRC driver corresponding channel buffer overflow not registered.
IRRC Ready To Send Register
1 = IRRC driver data transmission buffer is empty and ready to go;
0 = IRRC driver data transmission buffer is busy.

IRRC driver receive registers.

Address Return values
IRRC Data Set Ready Register
1 = the message was successfully received and is available in IRRC driver receiving registers buffer;
0 = there is no actual data in the IRRC driver receive buffer.
IRRC Received Data Register D1:D0
IRRC Received Data Register D3:D2
0...65535 = the values of the corresponding data bytes in the IRRC driver receive buffer, two bytes by the register.

IRRC driver transmit registers.

Address Expected values
IRRC Request To Send
1 = load the data from the transfer registers to the IRRC driver transmit buffer;
0 = do not load the data from the transfer registers to the IRRC driver transmit buffer.
IRRC Transmit Data Register D1:D0
IRRC Transmit Data Register D3:D2
0...65535 = 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.

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.

6 16 2 2.png

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.

6 16 2 3.png

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.

See also

CANNY 7