Project

General

Profile

Isdnsync » History » Version 41

laforge, 02/21/2016 10:56 AM

1 1 dexter
2 40 laforge
h2. ISDNsync Reference
3
4
5 1 dexter
Isdnsync was written by Andreas Eversberg. It is a small tool that initalizes a cheap HFC-S ISDN-Card so that bit and framclock are present on 2 IC-Pins. These signals can be used to feed HFC-E1 card with a very exact clock.
6 33 dexter
7 40 laforge
<pre>
8 33 dexter
Usage: ./isdnsync <card>
9 1 dexter
10 33 dexter
Opens given card number in TE-mode PTP and tries to keep layer 2 established.
11 1 dexter
This keeps layer 1 activated to retrieve a steady sync signal from network.
12 40 laforge
</pre>
13 1 dexter
14 33 dexter
15 40 laforge
h2. isdnsync HOWTO
16
17
18 34 laforge
In a state of the art digital telephone network (SDH) everything is syncronized by a central, very high accuracy clock. The BTS also uses this clock for various things like carrier clock, bit clock, etc.  If the carrier clock becomes slightly incorrect (more than 50Hz) the BTS will transmit on a wrong frequency and there will be lots of other effects that might destabilize the radio transmission.
19
20 1 dexter
The BS11 is shipped with a pre-calibrated internal oscillator. If you are lucky the calibration (that is made over 10 years ago) in your BTS is still correct. If not your setup will not work unless you recalibrate the oscillator.
21
22
This document illustrates how you can use a cheap HFC-S card with the public telephone network as frequency standard for your E1 line.
23 34 laforge
24
25 40 laforge
h3. Modifying the HFC-S Card
26
27
28 34 laforge
All in all we need 2 Signals from the HFC-S Card: F0IO and C4IO. This signals are provided by the HFC-S Chip on the card and can be taken from pin 55 (F0IO) and 54 (C4IO) at the HFC-S Chip. (See also Datasheet page 8).
29 35 laforge
30 41 laforge
!{width:80%}hfc-s_card.jpg!
31 34 laforge
32
All you need to do is to solder a wire to C4IO and F0I0. The following image shows our modified card:
33 35 laforge
34 41 laforge
!{width:80%}hfc-s_card_modified.jpg!
35 34 laforge
36
Note: We used an old led-wire from an old PC-Tower case. The green wire is connected to F0IO and the black one is connected to C4IO
37
38
After you have modified the card you should verify if the card works as expected. Start isdnsync and measure the signals with an oscilloscope.
39
40 40 laforge
<pre>
41 34 laforge
$ ./isdnsync 1
42
DL_INFORMATION (tei 0 sapi 0)
43
-> activating layer 2
44
PH_ACTIVATE
45
*** Sync available from interface :-)
46
DL_ESTABLISH
47 40 laforge
</pre>
48 37 dexter
49 41 laforge
!{width:80%}bit_clock_01.jpg!
50
!{width:80%}frame_clock_01.jpg!
51 1 dexter
52
From left to right:  F0IO (4,096Mhz bitclock), C4I0 (8kHz frameclock)
53 34 laforge
54
Note: See HFC-E1 Datasheet Page 235 more information.
55 38 dexter
56
57 34 laforge
58 40 laforge
h3. Connecting the modified HFC-S card to your E1 Card
59
60
61 34 laforge
Your HFC-E1 card has two so called PCM-Connectors. (the two connectors in the upper right corner of the card) The signal inputs for C4IO and F0IO can be found on Pin 9 and Pin 11 of the HFC-E1 card.
62
63 41 laforge
!{width:80%}hfc-e1_connected_to_hfc-s.jpg!
64 1 dexter
65
The image shows how the HFC-S card is connected to the HFC-E1 card.
66 34 laforge
67 1 dexter
Note: We used an old led-wire from an old PC-Tower case. The green wire is connected to F0IO and the black one is connected to C4IO
68
69
Note: You should have received a printed documentation with your HFC-E1 card. You will find a detailed pinout of the PCM connectors there.
70
71 34 laforge
72 40 laforge
h3. Perform the calibration procedure
73
74
75 34 laforge
The calibration of the internal oscillator is an ongoing process. In a commerical telephone network the BTSs are calibrated at all times. In an experimental Setup it should be ok to operate the BTS in standalone mode and syncronize it from time to time just as shown here:
76 1 dexter
77
Things to do:
78
79 40 laforge
* Connect the HFC-S Card to the S0 line. 
80
* Add type=0x00800 to the modprobe hfcmulti ... commandline:
81
* start isdynsync:
82 34 laforge
83 40 laforge
<pre>
84 34 laforge
$ ./isdnsync 1
85 1 dexter
DL_INFORMATION (tei 0 sapi 0)
86
-> activating layer 2
87
PH_ACTIVATE
88 34 laforge
*** Sync available from interface :-)
89 1 dexter
DL_ESTABLISH
90 40 laforge
</pre>
91 34 laforge
92 40 laforge
* Configure your BTS from standalone to E1 locked:
93 34 laforge
94 40 laforge
<pre>
95 34 laforge
dexter@da-laptop-w3:~/openbsc/openbsc/src$ ./bs11_config pll-e1-locked
96
bs11_config (C) 2009 by Harald Welte and Dieter Spaar
97
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
98
99
LMT LOGON: ACK
100
101
PHASE: 2 Maintenance          MBCCU0: Load        MBCCU1: Load        Abis-link: Down      
102 40 laforge
SET ATTRIBUTE [[ObjClass]]=0xa5 [[ObjInst]]=(7,0,0) ACK
103 34 laforge
LMT LOGOFF: ACK
104 40 laforge
</pre>
105 39 laforge
106 40 laforge
* start [[osmo-nitb]] (just as normal)
107
* use bs11_config to monitor the calibration process. The internal oscillator will now take over the E1 clock. You should see that the PLL values changing from time to time. If you see the PLL values leveling off, the calibration is done.
108 34 laforge
109
Here's an example: 
110 40 laforge
<pre>
111 34 laforge
bs11_config (C) 2009 by Harald Welte and Dieter Spaar
112
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
113
114
LMT LOGON: ACK
115
116 1 dexter
PHASE: 3 Normal               MBCCU0: Load        MBCCU1: Load        Abis-link: Up        
117 34 laforge
118
BS11 ATTRIBUTES:
119
	BS-11 ESN PCB Serial Number: 001107
120 1 dexter
	BS-11 ESN Hardware Code Number: 135-2044/03.07
121 34 laforge
	BS-11 ESN Firmware Code Number: 135-2044/03.07
122
	PLL Set Value=1047, Work Value=653
123
124
SITE MANAGER ATTRIBUTES:
125
	E1 Channel: Port=0 Timeslot=1 (Full Slot)
126
	TEI: 25
127
128
BS11 Line Interface ATTRIBUTES:
129
	PLL Mode: E1 Locked
130
131
BS11 CCLK ATTRIBUTES:
132
	CCLK Accuracy: Medium (0)
133
134
BS11 Power Amplifier 0 ATTRIBUTES:
135
	TRX Power: 30mW (GSM)
136
137
LMT LOGOFF: ACK
138 40 laforge
</pre>
139 34 laforge
The output was taken from a BS11 that was totally misaligned. The misalignment
140
came from exidently operating the BS11 in E1-locked mode withoud a proper
141
frequency standard (the internal oscillator of the HFC-E1 card far from being
142
exact enough!). 
143 40 laforge
<pre>
144 34 laforge
bs11_config (C) 2009 by Harald Welte and Dieter Spaar
145
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
146
147 1 dexter
LMT LOGON: ACK
148 34 laforge
149
PHASE: 3 Normal               MBCCU0: Load        MBCCU1: Load        Abis-link: Up        
150
151
BS11 ATTRIBUTES:
152
	BS-11 ESN PCB Serial Number: 001107
153
	BS-11 ESN Hardware Code Number: 135-2044/03.07
154 1 dexter
	BS-11 ESN Firmware Code Number: 135-2044/03.07
155
	PLL Set Value=1047, Work Value=1046
156 34 laforge
157
SITE MANAGER ATTRIBUTES:
158
	E1 Channel: Port=0 Timeslot=1 (Full Slot)
159
	TEI: 25
160
161
BS11 Line Interface ATTRIBUTES:
162 1 dexter
	PLL Mode: E1 Locked
163
164 34 laforge
BS11 CCLK ATTRIBUTES:
165
	CCLK Accuracy: Medium (0)
166
167
BS11 Power Amplifier 0 ATTRIBUTES:
168 1 dexter
	TRX Power: 30mW (GSM)
169
170
LMT LOGOFF: ACK
171 40 laforge
</pre>
172 1 dexter
And that output was taken from the BS11 after operating it for about 1,5h with our
173 34 laforge
hfc-s/PSTN based frequency standard. As you can see the the Workvalue has changed
174
dramaticly.
175
176
With our testequipment we could verify that the frequency accuracy of the BS11 now
177
in the same range as the commercial BTS in the neigbourhood. 
178
179 40 laforge
* Configure your BTS from E1 locked to standalone to finish the procedure.
180 34 laforge
181 40 laforge
<pre>
182 34 laforge
dexter@da-laptop-w3:~/openbsc/openbsc/src$ ./bs11_config pll-e1-locked
183
bs11_config (C) 2009 by Harald Welte and Dieter Spaar
184
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
185
186
LMT LOGON: ACK
187
188
PHASE: 2 Maintenance          MBCCU0: Load        MBCCU1: Load        Abis-link: Down      
189 40 laforge
SET ATTRIBUTE [[ObjClass]]=0xa5 [[ObjInst]]=(7,0,0) ACK
190 34 laforge
LMT LOGOFF: ACK
191 40 laforge
</pre>
192 34 laforge
193
194
Note: If you do this the first time it is higly recomended to check if valid signals are present at C4IO and F0IO.
195
196
Note: The process takes some time. We recommend to warm up the BTS before you start for at least one hour. It is important that the calibration takes place with work temperature.
197
198
199 40 laforge
200
h3. Sources
201
202
* http://lists.gnumonks.org/pipermail/openbsc/2009-June/000387.html
203
* http://lists.gnumonks.org/pipermail/openbsc/2009-July/000627.html
Add picture from clipboard (Maximum size: 48.8 MB)