Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
f573feba
Commit
f573feba
authored
Sep 10, 2020
by
Guido Visser
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Funtion added to stop the PI.
parent
0b64993c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
26 deletions
+16
-26
spll_main.c
softpll/spll_main.c
+16
-26
No files found.
softpll/spll_main.c
View file @
f573feba
...
...
@@ -11,7 +11,7 @@
#include <wrc.h>
#include "softpll_ng.h"
#include <TuneGuido.h>
//
#include <TuneGuido.h>
#define MPLL_TAG_WRAPAROUND 100000000
...
...
@@ -32,6 +32,7 @@ void mpll_init(struct spll_main_state *s, int id_ref,
s
->
pi
.
anti_windup
=
1
;
s
->
pi
.
bias
=
30000
;
s
->
pi
.
shift
=
PI_FRACBITS
;
#if defined(CONFIG_WR_SWITCH)
if
(
spll_ljd_present
)
{
s
->
pi
.
kp
=
2000
;
...
...
@@ -46,9 +47,10 @@ void mpll_init(struct spll_main_state *s, int id_ref,
#elif defined(CONFIG_WR_NODE) && defined(CONFIG_TARGET_SPEC7)
// s->pi.kp = -800; // / 2;
// s->pi.ki = -10; // / 2;
s
->
pi
.
kp
=
-
3000
;
// / 2;
s
->
pi
.
ki
=
-
10
;
// / 2;
s
->
pi
.
kd
=
0
;
// is not nessary...
s
->
pi
.
kp
=
-
4000
*
16
;;
// / 2;
s
->
pi
.
ki
=
-
5
*
16
;;
// / 2;
s
->
pi
.
shift
=
20
;
s
->
pi
.
setblock
=
0
;
#else
#error "Please set CONFIG for wr switch or wr node"
...
...
@@ -174,7 +176,7 @@ int mpll_update(struct spll_main_state *s, int tag, int source)
if
(
!
s
->
enabled
)
return
SPLL_LOCKED
;
int
err
,
y
;
int
err
,
y
,
VtuneHoldVal
;
if
(
source
==
s
->
id_ref
)
s
->
tag_ref
=
tag
;
...
...
@@ -223,27 +225,15 @@ int mpll_update(struct spll_main_state *s, int tag, int source)
if
(
s
->
pi
.
disablecontrol
==
0
)
{
// when pi.disablecontrol == 0 the last PI val is repeated to test how much the OCXO drifts away yes is ugly...
y
=
VtuneHoldVal
;
}
else
{
y
=
pi_update
((
spll_pi_t
*
)
&
s
->
pi
,
err
);
VtuneHoldVal
=
y
;
// for (k=0; k<15; k++)
// {
// ring_buffer[15]=y;
// }
// k=0;
}
// for
// Y = (coeffsLPF[k])*(ring_buffer[(k+rb_idx)%FilterSize]);
SPLL
->
DAC_MAIN
=
SPLL_DAC_MAIN_VALUE_W
(
y
)
|
SPLL_DAC_MAIN_DAC_SEL_W
(
s
->
dac_index
);
if
(
s
->
dac_index
==
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment