ADC Frequency in ChipWhisperer-Lite Setup

Hello everyone,

I’m working with a ChipWhisperer-Lite and encountered something puzzling during the setup. When I run the Setup_Generic script, it configures the adc_freq to be 160 MHz and sometimes even higher. However, according to the documentation, the maximum recommended value for adc_freq should be 105 MHz.

Here’s an example of the output from the Setup_Generic script:

INFO: Found ChipWhisperer😍
scope.gain.mode                          changed from low                       to high                     
scope.gain.gain                          changed from 0                         to 30                       
scope.gain.db                            changed from 5.5                       to 24.8359375               
scope.adc.basic_mode                     changed from low                       to rising_edge              
scope.adc.samples                        changed from 24400                     to 5000                     
scope.adc.trig_count                     changed from 231058                    to 3194540                  
scope.clock.adc_src                      changed from clkgen_x1                 to clkgen_x4                
scope.clock.adc_freq                     changed from 0                         to 162209632                
scope.clock.adc_rate                     changed from 0.0                       to 162209632.0              
scope.clock.clkgen_div                   changed from 1                         to 26                       
scope.clock.clkgen_freq                  changed from 192000000.0               to 7384615.384615385        
scope.io.tio1                            changed from serial_tx                 to serial_rx                
scope.io.tio2                            changed from serial_rx                 to serial_tx                
scope.io.hs2                             changed from None                      to clkgen                   
scope.io.cdc_settings                    changed from bytearray(b'\x01\x00\x00\x00') to bytearray(b'\x00\x00\x00\x00')

I’m curious to understand what this higher frequency value represents. Is it an expected behavior under certain conditions, or could there be a mistake in the configuration process?

Any insights or explanations would be greatly appreciated!

Thanks in advance for your help.
John

Indeed 105 MHz is the maximum clock frequency at which things are guaranteed to work.
For historical reasons, when CW-lite is first connected, clocks are set higher; however, running Setup_Generic (or just calling scope.default_setup()) sets the clocks to “normal” values.

Now sometimes you may still see strange values for some clock measurements, because Setup_Generic makes the clock changes and then reads and caches scope.clock properties before they may be settled. This commit should fix this; you can also manually set scope.clock._cached_adc_freq = None to force the clock frequency to be re-read at any time.

Thank you for bringing this to our attention!

Thank you for your answer.

I appreciate the explanation about the clock settings and the caching behavior. I have a follow-up question: when I run scope.capture() and observe this strange adc_freq value, what is the real adc_freq being used at that point? Should I assume that it is equivalent to the clkgen_x4 setting, or is there a more reliable way to determine the actual frequency during capture?

Thanks again for your help!

The strange adc_freq value you see is because it was read and cached before the ADC clock settled. Apply the fix above or set scope.clock._cached_adc_freq = None to force a fresh read of the clock frequency to get its actual value.