Line: 1 to 1 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Hantek 6022BE Digital Storage Oscilloscope | |||||||||||||
Line: 78 to 78 | |||||||||||||
For comparison, this is how the original GUI looks like: | |||||||||||||
Changed: | |||||||||||||
< < | |||||||||||||
> > | |||||||||||||
Basic components of OpenHantekAs explained above, the new openhantek program (called openhantek2 in git) is missing a lot the the GUI elements needed to run the scope. On the other hand it nicely separates the scope functionality putting it into libraries. | |||||||||||||
Line: 133 to 133 | |||||||||||||
| |||||||||||||
Added: | |||||||||||||
> > | When mapping the trace data (y = 0..255, x=0..recordLength) to the openGL plot widget (y=-4 .. +4, x=-5 .. +5) the display follows as expected. The screen dump below shows the demo device when the timebase has been switched to 500us/div instead of 1 ms/div and the gain has been set to 0.5V/div instead of 1V/div. | ||||||||||||
-- Uli Raich - 2017-01-24
Comments | |||||||||||||
Line: 147 to 153 | |||||||||||||
| |||||||||||||
Deleted: | |||||||||||||
< < |
| ||||||||||||
| |||||||||||||
Added: | |||||||||||||
> > |
|
Line: 1 to 1 | |||||||||
---|---|---|---|---|---|---|---|---|---|
The Hantek 6022BE Digital Storage Oscilloscope | |||||||||
Line: 150 to 150 | |||||||||
| |||||||||
Added: | |||||||||
> > |
|
Line: 1 to 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Hantek 6022BE Digital Storage Oscilloscope | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 112 to 112 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Added: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < |
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | -- Uli Raich - 2017-01-24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comments |
Line: 1 to 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Hantek 6022BE Digital Storage Oscilloscope | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Line: 86 to 86 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
It has the additional advantage that the demo device, which simply generates a sine wave (with some noise added) and a triangular signal, can be used for all GUI testing such that the hardware is not needed for most of the work. The original openhantek program on the other hand has all necessary GUI elements. I therefore decided to try combining both, using the libraries from the new program and the GUI from the old one. The screen dump above shows the demo device with the old GUI. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Added: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Mapping the traces to the plots | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Changed: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
< < | -- Uli Raich - 2017-01-24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> > | Vertical mapping
The grids of the openhantek scope are 8 units high (-4 - +4) and 10 units wide (-5 - +5). The scope trace must be mapped to these dimensions. Since the scope hardware has got an 8 bit ADC values 0..250 must be mapped to -4..+4. In addition we must take into account the hardware gain that can be set on the scope. The following table shows the available hardware gains on the first column, the gain settings in V/div in the second one, the max voltages that can be displayed in the plot and the last column shows the multiplication factor needed to map the values from the scope to the screen.
From the table we can see that for 5V/div only ¼ of the ADC resolution is reached while for 100mV/division and below the signal will be saturated. Horizontal mapping Horizontally we have to take into account
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comments |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
The Hantek 6022BE Digital Storage Oscilloscope | ||||||||
Line: 64 to 64 | ||||||||
In addition to these libraries there are two more:
| ||||||||
Changed: | ||||||||
< < | Graeff’s version of openhantek is based on cmake, which unfortunately I don’t know well enough. To get started I converted back to qmake and created a qtcreator project with all openhantek code. Neither Graeff’s original project nore my qtcreator project did compile out of the box but needed several corrections to get it working. | |||||||
> > | Graeff’s version of openhantek is based on cmake, which unfortunately I don’t know well enough. To get started I converted back to qmake and created a qtcreator project with all openhantek code. Neither Graeff’s original project nor my qtcreator project did compile out of the box but needed several corrections to get it working. Another problem with Graeff's mr_split_gui_backend branch is that he references the qtquickplot library, which is however missing on the repository. I found it here. There were still some minor incompatibility problems (the library wants floats as data input while openhantek2 provides doubles) but these can easily be solved. | |||||||
When I finally get the everything compiled and linked I see this when running openhantek for the first time: | ||||||||
Line: 103 to 103 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
The Hantek 6022BE Digital Storage Oscilloscope | ||||||||
Line: 102 to 102 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | |||||||||
---|---|---|---|---|---|---|---|---|---|
The Hantek 6022BE Digital Storage Oscilloscope | |||||||||
Line: 40 to 40 | |||||||||
The above screen dump shows the trace read from the Hantek6022be when the probe is connected to the calibration pulse generator. | |||||||||
Added: | |||||||||
> > | Some specsDepending on the sampling rate the number of samples that can be read changes with the more samples the slower you sample. Here is a table showing the buffer size to be read back:Bringing up openhantekThere are quite a few versions of openhantek floating around on the WEB. The latest one seems to be this one. It contains several branches with mr_split_gui_backend being the most interesting one. The mr_split_gui_backend branch of openhantek separates out the GUI into qml files and I therefore first try to only bring the GUI onto the screen forgetting about the functionality, which is implemented in C++ code. The qmlscene utility allows to do exactly this. Using qmlscene I see that the menu bar does not come up. The error is this: appmenu-qt: handleReparent 138 The given QWindow has no QMenuBar assigned It turns out that this is a bug on my Ubuntu system which can be avoided by setting UBUNTU_MENUPROXY to the empty string. Not only is the GUI separated from the rest of the code but also hardware access is split into a number of libraries, one for each type of device. We therefore have
Basic components of OpenHantekAs explained above, the new openhantek program (called openhantek2 in git) is missing a lot the the GUI elements needed to run the scope. On the other hand it nicely separates the scope functionality putting it into libraries. It has the additional advantage that the demo device, which simply generates a sine wave (with some noise added) and a triangular signal, can be used for all GUI testing such that the hardware is not needed for most of the work. The original openhantek program on the other hand has all necessary GUI elements. I therefore decided to try combining both, using the libraries from the new program and the GUI from the old one. The screen dump above shows the demo device with the old GUI. | ||||||||
-- Uli Raich - 2017-01-24 | |||||||||
Line: 52 to 98 | |||||||||
| |||||||||
Added: | |||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
The Hantek 6022BE Digital Storage OscilloscopeFor the course on embedded systems we need an oscilloscope to be able to see certain signals created by micro-controller code. These signals are have a signal level of either 5V or 3.3V and are rather slow. These means that a rather limited but cheap scope is good enough for us.The Hantek 6022BE has a sampling rate of 48 MHz or a bandwidth of some 20 MHz. To make things really cheap it uses an USB interface and the display capabilities of a PC to display scope traces and a graphical user interface (GUI) of the PC to control timebase, signal sensitivity and trigger level. Don’t expect features you will get on a 10 kUS$ Textronix scope, you will quickly hit the limitations of the 6022BE, however it should meet the requirements imposed by the course exercises. The Hantek 6022BE has 2 DC coupled input channels, a calibration signal generator emitting a square signal and it is delivered with 2 80 MHz probes and a USB cable to connect it to the PC. In addition to this you get a mini CD with Windows software implementing a GUI based control program and a software development kit which allows to implement your own code. The scope is based on a Cypress CY7C68013A chip, which is essentially a 8051 μ Controller with built in RAM, I2C and USB interface. An external I2C EPROM is used to store USB Vendor and Product ID as well as a few calibration parameters. When the scope is plugged into the Windows PC a driver is started downloading firmware into the Cypress RAM making it ready for operation. The code is stored in RAM and must therefore re-loaded each time the scope is powered. Once the firmware is loaded the Vendor ID is changed making the scope looks like a different device. | ||||||||
Added: | ||||||||
> > |
This is how the Windows application looks like:
Channel B is connected to the calibration signal which tells us that this is a 1 kHz square wave. The horizontal time base can be selected between 1,2,5,10,20,50,100,200,500 ns/division up to 1,2,5 s/division. Of course 1 ns/division is pretty useless on 20 MHz scope. The vertical sensitivity can be selected from 20 mV to 5V per division. You can trigger the scope in
| |||||||
Running the Hantek 6022BE under LinuxJust like in the Windows case we must first first load the scope with its firmware. There are different ways to do this:use udev rules to load the firmware using the fxload program make the application program load the firmware if it is not loaded yet When is scope is plugged in without the firmware being loaded it announces itself as a Cypress Semiconductor device with Vendor ID 0x04b4. | ||||||||
Line: 29 to 51 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
The Hantek 6022BE Digital Storage Oscilloscope | ||||||||
Changed: | ||||||||
< < | For the course on embedded systems we need an oscilloscope to be able to see certain signals created by micro-controller code. These signals are have a signal level of either 5V or 3.3V and are rather slow. These means that a rather limited but cheap scope is good enough for us. The Hantek 6022BE has a sampling rate of 48 MHz or a bandwidth of some 20 MHz. To make things really cheap it uses an USB interface and the display capabilities of a PC to display scope traces and a graphical user interface (GUI) of the PC to control timebase, signal sensitivity and trigger level. Don’t expect features you will get on a 10 kUS$ Textronix scope, you will quickly hit the limitations of the 6022BE, however it should meet the requirements imposed by the course exercises. The Hantek 6022BE has 2 DC coupled input channels, a calibration signal generator emitting a square signal and it is delivered with 2 80 MHz probes and a USB cable to connect it to the PC. In addition to this you get a mini CD with Windows software implementing a GUI based control program and a software development kit which allows to implement your own code. The scope is based on a Cypress CY7C68013A chip, which is essentially a 8051 μ Controller with built in RAM, I2C and USB interface. An external I2C EPROM is used to store USB Vendor and Product ID as well as a few calibration parameters. When the scope is plugged into the Windows PC a driver is started downloading firmware into the Cypress RAM making it ready for operation. The code is stored in RAM and must therefore re-loaded each time the scope is powered. Once the firmware is loaded the Vendor ID is changed making the scope looks like a different device. Running the Hantek 6022BE under Linux Just like in the Windows case we must first first load the scope with its firmware. There are different ways to do this: use udev rules to load the firmware using the fxload program make the application program load the firmware if it is not loaded yet When is scope is plugged in without the firmware being loaded it announces itself as a Cypress Semiconductor device with Vendor ID 0x04b4. | |||||||
> > | For the course on embedded systems we need an oscilloscope to be able to see certain signals created by micro-controller code. These signals are have a signal level of either 5V or 3.3V and are rather slow. These means that a rather limited but cheap scope is good enough for us. The Hantek 6022BE has a sampling rate of 48 MHz or a bandwidth of some 20 MHz. To make things really cheap it uses an USB interface and the display capabilities of a PC to display scope traces and a graphical user interface (GUI) of the PC to control timebase, signal sensitivity and trigger level. Don’t expect features you will get on a 10 kUS$ Textronix scope, you will quickly hit the limitations of the 6022BE, however it should meet the requirements imposed by the course exercises. The Hantek 6022BE has 2 DC coupled input channels, a calibration signal generator emitting a square signal and it is delivered with 2 80 MHz probes and a USB cable to connect it to the PC. In addition to this you get a mini CD with Windows software implementing a GUI based control program and a software development kit which allows to implement your own code. The scope is based on a Cypress CY7C68013A chip, which is essentially a 8051 μ Controller with built in RAM, I2C and USB interface. An external I2C EPROM is used to store USB Vendor and Product ID as well as a few calibration parameters. When the scope is plugged into the Windows PC a driver is started downloading firmware into the Cypress RAM making it ready for operation. The code is stored in RAM and must therefore re-loaded each time the scope is powered. Once the firmware is loaded the Vendor ID is changed making the scope looks like a different device. Running the Hantek 6022BE under LinuxJust like in the Windows case we must first first load the scope with its firmware. There are different ways to do this:use udev rules to load the firmware using the fxload program make the application program load the firmware if it is not loaded yet When is scope is plugged in without the firmware being loaded it announces itself as a Cypress Semiconductor device with Vendor ID 0x04b4. | |||||||
| ||||||||
Line: 10 to 13 | ||||||||
Changed: | ||||||||
< < | When browsing the WEB for information of the Hantek 6022BE under Linux, this is what I found: Openhantek by Oliver Haag. This is a git repository with software for Hantek scopes. Unfortunately it only supports more expensive scopes from Hantek. Several people have started to implement drivers for the 6022BE but have not come very far (hantek602be support in openhantek). However you will find code there porting the originally QT-4 based openhantek code to Qt-5. Then there is a driver implementation (hantek driver) which consists of a functions to download the firmware and to set sensitivity and time base and a main program to demonstrate these functions. This also is rather incomplete. Then there is hantek6022api which is a library of Python code. This however also contains firmware code for the Cypress chip and the author (J. Hoenicke) of this 8051 code has done very interesting reverse engineering figuring out what the USB commands to the scope are and how to use them. The 8051 code is given as source code as well as disassembled original code from Hantek. It also supplies a program that allows the user to read out the RAM and EPROM contents. On my dual boot PC I loaded the original Hantek firmware into the scope, then rebooted into Linux and used the example_linux_readfirmware.py included in hantek6022api to extract this code. After disassembly with dis51 I was able to compare the code with the one included as stock firmware in hantek602api to confirm that they are identical. Finally there is the sigrok repository of software for different types of measurement instruments and the Hantek 6022BE is one of the supported devices (oufff,for once we are lucky). This uses the firmware code of J. Hoenicke. Unfortunately sigrok uses again different Vendor ID and Product ID after loading the firmware. Since we have the source code, I was able to modify this. sigrok also contains a simple GUI application (pulseview) to visualize the traces read from the scope. | |||||||
> > | When browsing the WEB for information of the Hantek 6022BE under Linux, this is what I found: Openhantek by Oliver Haag. This is a git repository with software for Hantek scopes. Unfortunately it only supports more expensive scopes from Hantek. Several people have started to implement drivers for the 6022BE but have not come very far (hantek602be support in openhantek). However you will find code there porting the originally QT-4 based openhantek code to Qt-5. Then there is a driver implementation (hantek driver) which consists of a functions to download the firmware and to set sensitivity and time base and a main program to demonstrate these functions. This also is rather incomplete. Then there is hantek6022api which is a library of Python code. This however also contains firmware code for the Cypress chip and the author (J. Hoenicke) of this 8051 code has done very interesting reverse engineering figuring out what the USB commands to the scope are and how to use them. The 8051 code is given as source code as well as disassembled original code from Hantek. It also supplies a program that allows the user to read out the RAM and EPROM contents. On my dual boot PC I loaded the original Hantek firmware into the scope, then rebooted into Linux and used the example_linux_readfirmware.py included in hantek6022api to extract this code. After disassembly with dis51 I was able to compare the code with the one included as stock firmware in hantek602api to confirm that they are identical. Cypress, the producer of the CY7C68013A chip provides a the cyusb library and a GUI program showing how to program the chip. This has not much to do with the scope but shows how to download and upload code, reset the CPU, read or write the EEPROM etc. Finally there is the sigrok repository of software for different types of measurement instruments and the Hantek 6022BE is one of the supported devices (oufff,for once we are lucky). This uses the firmware code of J. Hoenicke. Unfortunately sigrok uses again different Vendor ID and Product ID after loading the firmware. Since we have the source code, I was able to modify this. sigrok also contains a simple GUI application (pulseview) to visualize the traces read from the scope. | |||||||
| ||||||||
Line: 25 to 28 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|
Line: 1 to 1 | |||||||||
---|---|---|---|---|---|---|---|---|---|
Added: | |||||||||
> > |
The Hantek 6022BE Digital Storage OscilloscopeFor the course on embedded systems we need an oscilloscope to be able to see certain signals created by micro-controller code. These signals are have a signal level of either 5V or 3.3V and are rather slow. These means that a rather limited but cheap scope is good enough for us.The Hantek 6022BE has a sampling rate of 48 MHz or a bandwidth of some 20 MHz. To make things really cheap it uses an USB interface and the display capabilities of a PC to display scope traces and a graphical user interface (GUI) of the PC to control timebase, signal sensitivity and trigger level. Don’t expect features you will get on a 10 kUS$ Textronix scope, you will quickly hit the limitations of the 6022BE, however it should meet the requirements imposed by the course exercises. The Hantek 6022BE has 2 DC coupled input channels, a calibration signal generator emitting a square signal and it is delivered with 2 80 MHz probes and a USB cable to connect it to the PC. In addition to this you get a mini CD with Windows software implementing a GUI based control program and a software development kit which allows to implement your own code. The scope is based on a Cypress CY7C68013A chip, which is essentially a 8051 μ Controller with built in RAM, I2C and USB interface. An external I2C EPROM is used to store USB Vendor and Product ID as well as a few calibration parameters. When the scope is plugged into the Windows PC a driver is started downloading firmware into the Cypress RAM making it ready for operation. The code is stored in RAM and must therefore re-loaded each time the scope is powered. Once the firmware is loaded the Vendor ID is changed making the scope looks like a different device. Running the Hantek 6022BE under Linux Just like in the Windows case we must first first load the scope with its firmware. There are different ways to do this: use udev rules to load the firmware using the fxload program make the application program load the firmware if it is not loaded yet When is scope is plugged in without the firmware being loaded it announces itself as a Cypress Semiconductor device with Vendor ID 0x04b4. This changes to ROHM LSI Systems (a company that probably has nothing to do with this scope) because the Vendor ID has changed to 0x4b5. When browsing the WEB for information of the Hantek 6022BE under Linux, this is what I found: Openhantek by Oliver Haag. This is a git repository with software for Hantek scopes. Unfortunately it only supports more expensive scopes from Hantek. Several people have started to implement drivers for the 6022BE but have not come very far (hantek602be support in openhantek). However you will find code there porting the originally QT-4 based openhantek code to Qt-5. Then there is a driver implementation (hantek driver) which consists of a functions to download the firmware and to set sensitivity and time base and a main program to demonstrate these functions. This also is rather incomplete. Then there is hantek6022api which is a library of Python code. This however also contains firmware code for the Cypress chip and the author (J. Hoenicke) of this 8051 code has done very interesting reverse engineering figuring out what the USB commands to the scope are and how to use them. The 8051 code is given as source code as well as disassembled original code from Hantek. It also supplies a program that allows the user to read out the RAM and EPROM contents. On my dual boot PC I loaded the original Hantek firmware into the scope, then rebooted into Linux and used the example_linux_readfirmware.py included in hantek6022api to extract this code. After disassembly with dis51 I was able to compare the code with the one included as stock firmware in hantek602api to confirm that they are identical. Finally there is the sigrok repository of software for different types of measurement instruments and the Hantek 6022BE is one of the supported devices (oufff,for once we are lucky). This uses the firmware code of J. Hoenicke. Unfortunately sigrok uses again different Vendor ID and Product ID after loading the firmware. Since we have the source code, I was able to modify this. sigrok also contains a simple GUI application (pulseview) to visualize the traces read from the scope. The above screen dump shows the trace read from the Hantek6022be when the probe is connected to the calibration pulse generator. -- Uli Raich - 2017-01-24 Comments
|