360nosc0pe / scope

Siglent SDS1x0xX-E FPGA bitstreams
40 stars 6 forks source link

Add Auto-Setup script. #8

Open enjoy-digital opened 3 years ago

enjoy-digital commented 3 years ago

Could use https://github.com/360nosc0pe/scope/issues/3 and https://github.com/360nosc0pe/scope/issues/7 to find optimal settings.

enjoy-digital commented 3 years ago

A simple Auto-Setup has been added to simplify the initial tests.

To improve it and speed it up, we could reuse the configuration used by the original design and just iterate on these:

https://www.eevblog.com/forum/testgear/siglent-sds1204x-e-released-for-domestic-markets-in-china/1190


tmbinc:
Not sure if this had been posted here, but the analog frontend was reverse-engineered:

https://github.com/360nosc0pe/siglent_hardware/tree/master/sds1202xe/siglent_AFE

The gain setting is a combination of the VGA setting, the ADC settings and the shift register:

### AFE (analog front-end) setting
Each channel of the scope contain one 74HC595 shift out register powered by 5V.
Five of the eight outputs are used to change hardware settings in the AFE:

    595_QB:  First divider, 10:1, active high
    595_QC:  Second divider, 10:1, active high
    595_QD:  AC coupling, low = AC, high = DC
    595_QE:  PGA enable, active high
    595_QF:  BW limit, low = 20MHz, high = full

From my notes: (Sorry about the formatting)

ADC is the write to reg 0x2B of the HMCAD1511 ADC (Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/hmcad1511.pdf), the "coarse gain" register. Value is in dB (actually). ShiftReg is the value written to the frontend shift register. VGA is the value set to the VGA.

         ADC ShiftReg ADC VGA
  5mV   2B 09   78   +9  B9
 10mV   2b 06   78   +6  B9
 20mV   2B 04   78   +4  B9
 50mV   2b 02   78   +2  AD
100mV   2B 00   78   +0  AD
200 mV  2B 04   78   +4  27
500 mV  2B 00   78   +0  3f
  1v    2B 00   78   +0  1F
  2V    2B 04   7A   +4  29
  5v    2B 00   7A   +0  41
 10V    2B 00   7A       21
 20V    2B 04   7E       28
 50v    2B 04   7E       41
100V            7E       20
enjoy-digital commented 3 years ago

The initial Auto-Setup script has been removed and replaced with manual ranges configuration (based on the "official" ones). The user can configure it with --adc-range=X (X=5 -> 5V range). Auto-Centering is still present --adc-center. An Auto-Setup script could then just be based on these features (iterate on the different ranges, check for saturation and then do the centering).