This documentation is out of date.

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

Difference between revisions of "CANNY 7, HR PWM Driver"

From CANNY Wiki
Jump to: navigation, search
[unchecked revision][unchecked revision]
(Created page with "=== Общее описание === Два из одиннадцати каналов ввода-вывода (Канал №1 и Канал №2) CANNY 7 поддержив...")
 
(Drivers Registers)
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=== Общее описание ===
+
=== General description ===
  
Два из одиннадцати каналов ввода-вывода (Канал №1 и Канал №2) CANNY 7 поддерживают работу в режиме высокочастотного широтно-импульсного модулятора. Каналы могут быть задействованы независимо друг от друга и иметь независимые настройки скважности сигнала и подтяжки линии, однако, период высокочастотного ШИМ является параметром, общим для обоих каналов. В режиме ВЧ ШИМ, временные параметры ШИМ – период и скважность задаются в диапазоне от 2 до 20000 микросекунд, с шагом 1 микросекунда.
+
CANNY 7 supports high-resolution pulse-width modulator mode for two of twelve IO channels (Channels #1 and #2). This channels may be activated independently of each other and have independent duty cycle and pull-up line configuration. However, the high resolution PWM period is a parameter common to both channels. In HR PWM mode, PWM timing - the period and duty cycle are set in the range from  2 to 20,000 microseconds, in increments of 1 microsecond.
  
В режиме ВЧ ШИМ канал имеет фиксированную полярность импульсов — GND 100мА. Генерация может вестись как в режиме открытого коллектора – подтяжка линии отсутствует или внешняя, так и в режиме с внутренней подтяжкой к +12В (задается установкой значения в соответствующем регистре). В данном режиме канал работает асинхронно функциональной диаграмме, что позволяет добиться максимальной стабильности временных параметров генерируемого сигнала.
+
In HR PWM, the channel has a fixed  pulse polarity - GND 100mA. Generation can be conducted in either open collector  (no pull-up lines or external pull-up) or with internal pull-up to +12V (specified by setting the value in the appropriate register). In this mode, the channel is asynchronous to functional diagram, which allows maximum timing stability of generated signal.
  
Драйвер высокочастотного широтно-импульсного модулятора (ВЧ ШИМ) в своей работе использует ресурсы [[Discrete IO Driver|Discrete Inputs and Outputs]] имея, при этом, более высокий приоритет. Таким образом, при активации драйвера ВЧ ШИМ, используемые им каналы контроллера становятся недоступны для драйвера ввода-вывода.  
+
 
 +
 
 +
The driver of high resolution pulse width modulator (HR PWM) operates using [[CANNY 7, Discrete IO Driver | Discrete Inputs and Outputs]] resources, wherein, having a higher priority. Thus, upon activation of the HR PWM driver, controller channels used are unavailable to input-output drivers.
  
 
{|
 
{|
|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 high resolution pulse width modulator mode, the electrical protection from short circuit is disabled! Overload or channel short-circuit in high resolution PWM mode can lead to controller failure!''
 
|}
 
|}
  
=== Регистры драйвера ===
+
=== Drivers Registers ===
  
Ниже приведено описание допустимых значений регистров управления работой драйвера высокочастотного широтно-импульсного модулятора.
+
The following shows permissible values for control registers of high resolution PWM driver.
  
 
{|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"
|style="padding-left:0.5em;"|Регистр периода ВЧ ШИМ, мкс
+
|style="padding-left:0.5em;"|HR PWM 1 & 2 Period Register, μs
 
|valign="top"|
 
|valign="top"|
 
{|border="0" align="left"
 
{|border="0" align="left"
Line 27: Line 29:
 
|width="70px" style="padding-left:0.5em;"|1...20000
 
|width="70px" style="padding-left:0.5em;"|1...20000
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|задать период в микросекундах генератора ВЧ ШИМ обоих каналов. Значение превышающее 20000 будет принято как 20000.
+
|style="padding-left:0.5em;"|specify the period in microseconds RR PWM generator for both channels. The value in excess of 20,000 will be accepted as 20,000.
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 33: Line 35:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|Регистр активации ВЧ ШИМ 1
+
|style="padding-left:0.5em;"|HR PWM 1 Enable Register
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|Регистр активации ВЧ ШИМ 2
+
|style="padding-left:0.5em;"|HR PWM 2 Enable Register
 
|}
 
|}
 
|
 
|
Line 42: Line 44:
 
|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;"|transfer controller channel in to high resolution pulse width modulator mode;
 
|- 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;"| return controller channel to normal mode.
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 52: Line 54:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|Регистр заполнения ВЧ ШИМ 1, мкс
+
|style="padding-left:0.5em;"|HR PWM 1 Duty Register, μs
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|Регистр заполнения ВЧ ШИМ 2, мкс
+
|style="padding-left:0.5em;"|HR PWM 2 Duty Register, μs
 
|}
 
|}
 
|
 
|
Line 61: Line 63:
 
|width="70px" style="padding-left:0.5em;"|1...20000
 
|width="70px" style="padding-left:0.5em;"|1...20000
 
|style="padding-left:0.5em;"|=
 
|style="padding-left:0.5em;"|=
|style="padding-left:0.5em;"|задать заполнение (скважность) ВЧ ШИМ для канала в микросекундах. Значение превышающее 20000 будет принято как 20000.
+
|style="padding-left:0.5em;"|set HR PWM channel filling (duty cycle) in microseconds. The value in excess of 20,000 will be accepted as 20,000.
 
|}
 
|}
 
|- valign="top"
 
|- valign="top"
Line 67: Line 69:
 
{|border="0" align="left"
 
{|border="0" align="left"
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|Регистр подтяжки к плюсу ВЧ ШИМ 1
+
|style="padding-left:0.5em;"|HR PWM 1 Pull-up Enable Register
 
|- valign="top"
 
|- valign="top"
|style="padding-left:0.5em;"|Регистр подтяжки к плюсу ВЧ ШИМ 2
+
|style="padding-left:0.5em;"|HR PWM 2 Pull-up Enable Register
 
|}
 
|}
 
|
 
|
Line 76: Line 78:
 
|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;"|полярность генерации ВЧ ШИМ для канала [[«МИНУС 100мА»]] / [[«подтяжка плюс»]];
+
|style="padding-left:0.5em;"|HR PWM generation polarity for the channel [[«MINUS 100mA»]] / [[«positive pull-up»]];
 
|- 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;"|полярность генерации ВЧ ШИМ для канала [[«МИНУС 100мА»]] / [[«воздух»]] (режим открытого коллектора).
+
|style="padding-left:0.5em;"|HR PWM generation polarity for the channel [[«MINUS 100mA»]] / [[«air»]] (open collector mode).
 
|}
 
|}
 
|}
 
|}
  
Пример функциональной диаграммы, плавно регулирующей скважность ВЧ ШИМ несущей частотой 10 кГц на канале №1 контроллера, по нажатию/удержанию кнопок подключенных к каналам №9 и №10 контроллера:
+
An example of a functional diagram - continuously adjustable HR PWM duty cycle with carrier frequency  10 kHz on channel #1, by pressing / holding the buttons connected to the channels #9 and #10:
  
 
[[File:6_7_2_1.png|center]]
 
[[File:6_7_2_1.png|center]]
  
== Смотри также ==
+
== See also ==
 
[[CANNY 7]]
 
[[CANNY 7]]
  
[[Discrete IO Driver|Discrete Inputs and Outputs]]
+
[[CANNY 7, Discrete IO Driver]]

Latest revision as of 08:49, 29 November 2016

General description

CANNY 7 supports high-resolution pulse-width modulator mode for two of twelve IO channels (Channels #1 and #2). This channels may be activated independently of each other and have independent duty cycle and pull-up line configuration. However, the high resolution PWM period is a parameter common to both channels. In HR PWM mode, PWM timing - the period and duty cycle are set in the range from 2 to 20,000 microseconds, in increments of 1 microsecond.

In HR PWM, the channel has a fixed pulse polarity - GND 100mA. Generation can be conducted in either open collector (no pull-up lines or external pull-up) or with internal pull-up to +12V (specified by setting the value in the appropriate register). In this mode, the channel is asynchronous to functional diagram, which allows maximum timing stability of generated signal.


The driver of high resolution pulse width modulator (HR PWM) operates using Discrete Inputs and Outputs resources, wherein, having a higher priority. Thus, upon activation of the HR PWM driver, controller channels used are unavailable to input-output drivers.

Note: In high resolution pulse width modulator mode, the electrical protection from short circuit is disabled! Overload or channel short-circuit in high resolution PWM mode can lead to controller failure!

Drivers Registers

The following shows permissible values for control registers of high resolution PWM driver.

Address Expected Values
HR PWM 1 & 2 Period Register, μs
1...20000 = specify the period in microseconds RR PWM generator for both channels. The value in excess of 20,000 will be accepted as 20,000.
HR PWM 1 Enable Register
HR PWM 2 Enable Register
1...65535 = transfer controller channel in to high resolution pulse width modulator mode;
0 = return controller channel to normal mode.
HR PWM 1 Duty Register, μs
HR PWM 2 Duty Register, μs
1...20000 = set HR PWM channel filling (duty cycle) in microseconds. The value in excess of 20,000 will be accepted as 20,000.
HR PWM 1 Pull-up Enable Register
HR PWM 2 Pull-up Enable Register
1...65535 = HR PWM generation polarity for the channel «MINUS 100mA» / «positive pull-up»;
0 = HR PWM generation polarity for the channel «MINUS 100mA» / «air» (open collector mode).

An example of a functional diagram - continuously adjustable HR PWM duty cycle with carrier frequency 10 kHz on channel #1, by pressing / holding the buttons connected to the channels #9 and #10:

6 7 2 1.png

See also

CANNY 7

CANNY 7, Discrete IO Driver