Capturing with CW1200 at 100MS/s

I would like to sample asynchronously over the shunt resistor at CW308 board. For this, I tried to “fool” the device by doing following.

scope.clock.clkgen_freq = 100000000
scope.clock.adc_src = “clkgen_x1”

printing scope clock gives me following

adc_src = clkgen_x1
adc_phase = 0
adc_freq = 99999996
adc_rate = 99999996.0
adc_locked = True
freq_ctr = 7373222
freq_ctr_src = extclk
clkgen_src = system
extclk_freq = 10000000
clkgen_mul = 25
clkgen_div = 24
clkgen_freq = 100000000.0
clkgen_locked = True

From my understanding, the ADC should sample now at 100MS/s

I have a problem understanding why, even when 100MS/s is set, I still get only 10000 points in each trace, my oscilloscope gives me usualy 100k points when I sample at 100MS/s. I set the scope.adc.samples to 90k but it only extends the view in time, it doesnt make the traces more “precise”.

Another problem I had with using this method was that

Sometimes the trigger is not set correctly and my device needs a restart… missing some traces and not doing the measurement properly.

You asked this question before. I don’t know how to answer it more clearly.

I tried it and got strange result. So its not possible to just set the sampling rate on the CW1200 to any rate we want?

And why dont we get more points whenever we increase the sampling rate? Are they being decimated to the amount we chose in scope.adc.samples?

Cant we sample at 100MS without providing a clock of 100MHz (just the 7,5Mhz from X1 oscillator)?

Yes you can set the sampling rate to arbitrary values.
I think you have a misunderstanding of what scope.adc.samples means: it doesn’t specify a time duration for the capture, it specified the number of samples to capture. The documentation is clear:

 property samples

    The number of ADC samples to record in a single capture.

You will get scope.adc.samples points no matter what your sampling rate. I’m not sure how to make this more clear.

All you need to do is:

  1. insert the oscillator in your CW308 board
  2. set the CW308 J3 jumper to the top row (“CRYSTAL”)
  3. set scope.clock.adc_src = 'clkgen_x1' and scope.clock.clkgen_freq = 100e6.

If your crystal is 7.37MHz, then one target clock cycle will be 100/7.37 = 13.5 samples (so sometimes 13, sometimes 14). If for example you have scope.adc.samples = 5000, then you will capture 5000/13.5 = 370 target clock cycles.

I hope this helps,
Jean-Pierre

so does increasing the scope.adc.samples actually do anything good? I once set it to 90000 and plotted the graph. I have seen waveforms which extend the trigger (like the first 20k waves are whole AES and the other 70k is the noise after AES computation).

Whenever I recorded with my scope I just could set how many traces I want in a certain time window, lets say I zoomed in for the first AES round and still could chose to get 100k sample points. Here, the sample points are always determined by scope.adc.samples but when I increase this value it doesnt make my waveform more precise, it only extends the capture in time so I can capture all other rounds of AES which dont interest me.

My question would be, can I get more sample points in a chosen timebase window, so the capture is more precise?

Yes, by increasing the ratio of ADC sampling clock : target clock. The calculations in my previous post break this down. Then set scope.adc.samples to capture what interests you.

Doesnt increasing the radio of ADC sampling clock also increase the amount of points created, which is limited by the scope.adc.samples? Simply the trace array is 10k long if I set that value, even when the sampling rate is higher, shouldnt I also get more points here? Or are these 10k points more precise at higher sampling rate?

The 10k points are more precise at a higher sampling frequency. All that’s really happening is that every X seconds, we sample the ADC. We do this Y times. Here, X is 1/scope.clock.adc_freq (X=10ns for a 100MHz sampling frequency) and Y is scope.adc.samples. These two things are completely independent, so changing one doesn’t affect the other. Where these two things do combine is for the total sample time, which is roughly X*Y. If you only care about precision, you want the sampling frequency as high as possible, but if you care about the total sample time, you need to consider both.

For a 100MHz, 1 000 sample example, the ADC will be sampled at 0ns, 10ns, 20ns, 30ns, …, 9 990ns, for a total of 1 000 samples. If you change the sampling frequency to 10MHz, then you’ll get samples at 0ns, 100ns, …, 99 900ns for a total of 1 000 samples. If you instead change the number of samples to 10 000, then you’ll get samples at 0ns, 10ns, …, 99 990ns for a total of 10 000 samples.

Hope that helps

100MHz, 1000 sample → 0-10k ns
10MHz, 1000sample ->0-100k ns
100MHz, 10000sample->0-100k ns

Lets say my trigger signal records from 0 to 1000k ns, 100k ns is each AES round. I want only to record the first round for the attack. I used to perform the attack with 10MS/s sampling rate at 1000samples with success. Now, I wanted to increase the quality of my traces to be more precise, as I sample asynchronously. I changed the sampling rate to 100MS, but because of that, my records only reach 10k ns and not 100k ns (lets say we need whole AES round for attack for easier understanding). Therefore, I must also increase the samples gathered to 10k in order to get the whole AES round from 0-100k ns. Did I understand it correctly?

Yup, that all looks correct