Difference between revisions of "Hantek 6022BE"

From sigrok
Jump to navigation Jump to search
(Hantek 6022BE is now supported. Update protocol docs.)
Line 1: Line 1:
[[File:Hantek 6022be.jpg|thumb|right|Hantek 6022BE]]
[[File:Hantek 6022be mugshot.png|thumb|right|Hantek 6022BE]]


The [http://www.hantek.com/en/ProductDetail_2_31.html Hantek 6022BE] is a USB-based, 2-channel oscilloscope with an analog bandwidth of 20MS/s and 48MS/s sampling rate.
The [http://www.hantek.com/en/ProductDetail_2_31.html Hantek 6022BE] is a USB-based, 2-channel oscilloscope with an analog bandwidth of 20MS/s and 48MS/s sampling rate.
Line 42: Line 42:
== Protocol ==
== Protocol ==


The protocol was reverse engineered and documented in: https://github.com/rpcope1/Hantek6022API/blob/master/REVERSE_ENGINEERING.md
{| border="0" style="font-size: smaller" class="alternategrey sortable sigroktable"
 
|-
Copied from that page the main data:
!Oscilloscope command
 
!bRequest value
{| class="wikitable"
!Notes
!|Oscilloscope Command
!| bRequest Value
!|Other Notes
|-
|-
|Set CH0 voltage range ||0xE0 ||Possible values: 1,2,5,10 (5V, 2.5V, 1V, 500mV).
|Set CH0 voltage range ||0xE0 ||Possible values: 1,2,5,10 (5V, 2.5V, 1V, 500mV).
Line 55: Line 52:
|Set CH1 voltage range ||0xE1 ||Possible values: 1,2,5,10 (5V, 2.5V, 1V, 500mV).
|Set CH1 voltage range ||0xE1 ||Possible values: 1,2,5,10 (5V, 2.5V, 1V, 500mV).
|-
|-
|Set Sampling Rate ||0xE2 ||Possible values: 48, 30, 24, 16, 8, 4, 1 (MHz) and 50,20,10 (*10kHz).
|Set sampling rate ||0xE2 ||Possible values: 48, 30, 24, 16, 8, 4, 1 (MHz) and 50,20,10 (*10kHz).
|-
|Trigger Oscilloscope ||0xE3 ||Clear the FIFO on the FX2LP
|-
|-
|Read/Write EEPROM ||0xA2 ||Read or write the eeprom built into the scope.
|Trigger oscilloscope ||0xE3 ||Possible values: 1 == start sampling.
|-
|-
|Read/Write Firmware ||0xA0 ||Read or write the scope firmware. Must be done on scope initialization
|Set number of channels ||0xE4 ||Possible values: 1, 2.
|-
|-
|}
|}


All commands are sent with index = 0x00, the calibration commands are sent with value 0x08, the 0xEx requests are sent with value 0x00, and the value for R/W command is dependent on the Cypress protocol for interacting with the firmware.
== Firmware ==


Additionally, a bulk read from end point 0x86 reads the current contents of the FIFO, which the ADC is filling. The reference Python libusb code should give further insight into the means for which to interact with the device.
We use the open-source firmware file '''hantek-6022be.fw''' from [[fx2lafw|sigrok-firmware-fx2lafw]] for this device. The firmware was originally written by Jochen Hoenicke (see [http://sigrok.org/gitweb/?p=sigrok-firmware-fx2lafw.git;a=blob;f=README README] for details), thanks a lot!


== Extracting the firmware ==
The protocol of the open-source firmware we use (see [[Hantek_6022BE#Firmware|below]]) is similar, but not identical, to the vendor's firmware protocol. The vendor firmware was originally reverse engineered and documented for the [https://github.com/rpcope1/Hantek6022API/blob/master/REVERSE_ENGINEERING.md Hantek6022API] project. The open-source '''implementation''' was done from scratch, though.


The firmware was extracted, reverse engineered and re-implemented by rpcope1 jhoenicke on github. The open-source firmware can be found at https://github.com/rpcope1/Hantek6022API/tree/master/PyHT6022/HantekFirmware/custom
'''Note''': The firmware is '''not''' flashed into the device permanently! You need to only make it available in the usual place where [[libsigrok]] looks for firmware files, it will be used automatically (and "uploaded" to the Cypress FX2's SRAM every time you attach the 6022BE to a USB port).


== Resources ==
== Resources ==
Line 80: Line 75:
[[Category:Device]]
[[Category:Device]]
[[Category:Oscilloscope]]
[[Category:Oscilloscope]]
[[Category:In progress]]
[[Category:Supported]]

Revision as of 02:07, 14 March 2016

Hantek 6022BE

The Hantek 6022BE is a USB-based, 2-channel oscilloscope with an analog bandwidth of 20MS/s and 48MS/s sampling rate.

See Hantek_6022BE/Info for more details (such as lsusb -v output) about the device.

Hardware

  • Main chip + USB: FX2LP
  • Main oscillator: unknown

Photos

Another teardown:

Protocol

Oscilloscope command bRequest value Notes
Set CH0 voltage range 0xE0 Possible values: 1,2,5,10 (5V, 2.5V, 1V, 500mV).
Set CH1 voltage range 0xE1 Possible values: 1,2,5,10 (5V, 2.5V, 1V, 500mV).
Set sampling rate 0xE2 Possible values: 48, 30, 24, 16, 8, 4, 1 (MHz) and 50,20,10 (*10kHz).
Trigger oscilloscope 0xE3 Possible values: 1 == start sampling.
Set number of channels 0xE4 Possible values: 1, 2.

Firmware

We use the open-source firmware file hantek-6022be.fw from sigrok-firmware-fx2lafw for this device. The firmware was originally written by Jochen Hoenicke (see README for details), thanks a lot!

The protocol of the open-source firmware we use (see below) is similar, but not identical, to the vendor's firmware protocol. The vendor firmware was originally reverse engineered and documented for the Hantek6022API project. The open-source implementation was done from scratch, though.

Note: The firmware is not flashed into the device permanently! You need to only make it available in the usual place where libsigrok looks for firmware files, it will be used automatically (and "uploaded" to the Cypress FX2's SRAM every time you attach the 6022BE to a USB port).

Resources