Project

General

Profile

Isdnsync » History » Version 34

laforge, 02/19/2016 10:48 PM
merge howto page in main page

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