Project

General

Profile

Isdnsync » History » Version 39

laforge, 02/19/2016 10:48 PM
rename bsc_hack to osmo-nitb in page text

1 34 laforge
== ISDNsync Reference ==
2 33 dexter
3
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.
4
5
{{{
6
Usage: ./isdnsync <card>
7
8
Opens given card number in TE-mode PTP and tries to keep layer 2 established.
9
This keeps layer 1 activated to retrieve a steady sync signal from network.
10
}}}
11 1 dexter
12 34 laforge
== isdnsync HOWTO ==
13
14
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.
15
16
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.
17
18
This document illustrates how you can use a cheap HFC-S card with the public telephone network as frequency standard for your E1 line.
19
20
=== Modifying the HFC-S Card ===
21
22
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).
23
24 35 laforge
[[Image(Isdnsync:hfc-s_card.jpg, 20%)]]
25 34 laforge
26
All you need to do is to solder a wire to C4IO and F0I0. The following image shows our modified card:
27
28 35 laforge
[[Image(Isdnsync:hfc-s_card_modified.jpg, 20%)]]
29 34 laforge
30
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
31
32
After you have modified the card you should verify if the card works as expected. Start isdnsync and measure the signals with an oscilloscope.
33
34
{{{
35
$ ./isdnsync 1
36
DL_INFORMATION (tei 0 sapi 0)
37
-> activating layer 2
38
PH_ACTIVATE
39
*** Sync available from interface :-)
40
DL_ESTABLISH
41
}}}
42
43 37 dexter
[[Image(bit_clock_01.jpg, 20%)]]
44
[[Image(frame_clock_01.jpg, 20%)]]
45 34 laforge
46
From left to right:  F0IO (4,096Mhz bitclock), C4I0 (8kHz frameclock)
47
48 38 dexter
Note: See HFC-E1 Datasheet Page 235 more information.
49
50 34 laforge
51
=== Connecting the modified HFC-S card to your E1 Card ===
52
53
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.
54
55 35 laforge
[[Image(Isdnsync:hfc-e1_connected_to_hfc-s.jpg, 40%)]]
56 34 laforge
57
The image shows how the HFC-S card is connected to the HFC-E1 card.
58
59
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
60
61
Note: You should have received a printed documentation with your HFC-E1 card. You will find a detailed pinout of the PCM connectors there.
62
63
=== Perform the calibration procedure ===
64
65
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:
66
67
Things to do:
68
69
 * Connect the HFC-S Card to the S0 line. 
70
 * Add type=0x00800 to the modprobe hfcmulti ... commandline:
71
 * start isdynsync:
72
73
{{{
74
$ ./isdnsync 1
75
DL_INFORMATION (tei 0 sapi 0)
76
-> activating layer 2
77
PH_ACTIVATE
78
*** Sync available from interface :-)
79
DL_ESTABLISH
80
}}}
81
82
 * Configure your BTS from standalone to E1 locked:
83
84
{{{
85
dexter@da-laptop-w3:~/openbsc/openbsc/src$ ./bs11_config pll-e1-locked
86
bs11_config (C) 2009 by Harald Welte and Dieter Spaar
87
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
88
89
LMT LOGON: ACK
90
91
PHASE: 2 Maintenance          MBCCU0: Load        MBCCU1: Load        Abis-link: Down      
92
SET ATTRIBUTE ObjClass=0xa5 ObjInst=(7,0,0) ACK
93
LMT LOGOFF: ACK
94
}}}
95
96 39 laforge
 * start [wiki:osmo-nitb] (just as normal)
97 34 laforge
 * 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.
98
99
Here's an example: 
100
{{{
101
bs11_config (C) 2009 by Harald Welte and Dieter Spaar
102
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
103
104
LMT LOGON: ACK
105
106
PHASE: 3 Normal               MBCCU0: Load        MBCCU1: Load        Abis-link: Up        
107
108
BS11 ATTRIBUTES:
109
	BS-11 ESN PCB Serial Number: 001107
110
	BS-11 ESN Hardware Code Number: 135-2044/03.07
111
	BS-11 ESN Firmware Code Number: 135-2044/03.07
112
	PLL Set Value=1047, Work Value=653
113
114
SITE MANAGER ATTRIBUTES:
115
	E1 Channel: Port=0 Timeslot=1 (Full Slot)
116
	TEI: 25
117
118
BS11 Line Interface ATTRIBUTES:
119
	PLL Mode: E1 Locked
120
121
BS11 CCLK ATTRIBUTES:
122
	CCLK Accuracy: Medium (0)
123
124
BS11 Power Amplifier 0 ATTRIBUTES:
125
	TRX Power: 30mW (GSM)
126
127
LMT LOGOFF: ACK
128
}}}
129
The output was taken from a BS11 that was totally misaligned. The misalignment
130
came from exidently operating the BS11 in E1-locked mode withoud a proper
131
frequency standard (the internal oscillator of the HFC-E1 card far from being
132
exact enough!). 
133
{{{
134
bs11_config (C) 2009 by Harald Welte and Dieter Spaar
135
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
136
137
LMT LOGON: ACK
138
139
PHASE: 3 Normal               MBCCU0: Load        MBCCU1: Load        Abis-link: Up        
140
141
BS11 ATTRIBUTES:
142
	BS-11 ESN PCB Serial Number: 001107
143
	BS-11 ESN Hardware Code Number: 135-2044/03.07
144
	BS-11 ESN Firmware Code Number: 135-2044/03.07
145
	PLL Set Value=1047, Work Value=1046
146
147
SITE MANAGER ATTRIBUTES:
148
	E1 Channel: Port=0 Timeslot=1 (Full Slot)
149
	TEI: 25
150
151
BS11 Line Interface ATTRIBUTES:
152
	PLL Mode: E1 Locked
153
154
BS11 CCLK ATTRIBUTES:
155
	CCLK Accuracy: Medium (0)
156
157
BS11 Power Amplifier 0 ATTRIBUTES:
158
	TRX Power: 30mW (GSM)
159
160
LMT LOGOFF: ACK
161
}}}
162
And that output was taken from the BS11 after operating it for about 1,5h with our
163
hfc-s/PSTN based frequency standard. As you can see the the Workvalue has changed
164
dramaticly.
165
166
With our testequipment we could verify that the frequency accuracy of the BS11 now
167
in the same range as the commercial BTS in the neigbourhood. 
168
169
 * Configure your BTS from E1 locked to standalone to finish the procedure.
170
171
{{{
172
dexter@da-laptop-w3:~/openbsc/openbsc/src$ ./bs11_config pll-e1-locked
173
bs11_config (C) 2009 by Harald Welte and Dieter Spaar
174
This is FREE SOFTWARE with ABSOLUTELY NO WARRANTY
175
176
LMT LOGON: ACK
177
178
PHASE: 2 Maintenance          MBCCU0: Load        MBCCU1: Load        Abis-link: Down      
179
SET ATTRIBUTE ObjClass=0xa5 ObjInst=(7,0,0) ACK
180
LMT LOGOFF: ACK
181
}}}
182
183
184
Note: If you do this the first time it is higly recomended to check if valid signals are present at C4IO and F0IO.
185
186
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.
187
188
189
=== Sources ===
190
 * http://lists.gnumonks.org/pipermail/openbsc/2009-June/000387.html
191
 * http://lists.gnumonks.org/pipermail/openbsc/2009-July/000627.html
Add picture from clipboard (Maximum size: 48.8 MB)