Counters
Cnt_Get_PW_HL
ADwin
116
ADwin-Gold II
, Manual February 2013
Cnt_Get_PW_HL
Cnt_Get_PW_HL
returns a stored high and low time of a PWM counter.
Syntax
#Include
ADwinGoldII.inc / GoldIITiCo.inc
Cnt_Get_PW_HL
(
pwm_no
,
hightime
,
lowtime
)
Parameters
Notes
The return values are given in the parameters
hightime
and
lowtime
.
See also
,
,
,
Valid for
Gold II-CNT
Example
Rem Please select the appropriate include for ADbasic /
TiCoBasic
#Include
ADwinGoldII.inc
'for ADbasic
Rem #Include GoldIITiCo.inc 'for TiCoBasic
Dim
old_1
,
new_1
As
Long
Dim
old_2
,
new_2
As
Long
Init:
old_
1
=
0
'initialize
old_2
=
0
Cnt_SE_Diff
(
0
)
'all counters single ended (TTL)
Cnt_Mode
(
1
,
0
)
'Counter 1: PWM at input A
Cnt_Mode
(
2
,
0
)
'Counter 2: PWM at input A
Cnt_Enable
(
1100000000b
)
'start PWM counters 1+2
Event:
Cnt_PW_Latch
(
11b
)
'latch both counters 1+2
Cnt_Get_PW_HL
(
1
,
Par_1
,
Par_2
)
'read high/low time
Cnt_Get_PW
(
1
,
FPar_1
,
FPar_2
)
'read frequency./duty cycle
T11 TiCo
pwm_no
Number (1…4) of PWM counter.
LONG
hightime
Pulse duration in units of 10 ns: PWM high level
time.
LONG
CONST
lowtime
Pulse period in units of 10ns: PWM low level time.
LONG
CONST