Pico 2406B time_base=0 does not yield 1GS/s sampling

Post your C and C++ discussions here
Post Reply
bastianloeher
Newbie
Posts: 0
Joined: Tue Sep 18, 2018 1:00 pm

Pico 2406B time_base=0 does not yield 1GS/s sampling

Post by bastianloeher »

Hi,

I'm using a Pico 2406B with the C API from libps2000a_2.1.0-5r570_amd64.deb.

The information I used for programming is from the manual:
https://www.picotech.com/download/manua ... -guide.pdf
and the C examples:
https://github.com/picotech/picosdk-c-examples

Enabling a single channel and setting
time_base to 0
no downsampling
should result in 1GS/s sampling frequency.

The value time_interval_ns returned from the GetTimeBase2 call is also 1 ns.

Yet, apparently, the data read from the scope appears to be sampled with a 2 ns time step instead of a 1 ns time step.

---

I tested with the built-in Sine wave generator set to 1 MHz fed back into channel A of the scope.

When I read a buffer of 1000 samples with the above settings (i.e. 1 us of trace), the Sine signal is captured for two periods instead of one within the 1000 samples.

---

Another observation is:

When time_base is set to 1 (e.g. when a second channel is enabled), the number of Sine wave periods captured doubles to 4. This is expected, given that the sampling frequency divided by a factor of two when enabling a second channel.

When time_base is set to 2 (e.g. when a third channel is enabled), the number of Sine wave periods captured increases by a factor of 4 to 16. Instead, I expected another increase of factor 2 to 8 (from the manual .

---

When I do the same using the PicoScope software, everything looks fine, but there may be something else going on behind the scenes that I don't know about.

Maybe you can help me out.

Thanks
Bastian

Hitesh

Re: Pico 2406B time_base=0 does not yield 1GS/s sampling

Post by Hitesh »

Hi Bastian,

By default all channels are enabled when a connection is opened to the device.

Have you explicitly turned off three of the channels using the ps2000aSetChannel() function?

Regards,

bastianloeher
Newbie
Posts: 0
Joined: Tue Sep 18, 2018 1:00 pm

Re: Pico 2406B time_base=0 does not yield 1GS/s sampling

Post by bastianloeher »

Dear Hitesh,

yes, I have played around with enabling and disabling the various channels. After opening the device I first call SetChannels on all four channels, enabling only channel A, and disabling all others.

Then when I call GetTimeBase, I get a timeInterval of 1 ns back.

Still, when I then look at the sampled data, it appears to be sampled at 2 ns intervals.

Kind regards

Bastian

Hitesh

Re: Pico 2406B time_base=0 does not yield 1GS/s sampling

Post by Hitesh »

Hi Bastian,

What is the value of the timebase argument that is passed to the ps2000aRunBlock() function? I'd just like to check that the value has not changed between querying ps2000aGetTimebase() and the start of data acquisition.

If the value has not changed, it might be useful to see your code.

Regards,

bastianloeher
Newbie
Posts: 0
Joined: Tue Sep 18, 2018 1:00 pm

Re: Pico 2406B time_base=0 does not yield 1GS/s sampling

Post by bastianloeher »

The value for time_interval_ns does not change between the two calls.
I'll make a minimal example. Can I post it in this forum, or should I send it to another address?

bastianloeher
Newbie
Posts: 0
Joined: Tue Sep 18, 2018 1:00 pm

Re: Pico 2406B time_base=0 does not yield 1GS/s sampling

Post by bastianloeher »

Dear support,

I've fixed the problem on my side. Sorry for the inconvenience.
My error was, that I gave the timeIntervalNanoseconds returned from the GetTimebase() call to the RunBlock() function. Correct is of course to supply the same timebase to RunBlock() as to GetTimebase().

Problem solved.

Thank you.

Bastian

Hitesh

Re: Pico 2406B time_base=0 does not yield 1GS/s sampling

Post by Hitesh »

HI Bastian,

Thanks for confirming that the issue has been resolved.

Regards,

Post Reply