You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After you've done this, the scope should automatically come up with the correct permissions to be accessed
38
50
without being root user.
39
51
40
-
The following instructions are tested with Debian (*stretch*and *buster*)
41
-
and are executed also automatically under Ubuntu (*2004*) - have a look
52
+
The following instructions are tested with Debian stable versions *stretch*, *buster*and *bullseye*
53
+
and are executed also automatically by GitHub under Ubuntu (*2004*) after each push to this repo - have a look
42
54
at the [GitHub Action](https://github.com/Ho-Ro/Hantek6022API/actions/workflows/build_check.yml).
43
-
On each successful run a debian package is available under *Artifacts*.
55
+
On each successful run a Debian package is available under *Artifacts*.
56
+
57
+
### Build Preparations
44
58
45
59
To compile the custom firmware you have to install (as root) the *small devices c compiler*`sdcc` and the tool `pkgconf`:
46
60
47
61
sudo apt install sdcc pkgconf
48
62
49
-
### Submodule fx2lib
50
-
Hantek6022API uses the submodule [fx2lib](https://github.com/Ho-Ro/fx2lib) that I cloned from the [original fx2lib](https://github.com/djmuhlestein/fx2lib) to do minor maintenance updates.
63
+
Take care when the SDCC version gets updated. the step from 3.9 to 4.0 introduced a nasty regression due to [less optimal code](https://github.com/Ho-Ro/Hantek6022API/blob/4cb4edbf1e6d2d5df21dbb4dabb8f51c932a0348/PyHT6022/Firmware/DSO6022BE/scope6022.inc#L80)
64
+
from the newer version.
65
+
66
+
Hantek6022API uses the submodule [fx2lib](https://github.com/Ho-Ro/fx2lib) that I cloned from the
67
+
[original fx2lib](https://github.com/djmuhlestein/fx2lib) to do minor maintenance updates.
51
68
52
-
Pull the submodule in:
69
+
Pull the submodule in (once):
53
70
54
71
git submodule init
55
72
git submodule update --remote
56
73
74
+
### Linux Build
75
+
57
76
To build the custom firmware run `make` in the top level directory:
58
77
59
78
make
@@ -79,10 +98,44 @@ The installed programs can also be uninstalled cleanly with
79
98
80
99
sudo dpkg -P hantek6022api
81
100
82
-
With the device plugged in, run `upload_firmware_6022.py` once to bootstrap the scope for use.
101
+
83
102
You can then look at the scope traces via `capture_6022.py -t 0.01 | plot_from_capture_6022.py`,
84
103
or write your own programs - look at the programs in `examples` as a start.
85
104
105
+
If you want to make low-level experiments with the python commands you should bootstrap the scope for use:
106
+
With the device plugged in, run `upload_6022_firmware.py` once.
107
+
The *user tools*`*_6022.py` do this automatically at start.
108
+
109
+
**Don't Panik!**
110
+
The firmware is uploaded into RAM and is lost after switching off the scope or disconnecting
111
+
the USB, so the device can never be *bricked*.
112
+
113
+
This simple program sets the calibration output frequency to 400 Hz
114
+
(you can use each even divison of 2 MHz between 32 Hz and 100 kHz).
115
+
116
+
```python
117
+
#!/usr/bin/python3
118
+
119
+
# get the python package
120
+
from PyHT6022.LibUsbScope import Oscilloscope
121
+
122
+
# create an Osclloscope object
123
+
scope = Oscilloscope()
124
+
125
+
# setup the scope
126
+
scope.setup()
127
+
128
+
# attach to the scope
129
+
scope.open_handle()
130
+
131
+
# upload firmware unless already uploaded
132
+
if (not scope.is_device_firmware_present):
133
+
scope.flash_firmware()
134
+
135
+
# and now set the calibration frequency output to 400 Hz
136
+
scope.set_calibration_frequency( 400 )
137
+
```
138
+
86
139
## It even works under Windows
87
140
88
141
[@justlep](https://github.com/justlep) wrote:
@@ -150,10 +203,14 @@ Configure with command line arguments:
150
203
-e, --eeprom store calibration values in eeprom
151
204
-g, --measure_gain interactively measure gain (as well as offset)
152
205
206
+
### Fast Offset Calibration
207
+
153
208
Apply 0 V to both inputs (e.g. connect both probes to the GND calibration connector) and execute:
154
209
155
210
calibrate_6022.py -e
156
211
212
+
### Complete Offset and Gain Calibration
213
+
157
214
If is also possible to measure and create also gain calibration.
158
215
To calibrate gain you have to apply a well known voltage (setpoint)
159
216
and compare it with the actual value that is read by the scope:
@@ -172,24 +229,26 @@ the program measures and compares them against the expected gain settings:
172
229
6. The program option `-e` stores the calibration values in eeprom
173
230
7. The program option `-c` creates a config file `modelDSO6022.conf`
174
231
175
-
This config file can be copied into directory `~/.config/OpenHantek`.
232
+
This (optional) config file can be copied into directory `~/.config/OpenHantek`.
176
233
On every startup OpenHantek reads this file and applies the calibratipon accordingly.
234
+
The config file has higher priority than the eeprom content.
235
+
It has also the advantage not to mess with the eeprom.
177
236
178
237
The calibration voltages do not have to correspond absolutely to the given value,
179
-
but the applied voltage should not be much higher than the given value and must be determined exactly -
180
-
e.g. by measuring it with a multimeter. Type in the measured voltage at the prompt.
181
-
4 AA batteries in a battery holder are a simple and reliable voltage source:
238
+
but the applied voltage should not be much higher than the proposed value and must be determined exactly -
239
+
e.g. by measuring it with a multimeter. Type in the real measured voltage at the prompt.
240
+
4 fresh AA batteries in a battery holder are a simple and reliable voltage source:
182
241
183
-
Requested Voltage | Applied Voltage | Comment
184
-
------------------|-----------------|--------
185
-
0.4 V | 0.3 V | 2 x AA with 1/10 probe
186
-
0.8 V | 0.6 V | 4 x AA with 1/10 probe
187
-
2.0 V | 1.5 V | 1 x AA
188
-
4.0 V | 3.0 V or 4.5 V | 2 or 3 x AA
242
+
Requested Voltage | Applied Voltage | Comment
243
+
------------------|------------------|--------
244
+
0.4 V | ~0.3 V | 2 x AA with 1/10 probe
245
+
0.8 V | ~0.6 V | 4 x AA with 1/10 probe
246
+
2.0 V | ~1.5 V | 1 x AA
247
+
4.0 V | ~3.0 V or ~4.5 V | 2 or 3 x AA
189
248
190
249
[Read more about the eeprom content...](docs/README.md#eeprom)
191
250
192
-
## Use the device as a data logger ##
251
+
## Use the device as a data logger
193
252
194
253
The program `capture_6022.py` (also in `/usr/bin/`) allows to capture both channels over a long time.
0 commit comments